views:

1119

answers:

1

I get these error log when 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:510) 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 Session has been closed. But I really don't know why this error occur not so often that why I don't know the root cause is.

Enviroment:

Tapestry5, JPA, Hibernate 3.3.2.GA

I've set

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

in web.xml also

A: 

Did you see this - http://stackoverflow.com/questions/345705/hibernate-lazyinitializationexception-could-not-initialize-proxy

Padmarag
Yes, I read it that why my title is No Session again. I know this issue comes from many reason. In your link, the reason is using transaction. I guess other factors involved such as Tapestry thread?, using transaction? using Hibernate Level 2 Cache?But I don't know how to change transaction at what level? tapestry or Spring ( I'm using Spring service).I'm still investigating and hope someone could help me.Regards
Iapilgrim