Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hi - This was working...
Problem setup... I'm creating some common services which are packaged in a .jar file for use in applications. The persistant classes' .hbm.xml files are in the package in which the class resides. I have the Hibernate.cfg.xml located in the output directory of the eclipse project. So it seems Hibernate can locate the Hibernate.cfg.xml file but can not locate any of the mapped resources. I've looked around on for someone else with this problem, but haven't found anything relevent. Note the using application can find the classes I'm refering to.
Any assistence would be greatly appreciated.
Hibernate version: 3.1
Mapping documents:
Hibernate.cfg.xml:
<?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>
<!-- Database connection settings -->
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@xxxx:xxxx:xxxx</property>
<property name="connection.username">user</property>
<property name="connection.password">user</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<!-- Drop and re-create the database schema on startup -->
<mapping resource=".\com\thomson\west\foundations\FoundationsOnWhatVO.hbm.xml"/>
<mapping resource="com\thomson\west\foundations\context\AppPropertyVO.hbm.xml"/>
... and more...
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Exception msg = org.hibernate.MappingException: Resource: .\com\thomson\west\foundations\FoundationsOnWhatVO.hbm.xml not found
java.lang.ExceptionInInitializerError
at com.thomson.west.foundations.daos.DBDAO.<init>(DBDAO.java:54)
at com.thomson.west.foundations.daos.DBDAOFactory.createDAO(DBDAOFactory.java:52)
at com.thomson.west.foundations.daos.DAOFactoryBuilder.getRetrievalDAO(DAOFactoryBuilder.java:109)
at com.thomson.west.foundations.transport.AppDBInitVisitor.retrieveApp(AppDBInitVisitor.java:59)
at com.thomson.west.foundations.transport.AppDBInitVisitor.initialize(AppDBInitVisitor.java:39)
at com.thomson.west.foundations.transport.AppDBInitVisitor.visit(AppDBInitVisitor.java:133)
at com.thomson.west.foundations.context.ApplicationImpl.accept(ApplicationImpl.java:800)
at com.thomson.west.foundations.transport.AppDBInitVisitor.retrieveUnique(AppDBInitVisitor.java:147)
at com.thomson.west.foundations.transport.TransportBuilder.getApp(TransportBuilder.java:142)
at com.thomson.west.foundations.FoundationsBuilder.eagerPopulate(FoundationsBuilder.java:146)
at com.thomson.west.foundations.FoundationsBuilder.<init>(FoundationsBuilder.java:106)
at FirstTestApp.runTest(FirstTestApp.java:66)
at FirstTestApp.main(FirstTestApp.java:58)
Caused by: com.thomson.west.foundations.utility.IssueEncounteredException: com.thomson.west.foundations.daos.HibernateUtil Initial SessionFactory creation failed.Resource: .\com\thomson\west\foundations\FoundationsOnWhatVO.hbm.xml not found
at com.thomson.west.foundations.daos.HibernateUtil.<clinit>(HibernateUtil.java:54)
... 13 more
Caused by: java.lang.ExceptionInInitializerError
... 14 more
Caused by:
org.hibernate.MappingException: Resource: .\com\thomson\west\foundations\FoundationsOnWhatVO.hbm.xml not found
at com.thomson.west.foundations.daos.HibernateUtil.<clinit>(HibernateUtil.java:53)
... 13 more
Name and version of the database you are using:
Oracle 10g
The generated SQL (show_sql=true):
NA
Debug level Hibernate log excerpt:
NA