Failed to initialize proxy - No session again

I get this error log while viewing a page

 ERROR [TP-Processor11] (LazyInitializationException.java:42) - could not initialize proxy - no Session
 org.hibernate.LazyInitializationException: could not initialize proxy - no Session
     at org.hibernate.proxy.AbstractLazyInitializer.initialize (AbstractLazyInitializer.java:132)
     at org.hibernate.proxy.AbstractLazyInitializer.getImplementation (AbstractLazyInitializer.java:174)
     at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke (JavassistLazyInitializer.java:190)
     at org.osmoz.contents.model.enm.ContentType _ $$ _ javassist_71.getDefaultShortMode (ContentType _ $$ _ javassist_71.java)
     at org.osmoz.contents.web.tapestry.components.EnmContentZone.getTemplate (EnmContentZone.java:67)
     at org.osmoz.contents.web.tapestry.base.AbstractRawContentZone.getContent (AbstractRawContentZone.java:67)
     at $ PropertyConduit_1276091af82.get ($ PropertyConduit_1276091af82.java)
     at org.apache.tapestry5.internal.bindings.PropBinding.get (PropBinding.java:58)
     at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl $ 1.read (InternalComponentResourcesImpl.javaβˆ—10)
     at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl $ 1.read (InternalComponentResourcesImpl.java:496)
     at org.apache.tapestry5.corelib.components.OutputRaw ._ $ read_parameter_value (OutputRaw.java)
     at org.apache.tapestry5.corelib.components.OutputRaw.beginRender (OutputRaw.java:43)
     at org.apache.tapestry5.corelib.components.OutputRaw.beginRender (OutputRaw.java)
     at

I know the problem is closed. But I really don’t know why this error does not occur so often, so why I don’t know what the main reason is.

Environment:

Tapestry5, JPA, Hibernate 3.3.2.GA

I have installed

<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class> 

in web.xml also

+7
lazy-initialization hibernate
source share
1 answer

Use @Transactional for a method in a layer annotated with the @Service (Spring) service.

+5
source share

All Articles