-->
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.  [ 12 posts ] 
Author Message
 Post subject: org.hibernate.tool.hbm2x.ExporterException
PostPosted: Wed Jul 12, 2006 11:28 am 
Newbie

Joined: Wed Jul 12, 2006 11:20 am
Posts: 8
I get the following exception thrown when I try to call the hbm2java in my build.xml

Here is the exception:
hibernatetool] 12.07.2006 17:00:44 at org.hibernate.cfg.Environment.<clinit>(Environment.java:464)
[hibernatetool] INFO: Hibernate 3.0.5
[hibernatetool] 12.07.2006 17:00:44 at org.hibernate.cfg.Environment.<clinit>(Environment.java:477)
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] 12.07.2006 17:00:44 at org.hibernate.cfg.Environment.<clinit>(Environment.java:510)
[hibernatetool] INFO: using CGLIB reflection optimizer
[hibernatetool] 12.07.2006 17:00:44 at org.hibernate.cfg.Environment.<clinit>(Environment.java:540)
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 12.07.2006 17:00:45 org.hibernate.cfg.Configuration configure
[hibernatetool] INFO: configuring from file: hibernate.cfg.xml
[hibernatetool] 12.07.2006 17:00:45 org.hibernate.cfg.Configuration addResource
[hibernatetool] INFO: Mapping resource: output.hbm.xml
[hibernatetool] 12.07.2006 17:00:45 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
[hibernatetool] INFO: Mapping class: com.bosch.wac.test.WACEntity -> IPProjectRequest
[hibernatetool] 12.07.2006 17:00:45 org.hibernate.cfg.Configuration doConfigure
[hibernatetool] INFO: Configured SessionFactory: null
[hibernatetool] 12.07.2006 17:00:45 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing extends queue
[hibernatetool] 12.07.2006 17:00:45 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing collection mappings
[hibernatetool] 12.07.2006 17:00:45 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing association property references
[hibernatetool] 12.07.2006 17:00:45 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing foreign key constraints
BUILD FAILED: C:\workspace\WACWeb\Test\com\bosch\wac\test\build.xml:69:org.hibernate.tool.hbm2x.ExporterException: Velocity engine could not be initialized
Total time: 2 seconds

hibernate.cfg.xml file
----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:mysql://yangtze/test</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.username"></property>
<property name="connection.password"></property>
<property name="connection.pool_size">12</property>
<property name="show_sql">false</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<mapping resource="output.hbm.xml"/>
</session-factory>
</hibernate-configuration>

output.hbm.xml file
--------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.bosch.wac.test">
<class name="WACEntity" table="IPProjectRequest">
<id name="id" column="ID" type="integer">
<generator class="sequence"/>
</id>
<property name="f_projectdesignation" column="f_projectdesignation" type="string" length="100"/>
<property name="f_projectAbbreviation" column="f_projectAbbreviation" type="string" length="100"/>
<property name="f_system" column="f_system" type="string" length="100"/>
<property name="f_number" column="f_number" type="string" length="100"/>
<property name="f_savingsonce" column="f_savingsonce" type="string" length="100"/>
<property name="f_targetCostsOnce" column="f_targetCostsOnce" type="string" length="100"/>
<property name="f_savingsperyear" column="f_savingsperyear" type="string" length="100"/>
<property name="f_targetCostsperyear" column="f_targetCostsperyear" type="string" length="100"/>
<property name="comment" column="comment" type="string" length="500"/>
<property name="f_txtField11" column="f_txtField11" type="string" length="100"/>
<property name="f_txtField12" column="f_txtField12" type="string" length="100"/>
<property name="f_RB11" column="f_RB11" type="string"/>
<property name="f_RB12" column="f_RB12" type="string"/>
<property name="f_RB13" column="f_RB13" type="string"/>
<property name="f_txtField21" column="f_txtField21" type="string" length="100"/>
<property name="f_txtField22" column="f_txtField22" type="string" length="100"/>
<property name="f_RB21" column="f_RB21" type="string"/>
<property name="f_RB22" column="f_RB22" type="string"/>
<property name="f_RB23" column="f_RB23" type="string"/>
</class>
</hibernate-mapping>

Can someone help me?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 12, 2006 1:46 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
start by using a non-ancient release ;)

then if that doesn't work then post the question in the *tools* forum.

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Getting another exception now
PostPosted: Thu Jul 13, 2006 5:56 am 
Newbie

