-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: NoClassDefFoundError - javassist needed when using cglib?
PostPosted: Sun Nov 30, 2008 11:19 pm 
Newbie

Joined: Tue Jan 18, 2005 11:13 pm
Posts: 19
I'm using Hibernate EntityManager 3.3.2, Core 3.2.6, and Annotations 3.3.1.

Not sure if this information will help, but the problem appears to have started after upgrading from Netbeans RCP 6.1 to 6.5.

I'm getting the exception below when I try to create an EntityManagerFactory. I know this class is part of the javassist library, which I've never needed before. In addition, I thought this library was only required if using javassist as the bytecode provider. Is this true? Does the stack trace below indicate that Hibernate is using javassist as the bytecode provider? I couldn't tell from looking at the source code. From what I've seen AbstractJarVisitor is a fairly generic class and is explicitly referencing the class, "ClassFile", so I'm starting to think that javassist is required no matter what bytecode provider is being used.

Though, it's odd to me that this problem would come about with the change in Netbeans versions.

In any case, can anyone provide some info here about the dependency on the javassist library?

Thanks.

java.lang.NoClassDefFoundError: javassist/bytecode/ClassFile
at org.hibernate.ejb.packaging.AbstractJarVisitor.checkAnnotationMatching(AbstractJarVisitor.java:236)
at org.hibernate.ejb.packaging.AbstractJarVisitor.executeJavaElementFilter(AbstractJarVisitor.java:202)
at org.hibernate.ejb.packaging.AbstractJarVisitor.addElement(AbstractJarVisitor.java:163)
at org.hibernate.ejb.packaging.FileZippedJarVisitor.doProcessElements(FileZippedJarVisitor.java:100)
at org.hibernate.ejb.packaging.AbstractJarVisitor.getMatchingEntries(AbstractJarVisitor.java:139)
at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:287)
at org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:282)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:247)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 09, 2008 5:34 pm 
Newbie

Joined: Tue Dec 09, 2008 4:56 pm
Posts: 6
I believe you need to set the following property to use cglib, instead of javassist

Code:
<property name="hibernate.bytecode.provider" value="cglib" />


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.