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>