Joined: Wed Jul 12, 2006 11:20 am
Posts: 8
Buildfile: C:\workspace\WACWeb\Test\com\bosch\wac\test\build.xml
execute:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] 13.07.2006 11:40:16 at org.hibernate.cfg.Environment.<clinit>(Environment.java:464)
[hibernatetool] INFO: Hibernate 3.0.5
[hibernatetool] 13.07.2006 11:40:16 at org.hibernate.cfg.Environment.<clinit>(Environment.java:477)
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] 13.07.2006 11:40:16 at org.hibernate.cfg.Environment.<clinit>(Environment.java:510)
[hibernatetool] INFO: using CGLIB reflection optimizer
[hibernatetool] 13.07.2006 11:40:16 at org.hibernate.cfg.Environment.<clinit>(Environment.java:540)
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 13.07.2006 11:40:16 org.hibernate.cfg.Configuration configure
[hibernatetool] INFO: configuring from file: hibernate.cfg.xml
[hibernatetool] 13.07.2006 11:40:16 org.hibernate.cfg.Configuration addResource
[hibernatetool] INFO: Mapping resource: output.hbm.xml
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
[hibernatetool] INFO: Mapping class: com.bosch.wac.test.WACEntity -> IPProjectRequest
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.Configuration doConfigure
[hibernatetool] INFO: Configured SessionFactory: null
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing extends queue
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing collection mappings
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing association property references
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing foreign key constraints
[hibernatetool] 13.07.2006 11:40:19 freemarker.log.JDK14LoggerFactory$JDK14Logger error
[hibernatetool] SEVERE:
[hibernatetool] Method needsEqualsHashCode on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass
[hibernatetool] Quoting problematic instruction:
[hibernatetool] ----------
[hibernatetool] ==> if pojo.needsEqualsHashCode() && !clazz.superclass?exists [on line 1, column 1 in pojo/PojoEqualsHashcode.ftl]
[hibernatetool] in include "PojoEqualsHashcode.ftl" [on line 16, column 1 in pojo/Pojo.ftl]
[hibernatetool] ----------
[hibernatetool] Java backtrace for programmers:
[hibernatetool] ----------
[hibernatetool] freemarker.template.TemplateModelException: Method needsEqualsHashCode on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:112)
[hibernatetool] at freemarker.template.MethodCall._getAsTemplateModel(MethodCall.java:90)
[hibernatetool] at freemarker.template.Expression.getAsTemplateModel(Expression.java:88)
[hibernatetool] at freemarker.template.Expression.isTrue(Expression.java:137)
[hibernatetool] at freemarker.template.AndExpression.isTrue(AndExpression.java:68)
[hibernatetool] at freemarker.template.ConditionalBlock.accept(ConditionalBlock.java:76)
[hibernatetool] at freemarker.template.Environment.visit(Environment.java:180)
[hibernatetool] at freemarker.template.Environment.include(Environment.java:1018)
[hibernatetool] at freemarker.template.Environment.include(Environment.java:964)
[hibernatetool] at freemarker.template.Include.accept(Include.java:153)
[hibernatetool] at freemarker.template.Environment.visit(Environment.java:180)
[hibernatetool] at freemarker.template.MixedContent.accept(MixedContent.java:91)
[hibernatetool] at freemarker.template.Environment.visit(Environment.java:180)
[hibernatetool] at freemarker.template.IfBlock.accept(IfBlock.java:81)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 6:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
how are you running this ? e..g what is your build.xml ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Here is my build.xml
PostPosted: Thu Jul 13, 2006 6:05 am 
Newbie

Joined: Wed Jul 12, 2006 11:20 am
Posts: 8
<project name="WACWeb" default="execute" basedir=".">

<path id="toolslib">
<path location="../../../../../WebContent/WEB-INF/lib/hibernate-tools.jar" />
<path location="../../../../../WebContent/WEB-INF/lib/hibernate3.jar" />
<path location="../../../../../WebContent/WEB-INF/lib/commons-logging.jar" />
<path location="../../../../../WebContent/WEB-INF/lib/commons-collections.jar" />
<path location="../../../../../WebContent/WEB-INF/lib/dom4j-1.4.jar" />
<path location="../../../../../WebContent/WEB-INF/lib/velocity-1.4.jar" />
<path location="../../../../../WebContent/WEB-INF/lib/freemarker.jar" />
<path location="../../../../../WebContent/WEB-INF/classes" />
<path location="." />
</path>

