-->
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.  [ 4 posts ] 
Author Message
 Post subject: AnnotationConfiguration, NoSuchMethodError: doSecondPass()
PostPosted: Thu Apr 19, 2007 4:54 am 
Newbie

Joined: Thu Apr 19, 2007 4:25 am
Posts: 2
I am having some problems getting AnnotationConfiguration to work. I have several entities that are annotated with javax.persistence. All of the entities are deployed and working in a jboss server. Due to time constraints, I need to access the database directly from a seperate webapp, so I am reusing the entity classes.

I configure like this:
AnnotationConfiguration annotationConfiguration = new AnnotationConfiguration();
annotationConfiguration.addAnnotatedClass(Account.class);
// set connection properties and dialect, all with .setProperty
return annotationConfiguration.buildSessionFactory();

I have tried using Hibernate 3.2.0.rc1, 3.2.0.ga, 3.2.1.ga and 3.2.2.ga with annotations 3.2.0.ga, 3.2.1.ga and 3.3.0.ga. Except from 3.3.0.ga which I downloaded from hibernate.org, I have downloaded through maven each time. I havent tried every possible combination of the above versions, but a few off them I have tried, including 3.2.2.ga with annotations 3.2.1.ga and 3.3.0.ga.

When I start up, I always get the error: java.lang.NoSuchMethodError: org.hibernate.cfg.SecondPass.doSecondPass(Ljava/util/Map;)V

When I debug into the code here, and runtime get the methods from the object which the no such method exception is thrown on, and from SecondPass, I get the following info:

[public org.hibernate.mapping.ToOne org.hibernate.cfg.FkSecondPass.getValue()
public void org.hibernate.cfg.FkSecondPass.doSecondPass(java.util.Map) throws org.hibernate.MappingException
public boolean org.hibernate.cfg.FkSecondPass.isInPrimaryKey()]
----
[public abstract void org.hibernate.cfg.SecondPass.doSecondPass(java.util.Map
java.util.Map) throws org.hibernate.MappingException]

Does SecondPass take 2 Maps? Doesn't look like it when I examine the source that maven downloaded along with hibernate 3.2.1.ga. Also, javadoc says only 1 map argument: http://www.hibernate.org/hib_docs/v3/api/

Which version of annotations work with which versions of the API? I would prefer to use hibernate-annotations 3.2.1.ga or earlier, as 3.3.0.ga is not in the central maven repository.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 19, 2007 6:36 am 
Newbie

Joined: Thu Apr 19, 2007 4:25 am
Posts: 2
Found the problem, I had a 2 hibernate 3.0 jars in my classpath. hibernate 3.2.2.ga and hibernate3-4.0.4.ga from jboss. Is there any version of annotations that works with that version of hibernate?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 20, 2007 10:49 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you mean the one from 4.0.4, there used to be a beta working with it. Can't remember which one though

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: AnnotationConfiguration, NoSuchMethodError: doSecondPass()
PostPosted: Mon Aug 24, 2009 10:10 am 
Newbie

Joined: Mon Aug 24, 2009 7:44 am
Posts: 1
Good solution, it is very helpful to me


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