I get the following exception when trying to flush after I have called save..:
Code:
java.lang.NullPointerException
at org.hibernate.engine.EntityEntry.getLoadedValue(EntityEntry.java:141)
at org.hibernate.type.CollectionType.getKeyOfOwner(CollectionType.java:302)
at org.hibernate.engine.Collections.processReachableCollection(Collections.java:137)
at org.hibernate.event.def.FlushVisitor.processCollection(FlushVisitor.java:37)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:104)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:64)
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:58)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:198)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
at org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate(HibernateTemplate.java:815)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:366)
at org.springframework.orm.hibernate3.HibernateTemplate.flush(HibernateTemplate.java:813)
at no.havleik.dt.DAO.BaseHibernateDAO.saveOrUpdate(BaseHibernateDAO.java:34)
at no.havleik.dt.services.OrderServiceImpl.saveFellesOrder(OrderServiceImpl.java:197)
at no.havleik.dt.services.OrderServiceImpl$$FastClassByCGLIB$$cb9573dc.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.interceptor.CustomizableTraceInterceptor.invokeUnderTrace(CustomizableTraceInterceptor.java:269)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:111)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
at no.havleik.dt.services.OrderServiceImpl$$EnhancerByCGLIB$$1e98bbc5.saveFellesOrder(<generated>)
at no.havleik.dt.jsf.order.OrderBean.save(OrderBean.java:68)
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.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
at javax.faces.component.UICommand.broadcast(UICommand.java:312)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:285)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at no.havleik.dt.security.AuthFilter.doFilter(AuthFilter.java:83)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
And this is the log from Hibernate, during flush..:
Code:
25.03.2006 21:50:39,278 DEBUG AbstractFlushingEventListener - flushing session
25.03.2006 21:50:39,278 DEBUG AbstractFlushingEventListener - processing flush-time cascades
25.03.2006 21:50:39,279 DEBUG Cascades - processing cascade ACTION_SAVE_UPDATE for: no.havleik.dt.model.OrdreNew
25.03.2006 21:50:39,279 DEBUG Cascades - cascade ACTION_SAVE_UPDATE for collection: no.havleik.dt.model.OrdreNew.leveringer
25.03.2006 21:50:39,279 DEBUG Cascades - done cascade ACTION_SAVE_UPDATE for collection: no.havleik.dt.model.OrdreNew.leveringer
25.03.2006 21:50:39,280 DEBUG Cascades - cascade ACTION_SAVE_UPDATE for collection: no.havleik.dt.model.OrdreNew.istikks
25.03.2006 21:50:39,280 DEBUG Cascades - cascading to saveOrUpdate: no.havleik.dt.model.Istikk
25.03.2006 21:50:39,280 DEBUG AbstractSaveEventListener - persistent instance of: no.havleik.dt.model.Istikk
25.03.2006 21:50:39,281 DEBUG DefaultSaveOrUpdateEventListener - ignoring persistent instance
25.03.2006 21:50:39,281 DEBUG DefaultSaveOrUpdateEventListener - object already associated with session: [no.havleik.dt.model.Istikk#component[id,ordreid]{ordreid=6237, id=0}]
25.03.2006 21:50:39,281 DEBUG Cascades - done cascade ACTION_SAVE_UPDATE for collection: no.havleik.dt.model.OrdreNew.istikks
25.03.2006 21:50:39,282 DEBUG Cascades - cascade ACTION_SAVE_UPDATE for collection: no.havleik.dt.model.OrdreNew.logDistributionFramgangDefaults
25.03.2006 21:50:39,282 DEBUG Cascades - done cascade ACTION_SAVE_UPDATE for collection: no.havleik.dt.model.OrdreNew.logDistributionFramgangDefaults
25.03.2006 21:50:39,282 DEBUG Cascades - done processing cascade ACTION_SAVE_UPDATE for: no.havleik.dt.model.OrdreNew
25.03.2006 21:50:39,282 DEBUG AbstractFlushingEventListener - dirty checking collections
25.03.2006 21:50:39,283 DEBUG AbstractFlushingEventListener - Flushing entities and processing referenced collections
25.03.2006 21:50:39,288 DEBUG DefaultFlushEntityEventListener - Updating entity: [no.havleik.dt.model.OrdreNew#6237]
25.03.2006 21:50:39,289 DEBUG Versioning - Incrementing: 2004-12-04 10:47:32.958694 to 2006-03-25 21:50:39.288
25.03.2006 21:50:39,311 DEBUG Collections - Collection found: [no.havleik.dt.model.OrdreNew.leveringer#6237], was: [no.havleik.dt.model.OrdreNew.leveringer#6237] (initialized)
25.03.2006 21:50:39,312 DEBUG Collections - Collection found: [no.havleik.dt.model.OrdreNew.istikks#6237], was: [no.havleik.dt.model.OrdreNew.istikks#6237] (initialized)
25.03.2006 21:50:41,790 DEBUG JDBCTransaction - rollback
25.03.2006 21:50:41,790 DEBUG JDBCContext - before transaction completion
25.03.2006 21:50:41,790 DEBUG SessionImpl - before transaction completion
25.03.2006 21:50:41,790 DEBUG JDBCTransaction - re-enabling autocommit
25.03.2006 21:50:41,790 DEBUG JDBCTransaction - rolled back JDBC Connection
25.03.2006 21:50:41,790 DEBUG JDBCContext - after transaction completion
25.03.2006 21:50:41,790 DEBUG SessionImpl - after transaction completion
25.03.2006 21:50:41,790 DEBUG SessionImpl - closing session
25.03.2006 21:50:41,790 DEBUG ConnectionManager - closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
25.03.2006 21:50:41,790 DEBUG JDBCContext - after transaction completion
25.03.2006 21:50:41,790 DEBUG SessionImpl - after transaction completion
Can anyone shed a light?
Regards,
BTJ