-->
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.  [ 7 posts ] 
Author Message
 Post subject: interesting hibernate 3 error
PostPosted: Fri Jun 03, 2005 9:55 am 
Newbie

Joined: Fri Jun 03, 2005 9:07 am
Posts: 4
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3

Mapping documents: I think the xml mappings seem to work fine when I use hibernate 2.

Here is the code between sessionFactory.openSession() and session.close():

public static Session currentSession() throws HibernateException {
Session s = (Session)session.get();
//Open a new session, if this thread has no session yet.
if(s == null) {
s = sessionFactory.openSession();
session.set(s);
}
return s;
}

public static void closeSession() throws HibernateException {
Session s = (Session)session.get();
session.set(null);
if(s != null) {
s.close();
}
}


Here is the full stack trace of the exception:

java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
Error in Hibernate: 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:215)
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 org.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:319)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
at gov.pbgc.cms.hibernate.HibernateManager.<clinit>(Unknown Source)
at gov.pbgc.cms.persistence.PensnPlanCaseDAO.save(Unknown Source)
at gov.pbgc.cms.util.HibernateExample.insertPensnPlanCase2(Unknown Source)
at gov.pbgc.cms.util.HibernateExample.main(Unknown Source)

java.lang.ExceptionInInitializerError
at gov.pbgc.cms.hibernate.HibernateManager.<clinit>(Unknown Source)
at gov.pbgc.cms.persistence.PensnPlanCaseDAO.save(Unknown Source)
at gov.pbgc.cms.util.HibernateExample.insertPensnPlanCase2(Unknown Source)
at gov.pbgc.cms.util.HibernateExample.main(Unknown Source)

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:215)
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 org.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:319)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
... 4 more
Exception in thread "main"


Database: Oracle 10g

The generated SQL (show_sql=true): The flag is set to true for show_sql in the xml hibernate.cfg.xml file. I get the error before the generated SQL shows up.

I am not using a log4j logging mechanism right now for logs.

It seems to work fine when I am using hibernate 2, but doesn't seem to work when using hibernate 3. I get the above exception. I copied all the hibernate3/lib libraries to my project's/WEB-INF/lib directory. Any suggestions and thoughts would be appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 10:03 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you still ahev the wrong asm version somewhere.
Please use the latest hibernate version with external asm jars

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 10:56 am 
Newbie

Joined: Fri Jun 03, 2005 9:07 am
Posts: 4
Emmanuel,

I am using the asm jars that came with hibernate 3. Do you know if they are not up to date? Do you know where I can download the latest versions of asjm jars?

Thanks.

Nirakar


emmanuel wrote:
you still ahev the wrong asm version somewhere.
Please use the latest hibernate version with external asm jars


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 11:02 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Which cglib jar are you using? Some cglib jars actually bundle the asm classes directly.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 11:30 am 
Newbie

Joined: Fri Jun 03, 2005 9:07 am
Posts: 4
Steve,

I am using cglib-2.1 and cglib-full-2.0.2.

Nirakar


steve wrote:
Which cglib jar are you using? Some cglib jars actually bundle the asm classes directly.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 12:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Do you really need me to go on?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 03, 2005 1:25 pm 
Newbie

Joined: Fri Jun 03, 2005 9:07 am
Posts: 4
Steve,

What I did was I upgraded from hibernate version 3.0.3 (hibernate-3.0.3) to
hibernate version 3.0.5(hibernate-3.0.5). After that I copied all the hibernate3/lib jar files to my project's WEB-INF/lib directory and it started to work fine after that. I have been able to insert, update and get data from the database through hibernate 3.0.5 version. I will be testing it more thoroughly.

I am not sure though what is wrong with the hibernate-3.0.3 version. If someone knows what could be wrong with hibernate-3.0.3 version, then please let other people know here on this forum.

Thanks for your replies.

Nirakar


steve wrote:
Do you really need me to go on?


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