Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Hibernate 4.1.1 + Java 7 + bytecode instrumentation problem
PostPosted: Thu Mar 29, 2012 10:44 pm 
Newbie

Joined: Sun Aug 28, 2005 1:29 pm
Posts: 12
I'm getting a NPE when using Hibernate with bytecode instrumentation. Has anyone seen something like this before?

I'm using -XX:-UseSplitVerifier.

If I turn off byte code instrumentation, it works correctly.

Thanks
Andrew

java.lang.NullPointerException
at org.hibernate.engine.spi.EntityEntry.isUnequivocallyNonDirty(EntityEntry.java:304)
at org.hibernate.engine.spi.EntityEntry.requiresDirtyCheck(EntityEntry.java:296)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:163)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:225)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:55)
at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1099)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1154)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:280)
...


Top
 Profile  
 
 Post subject: Re: Hibernate 4.1.1 + Java 7 + bytecode instrumentation problem
PostPosted: Fri Mar 30, 2012 9:48 pm 
Newbie

Joined: Sun Aug 28, 2005 1:29 pm
Posts: 12
The problem is triggered in this code (org.hibernate.event.internal.DefaultFlushEntityEventListener -- line 248ff):
Code:
            if ( event.getEntityEntry().getPersister().getInstrumentationMetadata().isInstrumented() ) {
               event.getEntityEntry()
                     .getPersister()
                     .getInstrumentationMetadata()
                     .extractInterceptor( event.getEntity() )
                     .clearDirty();
            }

The call to extractInterceptor() is returning null.

The extractInterceptor() method in org.hibernate.bytecode.internal.javassist.BytecodeProviderImpl (line 151) calls this:
Code:
return JavassistHelper.extractFieldInterceptor( entity );

This calls org.hibernate.bytecode.instrumentation.internal.javassist.JavassistHelper line 39ff):
Code:
public static FieldInterceptor extractFieldInterceptor(Object entity) {
      return ( FieldInterceptor ) ( ( FieldHandled ) entity ).getFieldHandler();
   }

In the debugger the injected variable $JAVASSIST_READ_WRITE_HANDLER is null.

Any ideas on what I am doing wrong?

Thanks
Andrew


Top
 Profile  
 
 Post subject: Re: Hibernate 4.1.1 + Java 7 + bytecode instrumentation problem
PostPosted: Wed Apr 04, 2012 1:24 pm 
Newbie

Joined: Sun Aug 28, 2005 1:29 pm
Posts: 12
Would instrumenting non-domain classes (like the metamodel classes for example) cause problems? Is there anything that needs to be on the classpath at run-time besides the standard hibernate and javassist libraries?

Thanks
Andrew


Top
 Profile  
 
 Post subject: Re: Hibernate 4.1.1 + Java 7 + bytecode instrumentation problem
PostPosted: Thu Jun 14, 2012 5:30 pm 
Newbie

Joined: Thu Jun 14, 2012 5:27 pm
Posts: 1
I am seeing the same issues when I try to delete an entity. Were you able to resolve this?

Thanks,
Deepa.


Top
 Profile  
 
 Post subject: Re: Hibernate 4.1.1 + Java 7 + bytecode instrumentation problem
PostPosted: Wed Jan 30, 2013 4:12 pm 
Newbie

Joined: Thu Apr 27, 2006 2:00 pm
Posts: 1
Hey still broken in 4.1.9. Whaddup? I needs mah @Basic(fetch=FetchType.LAZY) which needs bytecode instrumentation. I needs it man. Please. Help. I want to be lazy.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.