-->
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.  [ 3 posts ] 
Author Message
 Post subject: Error creating sessionFactory - ...asm.ClassVisitor.visit()
PostPosted: Tue Jul 24, 2007 1:36 pm 
Newbie

Joined: Fri Jul 08, 2005 4:39 am
Posts: 4
Hibernate 3.2.4
Websphere 6.1

Full stack trace of any exception that occurs:
Caused by: java.lang.NoSuchMethodError: org/objectweb/asm/ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)
at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:173)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:192)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117)
at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at ....util.HibernateUtil.<clinit>(HibernateUtil.java:13)
... 46 more

Name and version of the database you are using:
DB2

Exception occurs when calling sessionFactory = new Configuration().configure().buildSessionFactory();

HibernateUtil is the same as in http://hibernate.org/42.html#A11

The deployed ear file includes asm.jar and cglib-2.1.3.jar. The asm.jar is version 1.5.3. Both are from the Hibernate 3.2.4 download. A jar file in this ear contains the mapping file, domain object and HibernateUtil. hibernate.cfg.xml is in the root of this jar. The MANIFEST.MF includes the dependencies to the asm.jar and cglib-2.1.3.jar and other required jars in the ear file.

I have looked at similar problems on the Hibernate forum suggesting that another version of asm.jar is in the servers classpath. I have searched to see if WebSphere has other versions of these jars in its classpath (or any other places), but I haven't found any. I can't find any versions of cglib-full either.


Top
 Profile  
 
 Post subject: ClassVisitor
PostPosted: Wed Jul 25, 2007 7:43 am 
Beginner
Beginner

Joined: Wed Oct 25, 2006 9:05 am
Posts: 40
Location: France, Lieusaint
Hi,

I have the same version as yours but the visit method signature is:

Code:
visit(int version, int access, String name, String superName, String[] interfaces, String sourceFile);


Is is it the same for you ?


Top
 Profile  
 
 Post subject: fixed with cglib-nodeps
PostPosted: Wed Jul 25, 2007 10:34 am 
Newbie

Joined: Fri Jul 08, 2005 4:39 am
Posts: 4
Solved the problem by including cglib-nodeps which includes asm instead of cglib and asm + asm-attrs in separate jars as distributed with Hibernate 3.2.x. Fixes the problem :-)

Could probably also have configured Hibernate to use javassist as bytecode provider to solve it as well but are not going to try since it is already working. Hope there are no serious issues with using the nodeps version with Hibernate. Thanks for the response.


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