-->
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: Hibernate Tools broken
PostPosted: Fri Apr 29, 2005 11:48 pm 
Newbie

Joined: Sun Apr 24, 2005 11:43 pm
Posts: 8
Is it just me or does the Artifact Generation not create POJO from mapping files (what hbm2java used to do)?

I continue to get the following error, no matter what database I use, no matter what is in the mapping file. I can only guess that it's something fundamentally stupid that I did. From the Hibernate Console I can create a session successfully, and I did successfully reverse-engineer a few tables I created into mappings and pojo. I know the database is working, I know I can talk to it, I know the tools can get *something* done. So why can't I go from hbm to POJO?
Here is the error:

Error under artifact generation
Reason:
org.hibernate.MappingException: Could not configure datastore from file:/Users/ryan/Projects/BayPort/src/com/bayport/intermodal/Driver.hbm.xml

Here is my hibernate:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/bayport</property>
<property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password"></property>
</session-factory>
</hibernate-configuration>

Here is the mapping 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>
<class name="com.bayport.intermodal.Driver" table="Driver">
<id name="id">
<generator class="native"/>
</id>
<property name="driverNo" not-null="true" type="integer" unique="true"/>
<property name="commercialDLNumber" type="long"/>
<property name="commercialDLState" type="string"/>
<property name="notes" type="string"/>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: ok disregard
PostPosted: Sat Apr 30, 2005 11:11 am 
Newbie

Joined: Sun Apr 24, 2005 11:43 pm
Posts: 8
I am just stupid. Hibernate wasn't giving descriptive errors. I wish it could have given me a mapping error, which was the problem. I fixed the mapping file and now it works.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 01, 2005 8:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
didnt the stacktrace include that information ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: no
PostPosted: Sun May 01, 2005 10:08 am 
Newbie

Joined: Sun Apr 24, 2005 11:43 pm
Posts: 8
the artifact generation ui in eclipse did not show a stack trace in any of the windows that i saw.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 03, 2005 11:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
details of stacktraces is shown in the Error Log.

-max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 07, 2005 2:02 pm 
Beginner
Beginner

Joined: Sun Jan 16, 2005 5:45 pm
Posts: 24
Location: Atlanta
I had the exact same problem... yes, it is frustrating. My problem was that I was specifying the mapping files in hibernate.cfg.xml and as part of the configuration. I removed the “.hbm” files from the “mapping files” section of the hibernate configuration and that fixed it. I was then able to generate the POJO files from the hibernate.cfg.xml file.

I would assume the mapping files section is to be used when using a properties file and not the hibernate.cfg.xml.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 07, 2005 2:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes - the configuration should be viewed just like the hibernate configuration....double adding mappings there would be considered an error.

But add a request to the jira and i'll see if we can at least warn of duplicate mapping file names. (using the path to check with wont help since some can be mapped as resources others as files)

_________________
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.  [ 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.