[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3705) NPE encountered on using AnnotationConfiguration

Kaizer (JIRA) noreply at atlassian.com
Tue Jan 13 00:44:39 EST 2009


NPE encountered on using AnnotationConfiguration
------------------------------------------------

                 Key: HHH-3705
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3705
             Project: Hibernate Core
          Issue Type: Bug
          Components: envers
    Affects Versions: 3.3.1
            Reporter: Kaizer
         Attachments: Hibernate_AnnotationTest.zip

I have a bidirectional association between a Client and a ClientAddress. When I load a Client, the reference of Client set in the ClientAddress is Client_$$_javassist_0 which I think is the proxy. Now when I update or delete the client, I get a NPE - 

Exception in thread "main" java.lang.NullPointerException 
at org.hibernate.envers.event.AuditEventListener.generateBidirectionalCollectionChangeWorkUnits(AuditEventListener.java:107) 
at org.hibernate.envers.event.AuditEventListener.onPostDelete(AuditEventListener.java:153) 
at org.hibernate.action.EntityDeleteAction.postDelete(EntityDeleteAction.java:150) 
at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:117) 
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) 
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) 
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172) 
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) 
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) 
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) 

This is because the entry in the EntitiesConfigurations Map is of Client and not Client_$$_javassist_0. 

This works perfectly fine on moving to JPA (EntityManager, etc).

I have attached a test case for the same. The DB settings will need to be changed. The above exception is encountered on running the deleteClient method in HibernateAnnotationTest.java. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list