You're right, but the fact is that the hibernate method we post don't consider the possibility that the reference could come null using the variable assuming that it could never come null. What we are trying to understand is that if the problem is coused by a bug in the framework or by a result of wrong use of it...
The sequence of our application before the crash is like we told you on the precedent messages but we try to exlpain you again:
1-load an object (in this process we obtain the session and clear it)
2-add a new object to a collection of the first object loaded previously
3-save the second object (clearing again the session and invoking saveOrUpdate)
4-flush the session
During the flush process we got the NullPointerException...
About the stacktrace... my program wasn't eating it.. it was jboss.. anyway.. found it..
14:12:17,169 INFO [STDOUT] java.lang.NullPointerException
14:12:17,173 INFO [STDOUT] at net.sf.hibernate.impl.SessionImpl.collectionIsDirty(SessionImpl.java:2982)
14:12:17,175 INFO [STDOUT] at net.sf.hibernate.impl.DirtyCollectionSearchVisitor.processCollection(DirtyCollectionSearchVisitor.java:50)
14:12:17,178 INFO [STDOUT] at net.sf.hibernate.impl.AbstractVisitor.processValue(AbstractVisitor.java:69)
14:12:17,180 INFO [STDOUT] at net.sf.hibernate.impl.AbstractVisitor.processValues(AbstractVisitor.java:36)
14:12:17,181 INFO [STDOUT] at net.sf.hibernate.impl.SessionImpl.isUpdateNecessary(SessionImpl.java:2611)
14:12:17,183 INFO [STDOUT] at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2526)
14:12:17,186 INFO [STDOUT] at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2458)
14:12:17,188 INFO [STDOUT] at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2260)
14:12:17,189 INFO [STDOUT] at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2239)
14:12:17,191 INFO [STDOUT] at uy.edu.ort.persistence.HibernateMediator.save(HibernateMediator.java:87)
14:12:17,193 INFO [STDOUT] at uy.edu.ort.domain.manager.CompanyManager.save(CompanyManager.java:230)
14:12:17,195 INFO [STDOUT] at uy.edu.ort.domain.ejb.PropertyServicesBean.saveChoto(PropertyServicesBean.java:131)
14:12:17,197 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:12:17,199 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
14:12:17,201 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:12:17,203 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
14:12:17,206 INFO [STDOUT] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
14:12:17,208 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
14:12:17,211 INFO [STDOUT] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
14:12:17,214 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
14:12:17,217 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
14:12:17,219 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
14:12:17,221 INFO [STDOUT] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
14:12:17,233 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
14:12:17,235 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
14:12:17,237 INFO [STDOUT] at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
14:12:17,240 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:723)
14:12:17,241 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
14:12:17,244 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:12:17,246 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
14:12:17,247 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
14:12:17,249 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
14:12:17,251 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
14:12:17,253 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
14:12:17,255 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
14:12:17,257 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
14:12:17,260 INFO [STDOUT] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:360)
14:12:17,261 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
14:12:17,264 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:12:17,266 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
14:12:17,268 INFO [STDOUT] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
14:12:17,269 INFO [STDOUT] at sun.rmi.transport.Transport$1.run(Transport.java:148)
14:12:17,272 INFO [STDOUT] at java.security.AccessController.doPrivileged(Native Method)
14:12:17,274 INFO [STDOUT] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
14:12:17,276 INFO [STDOUT] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
14:12:17,278 INFO [STDOUT] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
14:12:17,280 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)
|