-->
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.  [ 6 posts ] 
Author Message
 Post subject: ...tool.hbm2x.ExporterException: unable to create directory
PostPosted: Tue Feb 21, 2006 10:54 am 
Beginner
Beginner

Joined: Wed Sep 07, 2005 9:57 am
Posts: 20
hibernate 3.0.5
tools 3.1.0 alpha5


Code:
<hibernate-mapping package="com.carma.console.maintenance.company">
   <class name="RaasCompany" schema="respraas" table="COMPANY" lazy="true" mutable="false">
<!--       Meta attributes for code generation -->
      <meta attribute="scope-class">public abstract</meta>
      <meta attribute="scope-field">protected</meta>
      <meta attribute="implement-equals">true</meta>
      <meta attribute="extends">com.carma.console.BaseHibernateObject</meta>
      <meta attribute="generated-class">com.carma.console.maintenance.company.model.AbstractRaasCompany</meta>
<!--       Id -->
   

   <id name="companyKey" column="COMPANY_KEY" type="string">
         <meta attribute="use-in-tostring">true</meta>
         <generator class="assigned"></generator>
      </id>

      <property name="name" column="COMPANY_NAME" type="string" not-null="true" length="100">
         <meta attribute="use-in-tostring">true</meta>
         <meta attribute="use-in-equals">true</meta>
      </property>

      <many-to-one name="country" column="COUNTRY_KEY" class="com.carma.console.common.Country" not-null="true"></many-to-one>

      <many-to-one name="orgCountry" column="ORG_COUNTRY_KEY" class="com.carma.console.common.Country" not-null="false"></many-to-one>

      <property name="ModStamp" column="MOD_STAMP" type="date" not-null="false" length="7" />
      <property name="ModFlag" column="MOD_FLAG" type="string" not-null="false" length="1" />
      <property name="ModUser" column="MOD_USER" type="string" not-null="false" length="8" />

      <joined-subclass name="RaasRepertoireOwner" schema="respraas" table="REPERTOIRE_OWNER" lazy="true">
         <meta attribute="generated-class">com.carma.console.maintenance.company.model.AbstractRaasRepertoireOwner</meta>
         <key column="REP_OWNER_KEY"></key>
         <!-- many-to-one name="raasProfitCenter" column="PROFIT_CENTER_KEY" class="com.carma.console.maintenance.company.RaasProfitCenter" /-->
         <property name="modStamp" column="MOD_STAMP" type="date" not-null="false" length="7" />
         <property name="modFlag" column="MOD_FLAG" type="string" not-null="false" length="1" />
         <property name="prodRepOwner" column="IS_PROD_REP_OWNER" type="true_false" not-null="false" length="1" />
      </joined-subclass>

      
      <joined-subclass name="RaasProfitCenter" schema="respraas" table="PROFIT_CENTER" lazy="true"  >
         <meta attribute="generated-class">com.carma.console.maintenance.company.model.AbstractRaasProfitCenter</meta>
         <key column="PROFIT_CENTER_KEY"></key>
         <!-- many-to-one name="raasParentRepertoireOwner" column="PARENT_REP_OWNER_KEY"
            class="com.carma.console.maintenance.company.RaasParentRepertoireOwner" /-->
         <property name="modStamp" column="MOD_STAMP" type="date" not-null="false" length="7" />
         <property name="modFlag" column="MOD_FLAG" type="string" not-null="false" length="1" />
         <property name="modUser" column="MOD_USER" type="string" not-null="false" length="8" />
      </joined-subclass>

      <joined-subclass name="RaasParentRepertoireOwner" schema="respraas" table="PARENT_REPERTOIRE_OWNER" lazy="true">
         <meta attribute="generated-class">com.carma.console.maintenance.company.model.AbstractRaasParentRepertoireOwner</meta>
         <key column="PARENT_REP_OWNER_KEY"></key>
         <property name="modStamp" column="MOD_STAMP" type="date" not-null="false" length="7" />
         <property name="modFlag" column="MOD_FLAG" type="string" not-null="false" length="1" />
         <property name="modUser" column="MOD_USER" type="string" not-null="false" length="8" />
      </joined-subclass>
   

   </class>
</hibernate-mapping>


Hi,

when I use the ant task

