-->
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.  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: alpha5 NoSuchMethodError
PostPosted: Mon Aug 22, 2005 2:10 pm 
Beginner
Beginner

Joined: Fri Apr 15, 2005 3:30 pm
Posts: 46
Location: Fortaleza, Brazil
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

3.0.5

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

java.lang.NoSuchMethodError: org.hibernate.tool.hbm2ddl.SchemaExport.setFormat(Z)Lorg/hibernate/tool/hbm2ddl/SchemaExport;
at org.hibernate.tool.ant.Hbm2DDLGeneratorTask.execute(Hbm2DDLGeneratorTask.java:46)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:122)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.Main.runBuild(Main.java:673)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

Name and version of the database you are using:

mysql 4.1

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

Hi all,

I'm trying out alpha5 to see if it fixes another issue. Note: I downloaded from cvs today, as the binary download from sourceforge seemingly did not have hibernate-tools.jar .

Code:

<!-- Formally introduce Ant to the hibernate3 toolset -->
    <taskdef name="hibernatetool"
      classname="org.hibernate.tool.ant.HibernateToolTask">
          <classpath>
            <fileset dir="${proj.lib}/hibernate3"/>
            <fileset dir="${proj.lib}/hibernate3-tools"/>
            <fileset dir="${proj.lib}/jakarta-commons"/>
            <fileset dir="${proj.lib}/dom4j"/>
            <fileset dir="${proj.lib}/j2ee"/>
            <fileset dir="${proj.lib}/cglib"/>
            <path location="${build.classes}"/>
          </classpath>
    </taskdef>

<target name="ddl"
            description="Generate tables from the O/R mapping files" >

      <property name="build.sysclasspath" value="ignore"/>
      <echo message="build classes: ${build.classes}" />
      <echo message=" " />
      <echo message=" " />
      <echo message="classpath: ${classpath}" />
      <echo message=" " />
      <echo message=" " />
      <mkdir dir="${build.schema}"/>
      <hibernatetool destdir="${build.schema}">
        <configuration configurationfile="hibernate-cfg.xml">
          <fileset dir="${build.classes}">
            <include name="**/*.hbm.xml" />
          </fileset>
        </configuration>
        <hbm2ddl export="false" drop="false" outputfilename="hib3-create-tables.sql" />
      </hibernatetool>
    </target>



My hibernate-cfg.xml :

Code:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory name="java:/hibernate/HibernateFactory">
  <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
</session-factory>
</hibernate-configuration>


Any ideas?
iksrazal


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 22, 2005 2:57 pm 
Beginner
Beginner

Joined: Fri Apr 15, 2005 3:30 pm
Posts: 46
Location: Fortaleza, Brazil
I found the alpha5 hibernate-tools.jar via 'jar xf org.hibernate.eclipse_3.1.0.alpha5.jar' , but I still get the same error. I'm using java 1.4.2 , if that helps explain anything.

Regards,
iksrazal


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 22, 2005 3:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use the hibernate which is distributed with the tools (its a 3.1 beta release, but works fine with 3.0.5 mappings)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 22, 2005 3:31 pm 
Newbie

Joined: Mon Aug 22, 2005 3:23 pm
Posts: 1
Same error here...

BUILD FAILED
java.lang.NoSuchMethodError: org.hibernate.tool.hbm2ddl.SchemaExport.setFormat(Z)Lorg/hibernate/tool/hbm2ddl/SchemaExport;


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 22, 2005 3:35 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
are you 100% sure you are using the hibernate3.jar included in the tools download ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 7:50 am 
Beginner
Beginner

Joined: Fri Apr 15, 2005 3:30 pm
Posts: 46
Location: Fortaleza, Brazil
OK, it does work once the hibernate jar included in the alpha5 package is in the classpath. One more dependancy though ;-( .

Incidently, one positive result of alpha5 is that I had a nasty classloader issue with commons.logging that, while the alpha4 hbm2ddl task worked by itself, it didn't like being called by other tasks - clover in this case. I believe this bug report was the issue:

http://opensource2.atlassian.com/projec ... se/HBX-354

I can confirm alpha5 fixed the issue in my case.

Cheers,
iksrazal


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 8:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes cant avoid the dependency yet - eventually we will probably move the ant tasks into the core.

and regarding the jira issue - great to hear !

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Still not working for me
PostPosted: Thu Aug 25, 2005 3:29 pm 
Newbie

Joined: Wed Jul 27, 2005 5:38 pm
Posts: 13
Location: Colorado, USA
Hi,

I'm getting
Code:
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;)V


when trying to run the ddl exporter.

I'm using the hibernate3.jar from the tools directory.

Here is my hibernate.tools.classpath