<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib" />


<target name="execute">

<hibernatetool destdir=".">
<configuration configurationfile="hibernate.cfg.xml"/>
<hbm2java />
</hibernatetool>

</target>

</project>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 6:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm...could you send me your mappings so i could reproduce this one ?
don't get why it complains about that method.

are you sure you got the full stacktrace ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Related files
PostPosted: Thu Jul 13, 2006 6:59 am 
Newbie

Joined: Wed Jul 12, 2006 11:20 am
Posts: 8
output.hbm.xml
-------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.bosch.wac.test">
<class name="WACEntity" table="IPProjectRequest">
<id name="id" column="ID" type="integer">
<generator class="sequence"/>
</id>
<property name="f_projectdesignation" column="f_projectdesignation" type="string" length="100"/>
<property name="f_projectAbbreviation" column="f_projectAbbreviation" type="string" length="100"/>
<property name="f_system" column="f_system" type="string" length="100"/>
<property name="f_number" column="f_number" type="string" length="100"/>
<property name="f_savingsonce" column="f_savingsonce" type="string" length="100"/>
<property name="f_targetCostsOnce" column="f_targetCostsOnce" type="string" length="100"/>
<property name="f_savingsperyear" column="f_savingsperyear" type="string" length="100"/>
<property name="f_targetCostsperyear" column="f_targetCostsperyear" type="string" length="100"/>
<property name="comment" column="comment" type="string" length="500"/>
<property name="f_txtField11" column="f_txtField11" type="string" length="100"/>
<property name="f_txtField12" column="f_txtField12" type="string" length="100"/>
<property name="f_RB11" column="f_RB11" type="string"/>
<property name="f_RB12" column="f_RB12" type="string"/>
<property name="f_RB13" column="f_RB13" type="string"/>
<property name="f_txtField21" column="f_txtField21" type="string" length="100"/>
<property name="f_txtField22" column="f_txtField22" type="string" length="100"/>
<property name="f_RB21" column="f_RB21" type="string"/>
<property name="f_RB22" column="f_RB22" type="string"/>
<property name="f_RB23" column="f_RB23" type="string"/>
</class>
</hibernate-mapping>


hibernate.cfg.xml
---------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:mysql://yangtze/test</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.username"></property>
<property name="connection.password"></property>
<property name="connection.pool_size">12</property>
<property name="show_sql">false</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<mapping resource="output.hbm.xml"/>
</session-factory>
</hibernate-configuration>


WACEntity.java
------------------
package com.bosch.wac.test;