Code:
              <hibernatetool destdir="${src.dir}">             
                  <configuration>
                     <fileset dir="${hbm.dir}">
                     <include name="**/*.hbm.xml"/>   
                     </fileset>
                  </configuration>
                  <hbm2java/>                   
              </hibernatetool>


i always run into a problem for the above mapping file.

Code:
C:\eclipse\workspace\CarmaConsole\build.hibernate.xml:10: org.hibernate.tool.hbm2x.ExporterException: Error while processing template the second time
   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.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
   at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
Caused by: org.hibernate.tool.hbm2x.ExporterException: Error while processing template the second time
   at org.hibernate.tool.hbm2x.POJOExporter.runVelocity(POJOExporter.java:97)
   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:32)
   at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:122)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   at org.apache.tools.ant.Task.perform(Task.java:364)
   ... 9 more
Caused by: org.hibernate.tool.hbm2x.ExporterException: unable to create directory: C:\eclipse\workspace\CarmaConsole\src\com\carma\console\maintenance\company\model\AbstractRaasCompanycom\carma\console\maintenance\company\model\AbstractRaasRepertoireOwnercom\carma\console\maintenance\company\model\AbstractRaasRepertoireOwnercom\carma\console\maintenance\company\model\AbstractRaasProfitCentercom\carma\console\maintenance\company\model\AbstractRaasProfitCentercom\carma\console\maintenance\company\model\AbstractRaasParentRepertoireOwnercom\carma\console\maintenance\company\model
   at org.hibernate.tool.hbm2x.AbstractExporter.getDirForPackage(AbstractExporter.java:65)
   at org.hibernate.tool.hbm2x.AbstractExporter.getFileForClassName(AbstractExporter.java:49)
   at org.hibernate.tool.hbm2x.POJOExporter.runVelocity(POJOExporter.java:87)
   ... 15 more
--- Nested Exception ---
org.hibernate.tool.hbm2x.ExporterException: Error while processing template the second time
   at org.hibernate.tool.hbm2x.POJOExporter.runVelocity(POJOExporter.java:97)
   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:32)
   at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:122)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
   at org.apache.tools.ant.Task.perform(Task.java:364)
   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.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
   at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
   at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
Caused by: org.hibernate.tool.hbm2x.ExporterException: unable to create directory: C:\eclipse\workspace\CarmaConsole\src\com\carma\console\maintenance\company\model\AbstractRaasCompanycom\carma\console\maintenance\company\model\AbstractRaasRepertoireOwnercom\carma\console\maintenance\company\model\AbstractRaasRepertoireOwnercom\carma\console\maintenance\company\model\AbstractRaasProfitCentercom\carma\console\maintenance\company\model\AbstractRaasProfitCentercom\carma\console\maintenance\company\model\AbstractRaasParentRepertoireOwnercom\carma\console\maintenance\company\model
   at org.hibernate.tool.hbm2x.AbstractExporter.getDirForPackage(AbstractExporter.java:65)
   at org.hibernate.tool.hbm2x.AbstractExporter.getFileForClassName(AbstractExporter.java:49)
   at org.hibernate.tool.hbm2x.POJOExporter.runVelocity(POJOExporter.java:87)
   ... 15 more


It failes because it is trying to create the pojos into some fancy directories. I guess the tool gets confused by the multiple 'generated-class' meta attributes.

Is there any way around this? Am I doing anything wrong? Any comment is appreciated.

Thanks,
Ronald


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 11:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you could start by using a version of the tools that is not 4 releases old ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 11:16 am 
Beginner
Beginner

Joined: Wed Sep 07, 2005 9:57 am
Posts: 20
;-)

i also downloaded the latest tools and replaced the old the hibernate3.jar and hibernate-tools.jar. I got the same result.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 12:42 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and learn about meta inheritance ...so you should understand why inherit="false" should be added to the tags you don't want "inherited"

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 12:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
that came out a bit to harsh...not intended.

Code:
<meta inherit="false" attribute="generated-class">....</meta>

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 22, 2006 4:20 am 
Beginner
Beginner

Joined: Wed Sep 07, 2005 9:57 am
Posts: 20
It did indeed - but no offence taken.

And thanks for the answer anyway ;-) now it works fine

Ronald


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