Code:
  <path id="hibernate.tools.classpath">
    <fileset dir="${hibernate.tools.dir}/lib/hibernate">
      <include name="asm.jar" />
      <include name="asm-attrs.jar" />
      <include name="cglib-2.1.2.jar" />
      <include name="dom4j.1.6.jar" />
      <include name="ehcache-1.1.jar" />
      <include name="jta.jar" />
      <include name="hibernate3.jar" />
    </fileset>
    <fileset dir="${hibernate.tools.dir}/lib/tools">
      <include name="hibernate-tools.jar" />
      <include name="jtidy-r8-21122004.jar" />
      <include name="velocity-1.4.jar" />
      <include name="velocity-tools-generic-1.1.jar" />
      <include name="l2fprod-common.jar" />
    </fileset>
  </path>


Any pointers would be great!

Thanks,

-bd-


Top
 Profile  
 
 Post subject: Java SE 1.5
PostPosted: Thu Aug 25, 2005 3:32 pm 
Newbie

Joined: Wed Jul 27, 2005 5:38 pm
Posts: 13
Location: Colorado, USA
Sorry forgot to mention that I'm on java 1.5/5.0.

Thanks again,

-bd-


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 26, 2005 4:09 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
bdudney - what are the contents of hibernate3.jar/META-INF/MANIFEST.MF ?

BTW, good article http://today.java.net/pub/a/today/2004/ ... ustom.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 26, 2005 4:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i've just confirmed that we have an issue in cvs about annotations and createMappings - so the short story is that the current annotations will only work with alpha4 tools :(

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Ah the bleeding edge :-)
PostPosted: Fri Aug 26, 2005 7:43 am 
Newbie

Joined: Wed Jul 27, 2005 5:38 pm
Posts: 13
Location: Colorado, USA
Hi Max,

No worries, thanks for track it down.

TTFN,

-bd

(PS, thanks for the kind words about my jsf article Dennis)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 26, 2005 8:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
p.s. emmanuel just fixed this in cvs so now we should be on track again ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 26, 2005 5:09 pm 
Newbie

Joined: Wed Jul 27, 2005 5:38 pm
Posts: 13
Location: Colorado, USA
Hi Max,

I've got

1) hibernate-3.1-dev (latest in CVS about 1 hr ago)
2) hibernate-tools-3.1.0-dev (latest in CVS about the same time)

I run ant build schema and get the same error message

Code:
BUILD FAILED
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;)V


ideas?

Thanks!

-bd-


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 26, 2005 5:34 pm 
Newbie

Joined: Wed Jul 27, 2005 5:38 pm
Posts: 13
Location: Colorado, USA
Not sure this will do you any good but here is the ant -debug build.schema run.

hibernate-3.1-dev is the build I made from CVS

TTFN,

-bd-

Code:
Finding class javax.persistence.Table
Loaded from /Users/bdudney/DevTools/hibernate-annotations-3.1beta4/lib/ejb3-persistence.jar javax/persistence/Table.class
Class javax.persistence.Table loaded from ant loader (parentFirst)
Class javax.persistence.Table loaded from parent loader (parentFirst)
Finding class javax.persistence.UniqueConstraint
Loaded from /Users/bdudney/DevTools/hibernate-annotations-3.1beta4/lib/ejb3-persistence.jar javax/persistence/UniqueConstraint.class
Class javax.persistence.UniqueConstraint loaded from ant loader (parentFirst)
Finding class org.hibernate.mapping.Table
Loaded from /Users/bdudney/DevTools/hibernate-3.1-dev/hibernate3.jar org/hibernate/mapping/Table.class
Finding class org.hibernate.mapping.RelationalModel
Loaded from /Users/bdudney/DevTools/hibernate-3.1-dev/hibernate3.jar org/hibernate/mapping/RelationalModel.class
Class org.hibernate.mapping.RelationalModel loaded from ant loader (parentFirst)
Class org.hibernate.mapping.Table loaded from ant loader (parentFirst)
Finding class org.hibernate.mapping.DenormalizedTable
Loaded from /Users/bdudney/DevTools/hibernate-3.1-dev/hibernate3.jar org/hibernate/mapping/DenormalizedTable.class
Class org.hibernate.mapping.DenormalizedTable loaded from ant loader (parentFirst)

BUILD FAILED
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;)V
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: 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;)V
        at org.hibernate.cfg.ExtendedMappings.<init>(ExtendedMappings.java:48)
        at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:131)
        at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:194)
        at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:969)
        at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:51)
        at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:158)
        at org.hibernate.tool.ant.Hbm2DDLGeneratorTask.execute(Hbm2DDLGeneratorTask.java:39)
        at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:122)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        ... 7 more
--- Nested Exception ---
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;)V
        at org.hibernate.cfg.ExtendedMappings.<init>(ExtendedMappings.java:48)
        at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:131)
        at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:194)
        at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:969)
        at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:51)
        at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:158)
        at org.hibernate.tool.ant.Hbm2DDLGeneratorTask.execute(Hbm2DDLGeneratorTask.java:39)
        at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:122)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)



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