public class WACEntity
{
public int id;
public String f_projectdesignation;
public String f_projectAbbreviation;
public String f_system;
public String f_number;
public String f_savingsonce;
public String f_targetCostsOnce;
public String f_savingsperyear;
public String f_targetCostsperyear;
public String comment;
public String f_txtField11;
public String f_txtField12;
public String f_RB11;
public String f_RB12;
public String f_RB13;
public String f_txtField21;
public String f_txtField22;
public String f_RB21;
public String f_RB22;
public String f_RB23;

public WACEntity()
{}

/**
* @return Returns the comment.
*/
public String getComment() {
return comment;
}
/**
* @param comment The comment to set.
*/
public void setComment(String comment) {
this.comment = comment;
}
/**
* @return Returns the f_number.
*/
public String getF_number() {
return f_number;
}
/**
* @param f_number The f_number to set.
*/
public void setF_number(String f_number) {
this.f_number = f_number;
}
/**
* @return Returns the f_projectAbbreviation.
*/
public String getF_projectAbbreviation() {
return f_projectAbbreviation;
}
/**
* @param abbreviation The f_projectAbbreviation to set.
*/
public void setF_projectAbbreviation(String abbreviation) {
f_projectAbbreviation = abbreviation;
}
/**
* @return Returns the f_projectdesignation.
*/
public String getF_projectdesignation() {
return f_projectdesignation;
}
/**
* @param f_projectdesignation The f_projectdesignation to set.
*/
public void setF_projectdesignation(String f_projectdesignation) {
this.f_projectdesignation = f_projectdesignation;
}
/**
* @return Returns the f_RB11.
*/
public String getF_RB11() {
return f_RB11;
}
/**
* @param f_rb11 The f_RB11 to set.
*/
public void setF_RB11(String f_rb11) {
f_RB11 = f_rb11;
}
/**
* @return Returns the f_RB12.
*/
public String getF_RB12() {
return f_RB12;
}
/**
* @param f_rb12 The f_RB12 to set.
*/
public void setF_RB12(String f_rb12) {
f_RB12 = f_rb12;
}
/**
* @return Returns the f_RB13.
*/
public String getF_RB13() {
return f_RB13;
}
/**
* @param f_rb13 The f_RB13 to set.
*/
public void setF_RB13(String f_rb13) {
f_RB13 = f_rb13;
}
/**
* @return Returns the f_RB21.
*/
public String getF_RB21() {
return f_RB21;
}
/**
* @param f_rb21 The f_RB21 to set.
*/
public void setF_RB21(String f_rb21) {
f_RB21 = f_rb21;
}
/**
* @return Returns the f_RB22.
*/
public String getF_RB22() {
return f_RB22;
}
/**
* @param f_rb22 The f_RB22 to set.
*/
public void setF_RB22(String f_rb22) {
f_RB22 = f_rb22;
}
/**
* @return Returns the f_RB23.
*/
public String getF_RB23() {
return f_RB23;
}
/**
* @param f_rb23 The f_RB23 to set.
*/
public void setF_RB23(String f_rb23) {
f_RB23 = f_rb23;
}
/**
* @return Returns the f_savingsonce.
*/
public String getF_savingsonce() {
return f_savingsonce;
}
/**
* @param f_savingsonce The f_savingsonce to set.
*/
public void setF_savingsonce(String f_savingsonce) {
this.f_savingsonce = f_savingsonce;
}
/**
* @return Returns the f_savingsperyear.
*/
public String getF_savingsperyear() {
return f_savingsperyear;
}
/**
* @param f_savingsperyear The f_savingsperyear to set.
*/
public void setF_savingsperyear(String f_savingsperyear) {
this.f_savingsperyear = f_savingsperyear;
}
/**
* @return Returns the f_system.
*/
public String getF_system() {
return f_system;
}
/**
* @param f_system The f_system to set.
*/
public void setF_system(String f_system) {
this.f_system = f_system;
}
/**
* @return Returns the f_targetCostsOnce.
*/
public String getF_targetCostsOnce() {
return f_targetCostsOnce;
}
/**
* @param costsOnce The f_targetCostsOnce to set.
*/
public void setF_targetCostsOnce(String costsOnce) {
f_targetCostsOnce = costsOnce;
}
/**
* @return Returns the f_targetCostsperyear.
*/
public String getF_targetCostsperyear() {
return f_targetCostsperyear;
}
/**
* @param costsperyear The f_targetCostsperyear to set.
*/
public void setF_targetCostsperyear(String costsperyear) {
f_targetCostsperyear = costsperyear;
}
/**
* @return Returns the f_txtField11.
*/
public String getF_txtField11() {
return f_txtField11;
}
/**
* @param field11 The f_txtField11 to set.
*/
public void setF_txtField11(String field11) {
f_txtField11 = field11;
}
/**
* @return Returns the f_txtField12.
*/
public String getF_txtField12() {
return f_txtField12;
}
/**
* @param field12 The f_txtField12 to set.
*/
public void setF_txtField12(String field12) {
f_txtField12 = field12;
}
/**
* @return Returns the f_txtField21.
*/
public String getF_txtField21() {
return f_txtField21;
}
/**
* @param field21 The f_txtField21 to set.
*/
public void setF_txtField21(String field21) {
f_txtField21 = field21;
}
/**
* @return Returns the f_txtField22.
*/
public String getF_txtField22() {
return f_txtField22;
}
/**
* @param field22 The f_txtField22 to set.
*/
public void setF_txtField22(String field22) {
f_txtField22 = field22;
}
/**
* @return Returns the id.
*/
public int getId() {
return id;
}
/**
* @param id The id to set.
*/
public void setId(int id) {
this.id = id;
}
}


