-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: LazyInitializationException: from 3.2.0CR2 to 3.2.4.sp1
PostPosted: Mon Feb 18, 2008 9:11 am 
Newbie

Joined: Fri Mar 02, 2007 6:31 am
Posts: 19
We used to run JBoss 4.0.4.GA and we included Hibernate 3.2.0CR2. Now we migrated to JBoss 4.2.2.GA and in that one Hibernate 3.2.4.sp1 is included by default.

Unfortunately, we're getting LazyInitializationException when the object graph is more than 2 levels deep.
E.g. RtTask --[OK]--> Priority --[FAIL]--> DictionaryEntry


We haven't changed anything to our beans or configuration files.

What's causing this? Is there something changed in the configuration of 3.2.4.sp1 as compared to 3.2.0CR2?

Thanks.


Nick.


Stack trace:
Code:
2008-02-18 13:52:35,425 ERROR [org.hibernate.LazyInitializationException] could not initialize proxy - no Session
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
   at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
   at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
   at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:166)
   at com.fpc.nokeos.core.common.beans.persistent.Priority_$$_javassist_13.getEntryName(Priority_$$_javassist_13.java)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at com.fpc.nokeos.core.server.dictionary.DictionaryContext.getField(DictionaryContext.java:319)
   at com.fpc.nokeos.core.server.dictionary.DictionaryContext.preparePojoAfterGetting(DictionaryContext.java:276)
   at com.fpc.nokeos.component.controlpanel.task.server.business.ControlPanelPluginTaskHelper.cleanRtTask(ControlPanelPluginTaskHelper.java:184)
   at com.fpc.nokeos.component.controlpanel.task.server.business.ControlPanelPluginTaskHelper.executeQueryToGetCPItem(ControlPanelPluginTaskHelper.java:575)
   at com.fpc.nokeos.component.controlpanel.task.server.business.ControlPanelPluginTaskHelper.getControlPanelItemsByFilter(ControlPanelPluginTaskHelper.java:525)
   at com.fpc.nokeos.component.controlpanel.task.server.ejb.ControlPanelPluginTaskBean.getControlPanelItemsByFilter(ControlPanelPluginTaskBean.java:59)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
   at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
   at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
   at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
   at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:115)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
   at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
   at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
   at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
   at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
   at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
   at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
   at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
2008-02-18 13:52:35,534 ERROR [com.fpc.nokeos.core.server.dictionary.DictionaryContext] Could not get field 'NAME'.
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at com.fpc.nokeos.core.server.dictionary.DictionaryContext.getField(DictionaryContext.java:319)
   at com.fpc.nokeos.core.server.dictionary.DictionaryContext.preparePojoAfterGetting(DictionaryContext.java:276)
   at com.fpc.nokeos.component.controlpanel.task.server.business.ControlPanelPluginTaskHelper.cleanRtTask(ControlPanelPluginTaskHelper.java:184)
   at com.fpc.nokeos.component.controlpanel.task.server.business.ControlPanelPluginTaskHelper.executeQueryToGetCPItem(ControlPanelPluginTaskHelper.java:575)
   at com.fpc.nokeos.component.controlpanel.task.server.business.ControlPanelPluginTaskHelper.getControlPanelItemsByFilter(ControlPanelPluginTaskHelper.java:525)
   at com.fpc.nokeos.component.controlpanel.task.server.ejb.ControlPanelPluginTaskBean.getControlPanelItemsByFilter(ControlPanelPluginTaskBean.java:59)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
   at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
   at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
   at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:166)
   at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:115)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
   at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
   at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
   at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
   at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
   at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
   at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
   at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
   at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
Caused by: org.hibernate.LazyInitializationException: could not initialize proxy - no Session
   at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)
   at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
   at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:166)
   at com.fpc.nokeos.core.common.beans.persistent.Priority_$$_javassist_13.getEntryName(Priority_$$_javassist_13.java)
   ... 46 more


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 19, 2008 10:56 am 
Newbie

Joined: Fri Mar 02, 2007 6:31 am
Posts: 19
I did some more testing: I replaced the Hibernate version that came with JBoss 4.2.2.GA with the latest namely hibernate3.jar (from Hibernate Core 3.2.6.ga) and hibernate-annotations.jar, hibernate-commons-annotations.jar, ejb3-persistence.jar & hibernate-validator.jar (from Hibernate Annotations 3.3.0 GA).

Unfortunately, that doesn't work either.

For now we can use the old versions but we really like to use the ones that came with JBoss. It makes it easier to migrate to newer versions of the AS when we don't have to care about Hibernate anymore. Additionally, the newer ones will have fixes for bugs that now might haunt us.

All help still greatly appreciated.

Thanks,

Nick


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 20, 2008 6:26 am 
Newbie

Joined: Fri Mar 02, 2007 6:31 am
Posts: 19
I did some more testing: I went through all the versions to find which one was the first to break things.
It seems that Hibernate 3 version 3.2.4.GA is the first version to throw the exception.

I checked the Hibernate JIRA site for the release (link) but I don't see anything that might have introduced the bug.

As neither our beans nor our configuration has changed, I consider this issue a bug and I'll report it in JIRA as such.


Thanks,

Nick


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 06, 2008 11:25 am 
Newbie

Joined: Fri Mar 02, 2007 6:31 am
Posts: 19
While creating a test case for my bug report I found out the problem was with Session.clear(). Apparently, it is a bug but unfortunately it is one of the older versions. Hibernate is suppose to throw the LazyInitializationException after using the clear()-method. (link)
Too bad we've created a lot of code that depend on this bug.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.