Hi all,
I'm currently facing a problem I can't solve. I've found several topics related to this issue, but I have not been able to solve it.
I've have a project (web app) using Hibernate 3.3 without problem at runtime. In Eclipse Helios with Hibernate Tools 3.3, when I create a new Hibernate Configuration in hibernate view, I set all requested information: my project (its classpath has been automatically added in related tab), database connectivity (ping is OK), hibernate cfg.xml file, etc.
The problem occurs when I try to expand my configuration in "Hibernate Configurations" panel within Eclipse, I get following message error:
Quote:
Error while opening console configuration: hibernate
Reason:
org.hibernate.MappingNotFoundException: resource: fr/inra/moulon/proticport/server/dao/ComRefCountry.hbm.xml not found
resource: fr/inra/moulon/proticport/server/dao/ComRefCountry.hbm.xml not found
Detailed message is not really useful:
Quote:
org.hibernate.MappingNotFoundException: resource: fr/inra/moulon/proticport/server/dao/ComRefCountry.hbm.xml not found
resource: fr/inra/moulon/proticport/server/dao/ComRefCountry.hbm.xml not found
<No message>
Here is my configuration file for Hibernate:
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="SessionFactory">
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="current_session_context_class">jta</property>
<mapping resource="fr/inra/moulon/proticport/server/dao/ComRefCountry.hbm.xml" />
<mapping resource="fr/inra/moulon/proticport/server/dao/ProticSpotNetworks.hbm.xml" />
...
</session-factory>
</hibernate-configuration>
Here is the tree of my files (src folder is at project root):
Code:
src
src/main
src/main/java
src/main/java/fr/[...]
src/main/webapp
src/main/webapp/META-INF
src/main/webapp/WEB-INF
src/main/webapp/WEB-INF/classes
src/resources
src/resources/fr
src/resources/fr/inra
src/resources/fr/inra/moulon
src/resources/fr/inra/moulon/proticport
src/resources/fr/inra/moulon/proticport/server
src/resources/fr/inra/moulon/proticport/server/dao
src/resources/fr/inra/moulon/proticport/server/dao/ComRefCountry.hbm.xml
src/resources/fr/inra/moulon/proticport/server/dao/ProticSpotNetworks.hbm.xml
src/resources/hibernate_proticport.cfg.xml
Here is a part of .classpath a project root:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/home/rflores/.m2/repository/org/hibernate/hibernate3/3.3.2.GA/hibernate3-3.3.2.GA.jar" sourcepath="/home/rflores/Documents/proticWS/workspace/lib/src/hibernate"/>
<classpathentry kind="lib" path="/home/rflores/.m2/repository"/>
...
<classpathentry kind="lib" path="src/resources/fr"/>
<classpathentry kind="lib" path="/home/rflores/Documents/proticWS/workspace/lib/postgresql-8.1-415.jdbc2.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
I've tried to put ComRefCountry.hbm.xml next to hibernate_proticport.cfg.xml, I modified mapping in configuration file with absolute path, with relative paths from project root directory and so on with all folders, but no way, I can't expand my configuration.
If one need other information, please let me know.
Any help would be greatly appreciated.
Thanks by advance.