-->
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.  [ 7 posts ] 
Author Message
 Post subject: Velocity template exceptions
PostPosted: Thu Jan 26, 2006 5:19 am 
Newbie

Joined: Tue Jan 10, 2006 6:42 am
Posts: 4
Hibernate Tool version: 3.1.0.beta2

Name and version of the database you are using:Oracle 10g R2

Hi Guys,
During the execution of my ant task I have a warn on Velocity:

This type of warn generate java class with bad types:
private long $field.name;

Any idea ?



Full stack trace of any exception that occurs:

[exec] [hibernatetool] 206337 [main] WARN org.hibernate.tool.hbm2x.template - org.apache.velocity.runtime.exception.ReferenceException: reference : template = pojo/PojoConstructors.vm [line 25,column 14] : $field.Name is not a valid reference.
[exec] [hibernatetool] 206337 [main] WARN org.hibernate.tool.hbm2x.template - org.apache.velocity.runtime.exception.ReferenceException: reference : template = pojo/PojoConstructors.vm [line 25,column 28] : $field.Name is not a valid reference.
[exec] [hibernatetool] 206347 [main] INFO org.hibernate.tool.hbm2x.template - ResourceManager : found pojo/PojoPropertyAccessors.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
[exec] [hibernatetool] 206367 [main] INFO org.hibernate.tool.hbm2x.template - ResourceManager : found pojo/Ejb3PropertyGetAnnotation.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
[exec] [hibernatetool] 206367 [main] WARN org.hibernate.tool.hbm2x.template - org.apache.velocity.runtime.exception.ReferenceException: reference : template = pojo/PojoPropertyAccessors.vm [line 11,column 21] : $property.name is not a valid reference.
[exec] [hibernatetool] 206367 [main] WARN org.hibernate.tool.hbm2x.template - org.apache.velocity.runtime.exception.ReferenceException: reference : template = pojo/PojoPropertyAccessors.vm [line 14,column 54] : $pojo.getPropertyName($property) is not a valid reference.
[exec] [hibernatetool] 206367 [main] WARN org.hibernate.tool.hbm2x.template - org.apache.velocity.runtime.exception.ReferenceException: reference : template = pojo/PojoPropertyAccessors.vm [line 14,column 127] : $property.Name is not a valid reference.
[exec] [hibernatetool] 206367 [main] WARN org.hibernate.tool.hbm2x.template - org.apache.velocity.runtime.exception.ReferenceException: reference : template = pojo/PojoPropertyAccessors.vm [line 15,column 14] : $property.Name is not a valid reference.
[exec] [hibernatetool] 206367 [main] WARN org.hibernate.tool.hbm2x.template - org.apache.velocity.runtime.exception.ReferenceException: reference : template = pojo/PojoPropertyAccessors.vm [line 15,column 31] : $property.Name is not a valid reference.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
how do you invoke it ? How does the <hibernatetool> look like in your build.xml ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:43 am 
Newbie

Joined: Tue Jan 10, 2006 6:42 am
Posts: 4
<hibernatetool destdir="${sis.tmp.dir}" classpath="base.path">

<jdbcconfiguration
configurationfile="${sis.hbm.config}"
revengfile="hibernate.reveng.xml"
packagename="test"
reversestrategy="hbn.strategy.ReplayStrategy"
/>
<hbm2java ejb3="false" templatepath="./src" />


<hbm2hbmxml destdir="${sis.mapping.dir}" />
</hibernatetool>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 6:22 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
so some how you have a $property/$pojo reference that is either null or not a property/class.

Do you have your own template that can be doing something "bad" ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 10:43 am 
Newbie

Joined: Tue Jan 10, 2006 6:42 am
Posts: 4
NO I didn't have a own template.

I have deleted "templatespath" attribute, and now my hibernatetool looks like this:
<hibernatetool destdir="${sis.tmp.dir}" classpath="base.path">

<jdbcconfiguration
configurationfile="${sis.hbm.config}"
revengfile="hibernate.reveng.xml"
packagename="test"
reversestrategy="hbn.strategy.ReplayStrategy"
/>
<!-- strategy="hbn.strategy.ReplayStrategy" -->
<hbm2java ejb3="false"/>


<hbm2hbmxml destdir="${sis.mapping.dir}" />
</hibernatetool>

And the velocity exceptions are the same.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 1:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i would be very interested into getting a test case for this in jira.

meaning getting the SQL DDL for what it is you are reverse engineering and what is in your cfg.xml file.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 29, 2006 4:16 pm 
Newbie

Joined: Tue Jan 10, 2006 6:42 am
Posts: 4
Thks Max,
But it wouldnt be possible because the database isn't mine.

Then I will stay with 3.0.5 which is working for my first step which is to have a generation of hbm files, then I will update them manually.

Thanks


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