-->
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.  [ 4 posts ] 
Author Message
 Post subject: help with hbm2java ant task - velocity error
PostPosted: Wed Jun 01, 2005 11:38 am 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
Hibernate version:3.0.5 (from CVS)

I'm using H3 and hibernate tools from CVS. When running the hbm2java ant task, I get the following error and warnings:

Quote:
[hibernatetool] ERRORlogVelocityMessage, ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
[hibernatetool] WARN logVelocityMessage, org.apache.velocity.runtime.exception.ReferenceException: reference : template = pojo/javaclass.vm [line 10,column 1] : $secondpassclassimports is not a valid reference.
[hibernatetool] WARN logVelocityMessage, org.apache.velocity.runtime.exception.ReferenceException: reference : template = pojo/javaclass.vm [line 13,column 1] : $c2j.getJavaDoc($clazz, $render.eval($ctx, "$c2j.getDeclarationName($clazz) generated by hbm2java"),0) is not a valid reference.
[hibernatetool] WARN logVelocityMessage, Warning! The iterative is an Iterator in the #foreach() loop at [0,0] in template pojo/javaclass.vm. Because it's not resetable, if used in more than once, this may lead to unexpected results.

... (lots more warnings)


It's generating java classes, although there is still some velocity-looking stuff in the class javadoc comments (I don't know much about velocity).

I don't see VM_global_library.vm anywhere in the hibernate tools CVS files, and I'm not sure how to get rid of this error. I believe I have all the right jars, etc. in place. I've been following the instructions on building the tools from:

http://www.hibernate.org/268.html

and the instructions on using the ant tasks from:

http://cvs.sourceforge.net/viewcvs.py/*checkout*/hibernate/HibernateExt/tools/doc/index.html

Thanks in advance for any help with this.

Here is my ant task:

Code:

   <target name="runhibernatetools">
      <hibernatetool destdir="generated">
      <classpath>
         <path location="${resources.dir}/hibernate" />
      </classpath>

         <configuration configurationfile="${resources.dir}/hibernate/product.cfg.xml">
         </configuration>

         <hbm2java />
         <!-- generate default .java files -->
         <hbm2ddl export="false" outputfilename="product-schema.ddl" />
         <!-- export schema to database. If outputfilename is provided a text file is generated instead. -->
      </hibernatetool>
   </target>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 01, 2005 3:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the getdeclarationname is a known bug.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 01, 2005 4:07 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
Thanks Max. Any ideas on the VM_global_library.vm error (first line)? I was just worried that the error was what was causing the subsequent warnings. But if one of those warnings is a known bug, maybe the error isn't causing them.

Should I have VM_global_library.vm somewhere in my project (classpath)? I don't even know where to get it from.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 01, 2005 4:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
velocity weirdness...they like to log everything irrellevant at warn level ;)

disable the log level for velocity stuff.

_________________
Max
Don't forget to rate


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