Stack Trace
---------------
Buildfile: C:\workspace\WACWeb\Test\com\bosch\wac\test\build.xml
execute:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] 13.07.2006 11:40:16 at org.hibernate.cfg.Environment.<clinit>(Environment.java:464)
[hibernatetool] INFO: Hibernate 3.0.5
[hibernatetool] 13.07.2006 11:40:16 at org.hibernate.cfg.Environment.<clinit>(Environment.java:477)
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] 13.07.2006 11:40:16 at org.hibernate.cfg.Environment.<clinit>(Environment.java:510)
[hibernatetool] INFO: using CGLIB reflection optimizer
[hibernatetool] 13.07.2006 11:40:16 at org.hibernate.cfg.Environment.<clinit>(Environment.java:540)
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 13.07.2006 11:40:16 org.hibernate.cfg.Configuration configure
[hibernatetool] INFO: configuring from file: hibernate.cfg.xml
[hibernatetool] 13.07.2006 11:40:16 org.hibernate.cfg.Configuration addResource
[hibernatetool] INFO: Mapping resource: output.hbm.xml
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
[hibernatetool] INFO: Mapping class: com.bosch.wac.test.WACEntity -> IPProjectRequest
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.Configuration doConfigure
[hibernatetool] INFO: Configured SessionFactory: null
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing extends queue
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing collection mappings
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing association property references
[hibernatetool] 13.07.2006 11:40:17 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing foreign key constraints
[hibernatetool] 13.07.2006 11:40:19 freemarker.log.JDK14LoggerFactory$JDK14Logger error
[hibernatetool] SEVERE:
[hibernatetool] Method needsEqualsHashCode on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass
[hibernatetool] Quoting problematic instruction:
[hibernatetool] ----------
[hibernatetool] ==> if pojo.needsEqualsHashCode() && !clazz.superclass?exists [on line 1, column 1 in pojo/PojoEqualsHashcode.ftl]
[hibernatetool] in include "PojoEqualsHashcode.ftl" [on line 16, column 1 in pojo/Pojo.ftl]
[hibernatetool] ----------
[hibernatetool] Java backtrace for programmers:
[hibernatetool] ----------
[hibernatetool] freemarker.template.TemplateModelException: Method needsEqualsHashCode on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:112)
[hibernatetool] at freemarker.template.MethodCall._getAsTemplateModel(MethodCall.java:90)
[hibernatetool] at freemarker.template.Expression.getAsTemplateModel(Expression.java:88)
[hibernatetool] at freemarker.template.Expression.isTrue(Expression.java:137)
[hibernatetool] at freemarker.template.AndExpression.isTrue(AndExpression.java:68)
[hibernatetool] at freemarker.template.ConditionalBlock.accept(ConditionalBlock.java:76)
[hibernatetool] at freemarker.template.Environment.visit(Environment.java:180)
[hibernatetool] at freemarker.template.Environment.include(Environment.java:1018)
[hibernatetool] at freemarker.template.Environment.include(Environment.java:964)
[hibernatetool] at freemarker.template.Include.accept(Include.java:153)
[hibernatetool] at freemarker.template.Environment.visit(Environment.java:180)
[hibernatetool] at freemarker.template.MixedContent.accept(MixedContent.java:91)
[hibernatetool] at freemarker.template.Environment.visit(Environment.java:180)
[hibernatetool] at freemarker.template.IfBlock.accept(IfBlock.java:81)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 7:30 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the code is generated perfectly fine when i run this.

Any reason you show another WACEntity.java file ? (it doesnt look like something the tools would generate)

Are you using the jars from the tools distribution ?

Could you try and run with ant -debug ? I still is puzzled about the exception message; it looks incomplete. Freemarker exception normally include a cause for why they don't like a specific line.

p.s. just remove velocity.jar from that classpath we don't need it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 7:49 am 
Newbie

Joined: Wed Jul 12, 2006 11:20 am
Posts: 8
Hi Max,

We are using Hibernate-3.1.3.jar and freemarker-2.3.8.jar and hibernate-tools.jar present in org.hibernate.eclipse_3.1.0.alpha5.

Is this ok? Since the hibernate-tools.jar is not a stable build. Can you suggest a stable build which I can use for Hibernate-tools.jar.

Peter


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 7:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
when using the tools you should use the jars that comes with the hibernatetools release. the generated code will work fine on 3.x.

i know this is not optimal, but otherwise i would have to reimplement alot of already existing mapping code....

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: WACEntity
PostPosted: Thu Jul 13, 2006 7:52 am 
Newbie

Joined: Wed Jul 12, 2006 11:20 am
Posts: 8
THe WACEntity.java is generated by me. Is there a way I can generate an entity class using hibernate tool. Please tell me how.


