-->
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 when running ant script: "java.lang.NoSuchMethodError"
PostPosted: Wed Jul 27, 2011 10:40 am 
Newbie

Joined: Wed Jul 27, 2011 10:17 am
Posts: 5
Hello folks

I am beginning to use hibernate. I bought the book "Java Persistence with Hibernate" and am going through the examples in chapter 2.

Now I am stuck trying to reverse-engeneer a table (MESSAGES) using an ant script. The important part of the ant script is this:

<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="project.classpath" />

<target name="reveng.hbmxml" description="Produces XML mapping files in src directory">
<hibernatetool destdir="${basedir}/src">
<jdbcconfiguration propertyfile="${basedir}/helloworld.db.properties" revengfile="${basedir}/helloworld.reveng.xml" />
<hbm2hbmxml />
<hbm2cfgxml />
</hibernatetool>
</target>

When I run this, I get this exception:
java.lang.NoSuchMethodError: org.hibernate.mapping.SimpleValue.<init>(Lorg/hibernate/mapping/Table;)V

Unfortunately I can not supply to you the call stack of this exception because it is not displayed.

I browsed the internet and found out that this error might have to do with some incompatible libraries - I just have no clue, which libraries are incompatible.

I'm using hibernate 3.6.6 and these libraries:

antlr-2.7.6.jar
c3p0-0.9.1.jar
commons-collections-3.1.jar
dom4j-1.6.1.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
hibernate3.jar
javassist-3.12.0.GA.jar
jta-1.1.jar
log4j-1.2.15.jar
mysql-connector-java-5.1.12-bin.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar

asm-3.3.1.jar
cglib-2.2.jar
commons-logging.jar
freemarker.jar
hibernate-tools.jar (the one downloaded by eclipse as plugin)
jdity-r938.jar

Can anybody help?

Many thanx
:-Denis


Top
 Profile  
 
 Post subject: Re: Error when running ant script: "java.lang.NoSuchMethodError"
PostPosted: Tue Aug 02, 2011 9:20 am 
Newbie

Joined: Wed Jul 27, 2011 10:17 am
Posts: 5
I found out that this problem does NOT occur when I use hibernate3 version 3.5.4. When I use version 3.6.4 or 3.6.6, it doesn't work.

Can anybody give me a hint about which versions of supplemental libs I should use to be able to reverse-engeneer existing tables with hibernate3 version 3.6.6?

I'm currently using these libs:

antlr-2.7.6.jar
asm-3.3.1.jar
c3p0-0.9.1.jar
cglib-2.2.jar
commons-collections-3.1.jar
commons-logging.jar
dom4j-1.6.1.jar
freemarker.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
hibernate-tools.jar
hibernate3.jar
javassist-3.12.0.GA.jar
jta-1.1.jar
jtidy-r938.jar
log4j-1.2.15.jar
mysql-connector-java-5.1.12-bin.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar

Many thanx
:-Denis


Top
 Profile  
 
 Post subject: Re: Error when running ant script: "java.lang.NoSuchMethodError"
PostPosted: Mon Feb 04, 2013 2:28 am 
Newbie

Joined: Sun Dec 30, 2012 12:44 pm
Posts: 4
hey..i am getting kind of the same error while going through the same book.
i am also on the second chapter and was trying to run that helloworld using annotations.
i am getting the below error:

[copy] Copying 2 files to Z:\java work\workspace\LearningJPA\bin
run:
[java] Exception in thread "main" java.lang.IncompatibleClassChangeError: Implementing class
[java] at java.lang.ClassLoader.defineClass1(Native Method)
[java] at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
[java] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
[java] at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
[java] at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
[java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
[java] at persistence.NewSession.<clinit>(Unknown Source)
[java] at LoadingandStoringclasses.Hello.enterData(Unknown Source)
[java] at Starter.main(Unknown Source)

i have changed the Configuration to AnnotationConfiguration while creating the instance of the SessionFactory. it seems this error is also because of incompatible libraries.

this is the list of libraries i am using:

asm-1.5.3.jar
asm-attrs.jar
cglib-2.1.3
commons-collections-3.2.1
commons-logging-1.0.4
hibernate3.jar
hibernate-tools.jar
log4j-1.2.8
ojdbc6.jar
hibernate-release-4.1.9.jar

i started getting this error after i am trying to switch to Annotations.

i am really stuck here. any help will be appreciated.


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.