-->
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: hbntemplate, daohome.vm = problem, Bug?
PostPosted: Fri Feb 17, 2006 7:16 am 
Newbie

Joined: Fri Feb 17, 2006 6:02 am
Posts: 6
Hello all!

Version:
Windows 2000 SP4, Hibernate3, HibernateTools 3.1 Beta4, Oracle 9i, Java 1.4.2

Issue
Cannot generate code from custom daohome.vm
I have also tried without modifying.

Exception

D:\cvs\blah\www\bin\build.xml:188: org.hibernate.tool.hbm2x.ExporterException: MethodInvocationException while pr
ocessing template templates/dao/daohome.vm. Invocation of method 'getJavaTypeName' in class org.hibernate.tool.hbm2x.Cf
g2JavaTool threw exception class java.lang.NullPointerException : null
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: MethodInvocationException while processing template templates/dao
/daohome.vm. Invocation of method 'getJavaTypeName' in class org.hibernate.tool.hbm2x.Cfg2JavaTool threw exception clas
s java.lang.NullPointerException : null
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:150)
at org.hibernate.tool.hbm2x.VelocityProducer.firstPass(VelocityProducer.java:74)
at org.hibernate.tool.hbm2x.VelocityProducer.produce(VelocityProducer.java:28)
at org.hibernate.tool.hbm2x.VelocityProducer.produce(VelocityProducer.java:112)
at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:112)
at org.hibernate.tool.hbm2x.GenericExporter.exportComponent(GenericExporter.java:96)
at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporter.java:90)
at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:68)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:92)
at org.hibernate.tool.hbm2x.GenericExporter.start(GenericExporter.java:58)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:143)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
... 10 more
Caused by: java.lang.NullPointerException
at org.hibernate.tool.hbm2x.Cfg2JavaTool.getMetaAsString(Cfg2JavaTool.java:76)
at org.hibernate.tool.hbm2x.Cfg2JavaTool.getJavaTypeName(Cfg2JavaTool.java:166)
at org.hibernate.tool.hbm2x.Cfg2JavaTool.getJavaTypeName(Cfg2JavaTool.java:162)
at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:267)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:197)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:220)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:89)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
at org.apache.velocity.Template.merge(Template.java:256)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:450)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:419)
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:138)
... 23 more


build.xml
<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpath=" ${lib.dir}/Hibernate/hibernate-tools.jar;
${lib.dir}/Hibernate/hibernate3.jar;
${lib.dir}/Hibernate/velocity-1.4.jar;
${lib.dir}/Hibernate/commons-logging-1.0.4.jar;
${lib.dir}/Hibernate/jtidy-r8-21122004.jar;
${lib.dir}/Hibernate/dom4j-1.6.1.jar;
${lib.dir}/ojdbc14-9205.jar;
${lib.dir}/Hibernate/ehcache-1.1.jar;
${lib.dir}/Hibernate/cglib-2.1.3.jar;
${lib.dir}/Hibernate/asm.jar;
${lib.dir}/Hibernate/commons-collections-2.1.1.jar;
${lib.dir}/Hibernate/velocity-tools-generic-1.1.jar"/>
<hibernatetool destdir="${build.classes.dir}">
<jdbcconfiguration configurationfile="../configuration/Hibernate/hibernate.cfg.xml"
revengfile="hibernate.reveng.xml"/>
<property key="jdk5" value="false"/>
<property key="ejb3" value="false"/>
<hbm2hbmxml destdir="../configuration/Hibernate"/>

<!--hbm2dao destdir="${src.dir}/com/blah/persistence/dataaccess/gen"/--><!-- this works -->

<hbmtemplate destdir="${src.dir}/com/blah/persistence/dataaccess/gen" templateprefix="dao/" template="templates/dao/daohome.vm" filepattern="{package-name}/{class-name}Home.java"/><!-- This does not work -->
<hbmtemplate destdir="${src.dir}/com/blah/persistence/dto" templateprefix="pojo/" template="templates/pojo/Pojo.vm" filepattern="{package-name}/{class-name}.java"/>
<hbmtemplate destdir="${src.dir}/com/blah/persistence/datainterface" templateprefix="pojo/" template="templates/pojo/PojoInterface.vm" filepattern="{package-name}/{class-name}I.java"/>

</hibernatetool>

Look at

http://forum.hibernate.org/viewtopic.ph ... ht=daohome (same issue?)
http://opensource2.atlassian.com/projec ... se/HBX-601 (ok, i was too quick with this, sorry)

Do we have a bug or i'm i missing something?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 17, 2006 10:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm...can you try and enable logging (put a log4j.properties in the classpath) and post it here ? (or even better, try and reduce the usage and revevng'ed database to the simplest thing possible)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 17, 2006 10:57 am 
Newbie

Joined: Fri Feb 17, 2006 6:02 am
Posts: 6
I tried with one table. It worked. At this point i knew that we have one table that has problem. I saw comment with db-tool in two fields: Primary 1, Primary 2. I have to ask from db designer what's so special about this table. I'll get back on Monday..


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.