-->
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: hbm2java (newbie) Question
PostPosted: Wed Jul 20, 2005 2:01 am 
Newbie

Joined: Tue Jul 19, 2005 11:57 pm
Posts: 3
Hi,

I'm trying to use the hbm2java ant task. I have created a series of mapping files, one for each class. I'm using Hibernate 3.0.5 and hibernate-tools 3.0 alpha 4a.

When I build my ant target, I get the following error:

Code:
Buildfile: C:\somedir\mywork\buildrss\breaktracker\build.xml

ddl:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] [INFO] Environment - -Hibernate 3.0.5
[hibernatetool] [INFO] Environment - -hibernate.properties not found
[hibernatetool] [INFO] Environment - -using CGLIB reflection optimizer
[hibernatetool] [INFO] Environment - -using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] [INFO] Configuration - -Mapping file: C:\somedir\mywork\buildrss\breaktracker\src\mycompany\myproduct\tools\ailsa\model\Breakage.hbm.xml
[hibernatetool] [INFO] HbmBinder - -Mapping class: mycompany.myproduct.tools.ailsa.model.Breakage -> BREAKAGES
[hibernatetool] org.hibernate.MappingException: class mycompany.myproduct.tools.ailsa.model.Breakage not found while looking for property: id
[hibernatetool]    at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:81)
[hibernatetool]    at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:275)
[hibernatetool]    at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:360)
[hibernatetool]    at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:294)
[hibernatetool]    at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:236)
[hibernatetool]    at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:152)
[hibernatetool]    at org.hibernate.cfg.Configuration.add(Configuration.java:362)
[hibernatetool]    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:400)
[hibernatetool]    at org.hibernate.cfg.Configuration.addFile(Configuration.java:245)
SNIP


I'm confused by this error, because hbm2java seems to be looking for classes that I'm expecting it to actually generate the source code for. My buildfile looks like so:

Code:
<?xml version="1.0" encoding="windows-1252" ?>
<project name="breaktracker" default="init">
 
  <taskdef name="hibernatetool"
           classname="org.hibernate.tool.ant.HibernateToolTask"
           classpath="lib/commons-collections-2.1.1.jar;
                      lib/dom4j-1.6.jar;
                      lib/hibernate3.jar;
                      lib/hibernate-tools.jar;
                      lib/jtidy-r8-21122004.jar;
                      lib/ocrs12.jar;
                      lib/ojdbc14.jar;
                      lib/ojdbc14dms.jar;
                      lib/orai18n.jar
                      lib/velocity-1.4.jar;
                      lib/velocity-tools-generic-1.1.jar"
  />

  <target name="init">
    <tstamp/>
  </target>
 
  <target name="ddl">
    <mkdir dir="built" />
    <hibernatetool destdir="built">
      <configuration>
        <fileset dir="src" id="id">
          <include name="**/*.hbm.xml"/>
        </fileset>
      </configuration>     
     
      <hbm2java />
    </hibernatetool>
  </target>
 
</project>



I can post the full content of my *.hbm.xml files if it's useful and relevant.

Any help / pointers to documentation / whatever would be most appreciated.

Thanks,
Brian[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 20, 2005 2:09 am 
Newbie

Joined: Tue Jul 19, 2005 11:57 pm
Posts: 3
Ahh.. I guess this is the same issue as the one reported in http://forum.hibernate.org/viewtopic.php?t=944893. That's a really poor error message guys ;)

Brian[/b][/url]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 20, 2005 2:10 am 
Newbie

Joined: Tue Jul 19, 2005 11:57 pm
Posts: 3
Uh. What's the deal with this forum software and closing tags? euch.[/i]


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