-->
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.  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Hibernate and annotations compatibility?
PostPosted: Sat Nov 19, 2005 10:46 am 
Newbie

Joined: Wed Sep 14, 2005 3:22 pm
Posts: 3
I'm having problems after upgrading my hibernate and annotations libraries. My app used to work with hibernate-3.1beta3 and annotations-3.1beta5. But since I upgraded to hibernate-3.1rc3 and annotations-3.1beta6 I'm getting the attached exception. This is still true, even if I downgrade hibernate to 3.1rc1 (which is named as compatible on the website http://www.hibernate.org/247.html)

Any suggestions?

Hibernate version:
3.1rc1 or 3.1rc3

Mapping documents:
annotations-3.1beta5 or 3.1beta6

Code between sessionFactory.openSession() and session.close():
haven't reached that point

Full stack trace of any exception that occurs:
java.lang.NoSuchMethodError: org.hibernate.cfg.Mappings.<init>(Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/List;Lorg/hibernate/cfg/NamingStrategy;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;)V
at org.hibernate.cfg.ExtendedMappings.<init>(ExtendedMappings.java:50)
at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:126)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:253)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:191)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1145)
at org.fortha.persistence.hibernate.SessionProvider.<init>(SessionProvider.java:12)
at test.org.fortha.persistence.hibernate.ResourceManagerTest.setUp(ResourceManagerTest.java:19)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


Name and version of the database you are using:
hsqldb-1.8.0.2

The generated SQL (show_sql=true):
didn't get there

Debug level Hibernate log excerpt:
none


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 20, 2005 6:41 pm 
Newbie

Joined: Wed Sep 21, 2005 1:13 am
Posts: 5
spierepf,

I have the same error when I upgraded to hibernate-3.1rc3.

My config was working fine with annotations-3.1beta6 and hibernate-3.1rc2.

However a simple roll-back to hibernate-3.1rc2 (and recompiling) has fixed the problem.

hth
davidv


Top
 Profile  
 
 Post subject: known problem ...
PostPosted: Sun Nov 20, 2005 8:21 pm 
Newbie

Joined: Wed Sep 21, 2005 1:13 am
Posts: 5
I just saw this thread over in the main forum

http://forum.hibernate.org/viewtopic.php?t=950266

Quote:

Posted: Fri Nov 18, 2005 11:44 am

Hibernate 3.1 RC3 is not compatible with Hibernate Annotation 3.1beta6. Will be with 3.1beta7
_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 4:20 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Note that it's not really a problem, since, nobody ever claim that compatible with rc3.
The official compatible release is written in the dist doc

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 6:09 am 
Newbie

Joined: Wed Sep 21, 2005 1:13 am
Posts: 5
... and nobody is complaining ... just commenting :-)

It was a bonus that it worked with rc2 .. am happy to wait for the next release of annotations.

thanks for your efforts !
davidv


Top
 Profile  
 
 Post subject: ooops
PostPosted: Thu Nov 24, 2005 3:19 am 
Newbie

Joined: Wed Sep 21, 2005 1:13 am
Posts: 5
Actually, I was wrong ... it does NOT work with rc2, I was getting nasty errors using the Spring OpenSessionInViewInterceptor (early commit and then opening up a new jdbc connection, which was left open) when I combined annotations-beta6 with hibernate-rc2.

It all works as advertised when I roll back to rc1.

hth
davidv


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 24, 2005 9:35 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
i try last cvs (hibernate and hibernate annotations) and it work - i haven't NoSuchMethod error


Top
 Profile  
 
 Post subject: Re: ooops
PostPosted: Fri Nov 25, 2005 6:55 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
dvarnes wrote:
Actually, I was wrong ... it does NOT work with rc2, I was getting nasty errors using the Spring OpenSessionInViewInterceptor (early commit and then opening up a new jdbc connection, which was left open) when I combined annotations-beta6 with hibernate-rc2.

It all works as advertised when I roll back to rc1.

hth
davidv


This issue is related to Spring, not us.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 13, 2005 8:32 am 
Newbie

Joined: Thu Aug 25, 2005 8:04 am
Posts: 3
1.)
Hibernate 3.1rc2 + Hib Annotations beta 6 + Spring 1.26 = fine


2.)
Hibernate 3.1 + Hib Annotations beta 6 + Spring 1.26 =

java.lang.NoSuchMethodError: org.hibernate.cfg.Mappings.<init>(Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/util/List;Lorg/hibernate/cfg/NamingStrategy;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;)V
at org.hibernate.cfg.ExtendedMappings.<init>(ExtendedMappings.java:50)
at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:126)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:253)


3.)
Hibernate 3.1 + Hib Annotations last CVS(27.nov) + Spring 1.26 =

java.lang.NoSuchMethodError:
org.hibernate.mapping.PersistentClass.setAbstract(Z)V
at org.hibernate.cfg.annotations.EntityBinder.bindEntity(EntityBinder.java:141)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:475)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:266)


--> Seems to be a conflict between Hibernate(later than rc2) and Hib Annotations.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 13, 2005 10:06 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
So use Hibernate 3.1rc1 or rc2 with the Hibernate Annotations beta6. This is documented everywhere. Or wait for beta7.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 13, 2005 10:55 am 
Regular
Regular

Joined: Tue Jan 06, 2004 3:32 pm
Posts: 80
Location: Munich, Germany
Any idea when beta7 will be out?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 13, 2005 11:16 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You know, we actually have an issue tracking system where you guys could look before posting.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 13, 2005 11:30 am 
Regular
Regular

Joined: Tue Jan 06, 2004 3:32 pm
Posts: 80
Location: Munich, Germany
christian wrote:
You know, we actually have an issue tracking system where you guys could look before posting.


I'm so sorry I did not think of that. Actually, this is the first time I see a release date before the actual release in JIRA. Usually, you can only see the open tasks.

So, to answer my own question: It looks like beta7 is due out today! Yeeeah!


Top
 Profile  
 
 Post subject: NoSuchMethodError with Hib 3.1final and Annotations 3.1beta7
PostPosted: Sat Jan 07, 2006 10:42 am 
Newbie

Joined: Sat Jan 07, 2006 10:33 am
Posts: 18
Location: New York NY
I am getting the same NoSuchMethodError noted previously by Florian206, using the final release of Hibernate 3.1, and Annotations 3.1beta7:

Code:
java.lang.NoSuchMethodError: org.hibernate.mapping.PersistentClass.setAbstract(Ljava/lang/Boolean;)V
   at org.hibernate.cfg.annotations.EntityBinder.bindEntity(EntityBinder.java:141)
   at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:475)
   at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:266)
   at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:199)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1145)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 12, 2006 2:39 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you're wrong on one of the 2 jars, check your classpath

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 18 posts ]  Go to page 1, 2  Next

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.