[jboss-user] [EJB 3.0] - Re: @PostLoad invoked before eagerly loaded property finishe

icordoba do-not-reply at jboss.com
Thu Aug 23 14:02:53 EDT 2007


My Exception:

  | Caused by: javax.persistence.PersistenceException: org.hibernate.LazyInitializationException: illegal access to loading collection
  |         at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
  |         at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:194)
  |         at org.jboss.ejb3.entity.TransactionScopedEntityManager.find(TransactionScopedEntityManager.java:171)
  |         at com.servengine.user.UserManagerBean.getUser(UserManagerBean.java:839)
  |         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)
  |         ... 60 more
  | Caused by: org.hibernate.LazyInitializationException: illegal access to loading collection
  |         at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:341)
  |         at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
  |         at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:163)
  |         at com.servengine.user.User.ejbLoad(User.java:119)
  |         at sun.reflect.GeneratedMethodAccessor1187.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:585)
  |         at org.hibernate.ejb.event.BeanCallback.invoke(BeanCallback.java:23)
  |         at org.hibernate.ejb.event.EntityCallbackHandler.callback(EntityCallbackHandler.java:78)
  |         at org.hibernate.ejb.event.EntityCallbackHandler.postLoad(EntityCallbackHandler.java:71)
  |         at org.hibernate.ejb.event.EJB3PostLoadEventListener.onPostLoad(EJB3PostLoadEventListener.java:35)
  |         at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:201)
  |         at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
  |         at org.hibernate.loader.Loader.doQuery(Loader.java:729)
  |         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
  |         at org.hibernate.loader.Loader.loadEntity(Loader.java:1860)
  |         at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
  |         at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
  |         at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3044)
  |         at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)
  |         at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)
  |         at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
  |         at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)
  |         at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
  |         at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
  |         at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
  |         at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
  |         at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:174)
  |         ... 75 more
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077475#4077475

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077475



More information about the jboss-user mailing list