l.hbm2x.ExporterException: MethodInvocationException while processing template P ojo. Invocation of method 'get' in class org.hibernate.tool.hbm2x.TemplateHelpe r$Templates threw exception class org.hibernate.tool.hbm2x.ExporterException : M ethodInvocationException while processing template pojo/PojoEqualsHashcode.vm. I nvocation of method 'needsEqualsHashCode' in class org.hibernate.tool.hbm2x.poj o.EntityPOJOClass threw exception class java.lang.NoSuchMethodError : org.hibern ate.mapping.Property.isNaturalIdentifier()Z

Hibernate JIRA | Sanjucta Ghose | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I have the following ant task: <target name="generatejava" > <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" > <classpath> <pathelement path="${classpath}" /> <fileset dir="${lib}" includes="**/*.jar" /> <fileset dir="${installpath}" includes="**/*.jar" /> <fileset dir="${server-lib}" includes="**/*.jar" /> <fileset dir="${jboss-lib}" includes="**/*.jar" /> <fileset dir="${client-lib}" includes="**/*.jar" /> </classpath> </taskdef> <hibernatetool destdir="${build.classes/javafrmhbm}"> <configuration > <fileset dir="${src}" > <include name="**/*.hbm.xml"/> </fileset> </configuration> <hbm2java/> <!-- generate default .java files --> </hibernatetool> </target> On running it I get this error: BUILD FAILED D:\XPFlow_3_Dev\CVS_xpflow\projects\xpflow\core\build.xml:200: org.hibernate.too l.hbm2x.ExporterException: MethodInvocationException while processing template P ojo. Invocation of method 'get' in class org.hibernate.tool.hbm2x.TemplateHelpe r$Templates threw exception class org.hibernate.tool.hbm2x.ExporterException : M ethodInvocationException while processing template pojo/PojoEqualsHashcode.vm. I nvocation of method 'needsEqualsHashCode' in class org.hibernate.tool.hbm2x.poj o.EntityPOJOClass threw exception class java.lang.NoSuchMethodError : org.hibern ate.mapping.Property.isNaturalIdentifier()Z at org.apache.tools.ant.Task.perform(Task.java:373) 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) Caused by: org.hibernate.tool.hbm2x.ExporterException: MethodInvocationException while processing template Pojo. Invocation of method 'get' in class org.hibern ate.tool.hbm2x.TemplateHelper$Templates threw exception class org.hibernate.tool .hbm2x.ExporterException : MethodInvocationException while processing template p ojo/PojoEqualsHashcode.vm. Invocation of method 'needsEqualsHashCode' in class org.hibernate.tool.hbm2x.pojo.EntityPOJOClass threw exception class java.lang.No SuchMethodError : org.hibernate.mapping.Property.isNaturalIdentifier()Z at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe r.java:140) at org.hibernate.tool.hbm2x.VelocityProducer.firstPass(VelocityProducer. java:72) at org.hibernate.tool.hbm2x.VelocityProducer.produce(VelocityProducer.ja va:27) at org.hibernate.tool.hbm2x.VelocityProducer.produce(VelocityProducer.ja va:104) at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.j ava:112) at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(Generi cExporter.java:100) at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporte r.java:83) at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java :68) at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java :90) at org.hibernate.tool.hbm2x.GenericExporter.start(GenericExporter.java:5 8) at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja va:144) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) ... 8 more Caused by: org.hibernate.tool.hbm2x.ExporterException: MethodInvocationException while processing template pojo/PojoEqualsHashcode.vm. Invocation of method 'nee dsEqualsHashCode' in class org.hibernate.tool.hbm2x.pojo.EntityPOJOClass threw exception class java.lang.NoSuchMethodError : org.hibernate.mapping.Property.isN aturalIdentifier()Z at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe r.java:140) at org.hibernate.tool.hbm2x.TemplateHelper$Templates.get(TemplateHelper. java:98) at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)

    Hibernate JIRA | 1 decade ago | Sanjucta Ghose
    l.hbm2x.ExporterException: MethodInvocationException while processing template P ojo. Invocation of method 'get' in class org.hibernate.tool.hbm2x.TemplateHelpe r$Templates threw exception class org.hibernate.tool.hbm2x.ExporterException : M ethodInvocationException while processing template pojo/PojoEqualsHashcode.vm. I nvocation of method 'needsEqualsHashCode' in class org.hibernate.tool.hbm2x.poj o.EntityPOJOClass threw exception class java.lang.NoSuchMethodError : org.hibern ate.mapping.Property.isNaturalIdentifier()Z
  2. 0

    I have the following ant task: <target name="generatejava" > <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" > <classpath> <pathelement path="${classpath}" /> <fileset dir="${lib}" includes="**/*.jar" /> <fileset dir="${installpath}" includes="**/*.jar" /> <fileset dir="${server-lib}" includes="**/*.jar" /> <fileset dir="${jboss-lib}" includes="**/*.jar" /> <fileset dir="${client-lib}" includes="**/*.jar" /> </classpath> </taskdef> <hibernatetool destdir="${build.classes/javafrmhbm}"> <configuration > <fileset dir="${src}" > <include name="**/*.hbm.xml"/> </fileset> </configuration> <hbm2java/> <!-- generate default .java files --> </hibernatetool> </target> On running it I get this error: BUILD FAILED D:\XPFlow_3_Dev\CVS_xpflow\projects\xpflow\core\build.xml:200: org.hibernate.too l.hbm2x.ExporterException: MethodInvocationException while processing template P ojo. Invocation of method 'get' in class org.hibernate.tool.hbm2x.TemplateHelpe r$Templates threw exception class org.hibernate.tool.hbm2x.ExporterException : M ethodInvocationException while processing template pojo/PojoEqualsHashcode.vm. I nvocation of method 'needsEqualsHashCode' in class org.hibernate.tool.hbm2x.poj o.EntityPOJOClass threw exception class java.lang.NoSuchMethodError : org.hibern ate.mapping.Property.isNaturalIdentifier()Z at org.apache.tools.ant.Task.perform(Task.java:373) 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) Caused by: org.hibernate.tool.hbm2x.ExporterException: MethodInvocationException while processing template Pojo. Invocation of method 'get' in class org.hibern ate.tool.hbm2x.TemplateHelper$Templates threw exception class org.hibernate.tool .hbm2x.ExporterException : MethodInvocationException while processing template p ojo/PojoEqualsHashcode.vm. Invocation of method 'needsEqualsHashCode' in class org.hibernate.tool.hbm2x.pojo.EntityPOJOClass threw exception class java.lang.No SuchMethodError : org.hibernate.mapping.Property.isNaturalIdentifier()Z at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe r.java:140) at org.hibernate.tool.hbm2x.VelocityProducer.firstPass(VelocityProducer. java:72) at org.hibernate.tool.hbm2x.VelocityProducer.produce(VelocityProducer.ja va:27) at org.hibernate.tool.hbm2x.VelocityProducer.produce(VelocityProducer.ja va:104) at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.j ava:112) at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(Generi cExporter.java:100) at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporte r.java:83) at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java :68) at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java :90) at org.hibernate.tool.hbm2x.GenericExporter.start(GenericExporter.java:5 8) at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja va:144) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) ... 8 more Caused by: org.hibernate.tool.hbm2x.ExporterException: MethodInvocationException while processing template pojo/PojoEqualsHashcode.vm. Invocation of method 'nee dsEqualsHashCode' in class org.hibernate.tool.hbm2x.pojo.EntityPOJOClass threw exception class java.lang.NoSuchMethodError : org.hibernate.mapping.Property.isN aturalIdentifier()Z at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe r.java:140) at org.hibernate.tool.hbm2x.TemplateHelper$Templates.get(TemplateHelper. java:98) at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)

    Hibernate JIRA | 1 decade ago | Sanjucta Ghose
    l.hbm2x.ExporterException: MethodInvocationException while processing template P ojo. Invocation of method 'get' in class org.hibernate.tool.hbm2x.TemplateHelpe r$Templates threw exception class org.hibernate.tool.hbm2x.ExporterException : M ethodInvocationException while processing template pojo/PojoEqualsHashcode.vm. I nvocation of method 'needsEqualsHashCode' in class org.hibernate.tool.hbm2x.poj o.EntityPOJOClass threw exception class java.lang.NoSuchMethodError : org.hibern ate.mapping.Property.isNaturalIdentifier()Z

    Root Cause Analysis

    1. org.hibernate.tool.hbm2x.ExporterException

      MethodInvocationException while processing template pojo/PojoEqualsHashcode.vm. Invocation of method 'nee dsEqualsHashCode' in class org.hibernate.tool.hbm2x.pojo.EntityPOJOClass threw exception class java.lang.NoSuchMethodError : org.hibernate.mapping.Property.isN aturalIdentifier()Z

      at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate()
    2. Hibernate Tools
      TemplateHelper$Templates.get
      1. org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:140)
      2. org.hibernate.tool.hbm2x.TemplateHelper$Templates.get(TemplateHelper.java:98)
      2 frames
    3. Java RT
      GeneratedMethodAccessor8.invoke
      1. sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
      1 frame