I'm not sure if this is a bug in Hibernate or a bug in javassist . I'm trying to isolate under exactly which circumstances this happens. Most of the time everything is OK but in 3 specific integration test classes I'm seeing the exception shown below.
It doesn't appear to be a race condition as it happens every time I run those tests.
It happens in Hibernate 3.2.6.ga and 3.3.1.GA with javassist 3.4.GA,3.7.1.GA,3.8.1.GA,3.9.0.GA
It seems similar to the following (but isn't fixed in 3.9.0):
http://www.jboss.com/index.html?module= ... 30#4115630
When I run it through the debugger it turns out that the proceed parameter passed in to DefaultMethodHandler.invoke is null.
Donnchadh
The exception is:
java.lang.NullPointerException
at javassist.util.proxy.RuntimeSupport$DefaultMethodHandler.invoke(RuntimeSupport.java:37)
at org.donnchadh.domainmodel.CharacterEncoding_$$_javassist_40.getHibernateLazyInitializer(CharacterEncoding_$$_javassist_40.java)
at org.hibernate.Hibernate.isInitialized(Hibernate.java:321)
at org.hibernate.engine.StatefulPersistenceContext.reassociateIfUninitializedProxy(StatefulPersistenceContext.java:482)
at org.hibernate.event.def.ProxyVisitor.processEntity(ProxyVisitor.java:27)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:104)
at org.hibernate.event.def.WrapVisitor.processValue(WrapVisitor.java:98)
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55)
at org.hibernate.event.def.AbstractSaveEventListener.visitCollectionsBeforeSave(AbstractSaveEventListener.java:371)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:273)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)