I had such configuration:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="
http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/carpartswebsite-servlet.xml</param-value>
    </context-param>

    <listener>

<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>carpartswebsite</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>

      <servlet>
        <servlet-name>wicket</servlet-name>

<servlet-class>org.apache.wicket.protocol.http.WicketServlet</servlet-class>
        <init-param>
            <param-name>applicationFactoryClassName</param-name>

<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

      <servlet-mapping>
        <servlet-name>wicket</servlet-name>
        <url-pattern>/*</url-pattern>
      </servlet-mapping>

      <servlet>
        <servlet-name>XFireSOAPServlet</servlet-name>

<servlet-class>org.codehaus.xfire.spring.XFireSpringServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>XFireSOAPServlet</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>

  <filter>
    <filter-name>OpenSessionInViewFilter</filter-name>

<filter-class>pl.mainseek.car.commons.CarPartsOpenSessionInViewFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>OpenSessionInViewFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
      </welcome-file-list>
</web-app>


.. and this was working, but when i've changed servlet mapping to filter
mapping:

<?xml version="1.0"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="
http://www.w3.org/TR/xmlschema-1/";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
version="2.4">
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/carpartswebsite-servlet.xml</param-value>
    </context-param>

    <listener>

<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!--servlet>
        <servlet-name>carpartswebsite</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet-->

    <filter>
        <filter-name>WicketFilter</filter-name>

<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
        <init-param>
            <param-name>applicationFactoryClassName</param-name>

<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
            <param-name>applicationBean</param-name>
            <param-value>wicketApplication</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>WicketFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>ERROR</dispatcher>

        <error-page>
            <error-code>404</error-code>
            <location>/404</location>
        </error-page>
    </filter-mapping>

    <!--servlet>
        <servlet-name>wicket</servlet-name>

<servlet-class>org.apache.wicket.protocol.http.WicketServlet</servlet-class>
        <init-param>
            <param-name>applicationFactoryClassName</param-name>

<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

      <servlet-mapping>
        <servlet-name>wicket</servlet-name>
        <url-pattern>/*</url-pattern>
      </servlet-mapping-->

      <servlet>
        <servlet-name>XFireSOAPServlet</servlet-name>

<servlet-class>org.codehaus.xfire.spring.XFireSpringServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>XFireSOAPServlet</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>

  <filter>
    <filter-name>OpenSessionInViewFilter</filter-name>

<filter-class>pl.mainseek.car.commons.CarPartsOpenSessionInViewFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>OpenSessionInViewFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
      </welcome-file-list>
</web-app>

.. it doesn't work. I get the org.hibernate.LazyInitializationException.

Please, help me !!! :)

Reply via email to