Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
OpenEntityManagerInViewFilter does not cover the cache? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • OpenEntityManagerInViewFilter does not cover the cache?

    I was very happy with the caching setup of Spring-module. But now I am facing a problem. An hibernate object in the cache that uses lazy loading is losing its session. I am using OpenEntityManagerInViewFilter but is does not help. The cache is configured with ehcache and I use the @Cacheable annotation.

    My error is this:
    15-Sep-2008 15:46:11 org.apache.catalina.core.ApplicationContext log
    SEVERE: Exception while dispatching incoming RPC call
    java.lang.RuntimeException: com.google.gwt.user.server.rpc.UnexpectedException : Service method 'public abstract java.util.List org.fao.fenix.web.modules.re.client.control.servic es.REService.search(org.fao.fenix.web.modules.re.c lient.view.vo.FenixSearchParameters,int,int)' threw an unexpected exception: org.hibernate.LazyInitializationException: could not initialize proxy - no Session
    at org.gwtwidgets.server.spring.GWTRPCServiceExporter .handleExporterProcessingException(GWTRPCServiceEx porter.java:344)
    at org.gwtwidgets.server.spring.GWTRPCServiceExporter .processCall(GWTRPCServiceExporter.java:313)
    at com.google.gwt.user.server.rpc.RemoteServiceServle t.doPost(RemoteServiceServlet.java:86)
    at org.gwtwidgets.server.spring.GWTRPCServiceExporter .handleRequest(GWTRPCServiceExporter.java:363)
    at org.springframework.web.servlet.mvc.HttpRequestHan dlerAdapter.handle(HttpRequestHandlerAdapter.java: 49)
    at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:875)
    at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:809)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
    at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:511)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :359)
    at org.springframework.security.intercept.web.FilterS ecurityInterceptor.invoke(FilterSecurityIntercepto r.java:109)
    at org.springframework.security.intercept.web.FilterS ecurityInterceptor.doFilter(FilterSecurityIntercep tor.java:83)
    at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
    at org.springframework.security.ui.SessionFixationPro tectionFilter.doFilterHttp(SessionFixationProtecti onFilter.java:67)
    at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
    at org.springframework.security.ui.ExceptionTranslati onFilter.doFilterHttp(ExceptionTranslationFilter.j ava:101)
    at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
    at org.springframework.security.providers.anonymous.A nonymousProcessingFilter.doFilterHttp(AnonymousPro cessingFilter.java:105)
    at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
    at org.springframework.security.wrapper.SecurityConte xtHolderAwareRequestFilter.doFilterHttp(SecurityCo ntextHolderAwareRequestFilter.java:91)
    at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
    at org.springframework.security.context.HttpSessionCo ntextIntegrationFilter.doFilterHttp(HttpSessionCon textIntegrationFilter.java:235)
    at org.springframework.security.ui.SpringSecurityFilt er.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy $VirtualFilterChain.doFilter(FilterChainProxy.java :371)
    at org.springframework.security.util.FilterChainProxy .doFilter(FilterChainProxy.java:174)
    at org.springframework.web.filter.DelegatingFilterPro xy.invokeDelegate(DelegatingFilterProxy.java:236)
    at org.springframework.web.filter.DelegatingFilterPro xy.doFilter(DelegatingFilterProxy.java:167)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.springframework.orm.jpa.support.OpenEntityMana gerInViewFilter.doFilterInternal(OpenEntityManager InViewFilter.java:112)
    at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:263)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:584)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447)
    at java.lang.Thread.run(Unknown Source)
    Caused by: com.google.gwt.user.server.rpc.UnexpectedException : Service method 'public abstract java.util.List org.fao.fenix.web.modules.re.client.control.servic es.REService.search(org.fao.fenix.web.modules.re.c lient.view.vo.FenixSearchParameters,int,int)' threw an unexpected exception: org.hibernate.LazyInitializationException: could not initialize proxy - no Session
    at com.google.gwt.user.server.rpc.RPC.encodeResponseF orFailure(RPC.java:360)
    at org.gwtwidgets.server.spring.GWTRPCServiceExporter .handleInvocationTargetException(GWTRPCServiceExpo rter.java:215)
    at org.gwtwidgets.server.spring.GWTRPCServiceExporter .processCall(GWTRPCServiceExporter.java:304)
    ... 49 more
    Caused by: org.hibernate.LazyInitializationException: could not initialize proxy - no Session
    at org.hibernate.proxy.AbstractLazyInitializer.initia lize(AbstractLazyInitializer.java:57)
    at org.hibernate.proxy.AbstractLazyInitializer.getImp lementation(AbstractLazyInitializer.java:111)
    at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitialize r.invoke(CGLIBLazyInitializer.java:150)
    at org.fao.fenix.domain.perspective.FenixDomainUser$$ EnhancerByCGLIB$$89edbd3e.getName(<generated>)
    at org.fao.fenix.domain.authorisation.DataAutorisatio nRule.userIsOwner(DataAutorisationRule.java:37)
    at org.fao.fenix.web.modules.re.server.Domain2VoConve rter.determineDataAutorisation(Domain2VoConverter. java:59)
    at org.fao.fenix.web.modules.re.server.Domain2VoConve rter.convertDomain2Vo(Domain2VoConverter.java:47)
    at org.fao.fenix.web.modules.re.server.REServiceImpl. search(REServiceImpl.java:404)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.gwtwidgets.server.spring.GWTRPCServiceExporter .invokeMethodOnService(GWTRPCServiceExporter.java: 148)
    at org.gwtwidgets.server.spring.GWTRPCServiceExporter .processCall(GWTRPCServiceExporter.java:298)
    ... 49 more
    My web.xml is this:
    <!--
    Added this filter after problems with GWT failed to lazily initialize a collection of role no session or session was
    closed
    -->
    <filter>
    <filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
    <filter-class>org.springframework.orm.jpa.support.OpenEnti tyManagerInViewFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    Anyone an idea?

  • #2
    I am getting the exact same error

    The error started after making changes in my Web.xml:

    <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFil terProxy</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

    any work arounds for this ?

    Comment

    Working...
    X