Top
 Profile  
 
 Post subject: Error after using the tools from HibernateTools-3.2.0.beta6
PostPosted: Thu Jul 13, 2006 8:11 am 
Newbie

Joined: Wed Jul 12, 2006 11:20 am
Posts: 8
Buildfile: C:\workspace\WACWeb\Test\com\bosch\wac\test\build.xml
execute:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] 13.07.2006 14:07:47 at org.hibernate.cfg.Environment.<clinit>(Environment.java:464)
[hibernatetool] INFO: Hibernate 3.0.5
[hibernatetool] 13.07.2006 14:07:47 at org.hibernate.cfg.Environment.<clinit>(Environment.java:477)
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] 13.07.2006 14:07:47 at org.hibernate.cfg.Environment.<clinit>(Environment.java:510)
[hibernatetool] INFO: using CGLIB reflection optimizer
[hibernatetool] 13.07.2006 14:07:47 at org.hibernate.cfg.Environment.<clinit>(Environment.java:540)
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 13.07.2006 14:07:47 org.hibernate.cfg.Configuration configure
[hibernatetool] INFO: configuring from file: hibernate.cfg.xml
[hibernatetool] 13.07.2006 14:07:47 org.hibernate.cfg.Configuration addResource
[hibernatetool] INFO: Mapping resource: output.hbm.xml
[hibernatetool] 13.07.2006 14:07:48 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
[hibernatetool] INFO: Mapping class: com.bosch.wac.test.WACEntity -> IPProjectRequest
[hibernatetool] 13.07.2006 14:07:48 org.hibernate.cfg.Configuration doConfigure
[hibernatetool] INFO: Configured SessionFactory: null
[hibernatetool] 13.07.2006 14:07:48 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing extends queue
[hibernatetool] 13.07.2006 14:07:48 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing collection mappings
[hibernatetool] 13.07.2006 14:07:48 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing association property references
[hibernatetool] 13.07.2006 14:07:48 org.hibernate.cfg.Configuration secondPassCompile
[hibernatetool] INFO: processing foreign key constraints
[hibernatetool] 13.07.2006 14:07:48 at org.hibernate.tool.hbm2x.Version.<clinit>(Version.java:15)
[hibernatetool] INFO: Hibernate Tools 3.1.0.beta5
[hibernatetool] 13.07.2006 14:07:50 freemarker.log.JDK14LoggerFactory$JDK14Logger error
[hibernatetool] SEVERE:
[hibernatetool] Method public boolean org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.needsEqualsHashCode() threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.bosch.wac.test.WACEntity)
[hibernatetool] The problematic instruction:
[hibernatetool] ----------
[hibernatetool] ==> if pojo.needsEqualsHashCode() && !clazz.superclass?exists [on line 1, column 1 in pojo/PojoEqualsHashcode.ftl]
[hibernatetool] in include "PojoEqualsHashcode.ftl" [on line 16, column 1 in pojo/Pojo.ftl]
[hibernatetool] ----------
[hibernatetool] Java backtrace for programmers:
[hibernatetool] ----------
[hibernatetool] freemarker.template.TemplateModelException: Method public boolean org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.needsEqualsHashCode() threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.bosch.wac.test.WACEntity)
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136)
[hibernatetool] at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
[hibernatetool] at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
[hibernatetool] at freemarker.core.Expression.isTrue(Expression.java:138)
[hibernatetool] at freemarker.core.AndExpression.isTrue(AndExpression.java:68)
[hibernatetool] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.include(Environment.java:1375)
[hibernatetool] at freemarker.core.Include.accept(Include.java:155)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.IfBlock.accept(IfBlock.java:82)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:233)
[hibernatetool] at freemarker.core.BlockAssignment.accept(BlockAssignment.java:83)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.process(Environment.java:176)
[hibernatetool] at freemarker.template.Template.process(Template.java:231)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:243)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:112)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:101)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporter.java:84)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:69)
[hibernatetool] at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:93)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.start(GenericExporter.java:59)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:160)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:385)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:136)
[hibernatetool] Caused by: java.lang.reflect.InvocationTargetException
[hibernatetool] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[hibernatetool] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
[hibernatetool] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:41)
[hibernatetool] at java.lang.reflect.Method.invoke(Method.java:386)
[hibernatetool] at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:583)


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