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
  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
  3. 0

    Running Hbm2Doc on a bunch of JPA annotated Entities, I get and IllegalArgumentException: To cannot be null in DocFileManager.getRef (see stack trace below). Some HTML files (\hbm2doc\tables\default\MY_TABLE.html) gets created before Hbm2Doc ends with this exception. There might be something in one entity code making the table.ftl FreeMarker template fail. Improving error log could help (which table has a problem?). Stack trace hbm2doc: [hibernatetool] Executing Hibernate Tool with a Hibernate Annotation/EJB3 Configuration [hibernatetool] 1. task: hbm2doc (Generates html schema documentation) [hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version). [hibernatetool] log4j:WARN Please initialize the log4j system properly. [hibernatetool] An exception occurred while running exporter #2:hbm2doc (Generates html schema documentation) [hibernatetool] To get the full stack trace run ant with -verbose [hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processing Unknown context with template doc/tables/table.ftl [hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.doc.DocFileManager.getRef(org.hibernate.tool.hbm2x.doc.DocFile,org.hibernate.tool.hbm2x.doc.DocFile) threw an exception when invoked on org.hibernate.tool.hbm2x.doc.DocFileManager@4310d0 [hibernatetool] java.lang.IllegalArgumentException: To cannot be null. BUILD FAILED org.hibernate.tool.hbm2x.ExporterException: Error while processing Unknown context with template doc/tables/table.ftl at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:261) at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67) at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28) at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97) at org.hibernate.tool.hbm2x.DocExporter.processTemplate(DocExporter.java:614) at org.hibernate.tool.hbm2x.DocExporter.generateTablesDetails(DocExporter.java:415) at org.hibernate.tool.hbm2x.DocExporter.doStart(DocExporter.java:154) at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95) at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) (...) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Caused by: freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.doc.DocFileManager.getRef(org.hibernate.tool.hbm2x.doc.DocFile,org.hibernate.tool.hbm2x.doc.DocFile) threw an exception when invoked on org.hibernate.tool.hbm2x.doc.DocFileManager@4310d0 at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136) (...) at freemarker.template.Template.process(Template.java:232) at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:255) ... 26 more Caused by: java.lang.IllegalArgumentException: To cannot be null. at org.hibernate.tool.hbm2x.doc.DocFileManager.getRef(DocFileManager.java:466) (...) at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:616) at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:113) ... 46 more Ant: <target name="hbm2doc"> <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="hibernate.class.path" /> <hibernatetool destdir="target/hibernate3/hbm2doc"> <classpath>(...)</classpath> <annotationconfiguration configurationfile="hibernateConfig.xml"/> <hbm2doc/> </hibernatetool> </target>

    Hibernate JIRA | 8 years ago | GĂ©rald Quintana
    org.hibernate.tool.hbm2x.ExporterException: Error while processing Unknown context with template doc/tables/table.ftl
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    one-to-many relation with not-null attribute on key element is throwing below error when I run the hbm2java tool. I have a base class with a joined-subclass and the joined subclass has one-to-many relationship with another class. The one-to-many uses a list. When I specify not-null attribute on the key element in the relationship I get the below error. If I remove it I don't get this error. If I let the key stay not-null, during run time persistence fails. So I had to revert the mapping file at runtime for the persistence to go fine. It is only the tool that is misbehaving. ---------> Mapping Base class mapping: <hibernate-mapping package="***.core"> <class name="Resource" table="Resource" polymorphism="explicit"> .............. </class> Derived Class with one-to-many: <hibernate-mapping package="***.chartbook"> <joined-subclass name="ChartDefinition" table="ChartDefinition" extends="***.core.Resource"> <key column="chartDefinitionId"/> ..... <list name="ChartSeries" cascade="all-delete-orphan" inverse="false"> <key column="chartDefinitionId" not-null="true"/> <list-index column="position" /> <one-to-many class="ChartSeries"/> </list> </joined-subclass> </hibernate-mapping> --- target of one-to-many <hibernate-mapping package="**.chartbook"> <class name="ChartSeries" table="ChartSeries"> <id name="Id" type="integer" column="chartSeriesId"> <generator class="identity"/> </id> </class> </hibernate-mapping> ----------------> Error org.hibernate.tool.hbm2x.ExporterException: Error while processing t emplate pojo/javaclass.vm 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.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) Caused by: org.hibernate.tool.hbm2x.ExporterException: Error while processing template pojo/javaclass.vm at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:89) at org.hibernate.tool.hbm2x.POJOExporter.runVelocity(POJOExporter.java:78) at org.hibernate.tool.hbm2x.POJOExporter.exportPersistentClass(POJOExporter.java:61) at org.hibernate.tool.hbm2x.POJOExporter.start(POJOExporter.java:111) at org.hibernate.tool.ant.GeneratorTask.execute(GeneratorTask.java:33) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:115) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) Posted: Thu Oct 20, 2005 9:34 pm Post subject: please put this in jira thanks. _________________ Max Don't forget to rate

    Hibernate JIRA | 1 decade ago | Sreeram Katta
    org.hibernate.tool.hbm2x.ExporterException: Error while processing t emplate pojo/javaclass.vm
  6. 0

    one-to-many relation with not-null attribute on key element is throwing below error when I run the hbm2java tool. I have a base class with a joined-subclass and the joined subclass has one-to-many relationship with another class. The one-to-many uses a list. When I specify not-null attribute on the key element in the relationship I get the below error. If I remove it I don't get this error. If I let the key stay not-null, during run time persistence fails. So I had to revert the mapping file at runtime for the persistence to go fine. It is only the tool that is misbehaving. ---------> Mapping Base class mapping: <hibernate-mapping package="***.core"> <class name="Resource" table="Resource" polymorphism="explicit"> .............. </class> Derived Class with one-to-many: <hibernate-mapping package="***.chartbook"> <joined-subclass name="ChartDefinition" table="ChartDefinition" extends="***.core.Resource"> <key column="chartDefinitionId"/> ..... <list name="ChartSeries" cascade="all-delete-orphan" inverse="false"> <key column="chartDefinitionId" not-null="true"/> <list-index column="position" /> <one-to-many class="ChartSeries"/> </list> </joined-subclass> </hibernate-mapping> --- target of one-to-many <hibernate-mapping package="**.chartbook"> <class name="ChartSeries" table="ChartSeries"> <id name="Id" type="integer" column="chartSeriesId"> <generator class="identity"/> </id> </class> </hibernate-mapping> ----------------> Error org.hibernate.tool.hbm2x.ExporterException: Error while processing t emplate pojo/javaclass.vm 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.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) Caused by: org.hibernate.tool.hbm2x.ExporterException: Error while processing template pojo/javaclass.vm at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:89) at org.hibernate.tool.hbm2x.POJOExporter.runVelocity(POJOExporter.java:78) at org.hibernate.tool.hbm2x.POJOExporter.exportPersistentClass(POJOExporter.java:61) at org.hibernate.tool.hbm2x.POJOExporter.start(POJOExporter.java:111) at org.hibernate.tool.ant.GeneratorTask.execute(GeneratorTask.java:33) at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:115) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) Posted: Thu Oct 20, 2005 9:34 pm Post subject: please put this in jira thanks. _________________ Max Don't forget to rate

    Hibernate JIRA | 1 decade ago | Sreeram Katta
    org.hibernate.tool.hbm2x.ExporterException: Error while processing t emplate pojo/javaclass.vm

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    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