-->
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.  [ 5 posts ] 
Author Message
 Post subject: Problems with Hibernate Arifact Generation
PostPosted: Sat Aug 27, 2005 1:39 pm 
Newbie

Joined: Mon May 09, 2005 7:31 pm
Posts: 6
I used hibernate tools with eclipse 3.1 (current version) to reverse engineer 2 tiny tables from a mysql 4.1 database which works fine (mapping file generation and java code generation. afterwards I wanted to regenerate the java-code which wasn't possible.

Eclipse popped up following message: “Error under artefact generation Reason: org.hibernate.MappingException: Resource org/game/spacelords/domain/Tasks.hbm.xml not found”

Any hints?

Rgds - wilko

Hibernate version:
current version from download server

Mapping documents:

Code:
<?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 name="hibernateSession">
        <property name="hibernate.cglib.use_reflection_optimizer">true</property>
        <property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
        <property name="hibernate.connection.password">tomtom11</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/spacelords</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.default_schema">spacelords</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
        <mapping resource="org/game/spacelords/domain/Tasks.hbm.xml" />
        <mapping resource="org/game/spacelords/domain/Schedulers.hbm.xml" />
    </session-factory>
</hibernate-configuration>


Code:
<?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>
<!--
        Auto-generated mapping file from
        the hibernate.org cfg2hbm engine
-->
    <class name="org.game.spacelords.domain.Schedulers" table="schedulers" catalog="spacelords">
        <id name="id" type="integer">
            <column name="id" />
            <generator class="assigned" />
        </id>
        <property name="category" type="string">
            <column name="category" length="32" not-null="true" />
        </property>
        <property name="name" type="string">
            <column name="name" length="64" not-null="true" />
        </property>
        <property name="version" type="integer">
            <column name="version" />
        </property>
        <set name="taskses" inverse="true">
            <key>
                <column name="scheduler_id" not-null="true" />
            </key>
            <one-to-many class="org.game.spacelords.domain.Tasks" />
        </set>
    </class>
</hibernate-mapping>


Code:
<?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>
<!--
        Auto-generated mapping file from
        the hibernate.org cfg2hbm engine
-->
    <class name="org.game.spacelords.domain.Tasks" table="tasks" catalog="spacelords">
        <id name="id" type="integer">
            <column name="id" />
            <generator class="assigned" />
        </id>
        <many-to-one name="schedulers" class="org.game.spacelords.domain.Schedulers">
            <column name="scheduler_id" not-null="true" />
        </many-to-one>
        <property name="category" type="string">
            <column name="category" length="32" not-null="true" />
        </property>
        <property name="name" type="string">
            <column name="name" length="64" not-null="true" />
        </property>
        <property name="endsAt" type="timestamp">
            <column name="ends_at" length="19" not-null="true" />
        </property>
        <property name="version" type="integer">
            <column name="version" />
        </property>
    </class>
</hibernate-mapping>

_________________
Ups... I am using a forum


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 2:28 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes, those files are most likely not in the classpath of the console configuration you created.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 4:03 pm 
Newbie

Joined: Mon May 09, 2005 7:31 pm
Posts: 6
max wrote:
yes, those files are most likely not in the classpath of the console configuration you created.


thx for your fast reply. i am new to the business. where can i add the classpath to the console configuration?

rgds - wilko

_________________
Ups... I am using a forum


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 4:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
go to Hibernate Console perspective, double click the apropriate configuration and you will get a wizard on which there is a classpath you can edit

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 27, 2005 7:29 pm 
Newbie

Joined: Mon May 09, 2005 7:31 pm
Posts: 6
THX - everything works fine now

_________________
Ups... I am using a forum


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