i'm learning JSF for the moment and thought it was a good moment to use hibernate with it for my access layer... all said and done, i downloaded hibernate, read the tutorial and tried something on my own but unfortunattly i get an error:
org.hibernate.InvalidMappingException: Could not parse mapping document from resource DAL/Users.hbn.xml
This is my Users.hbn.xml:
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>
<class name="DAL.Users" table="USERS">
<id name="id" column="id">
<generator class="native"/>
</id>
<property name="userid"/>
<property name="name"/>
<propery name="firstname"/>
</class>
</hibernate-mapping>
and this is my hibernate.cfg.xml
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>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">...</property>
<property name="connection.username">...</property>
<property name="connection.password">...</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<mapping resource="DAL/Users.hbn.xml"/>
</session-factory>
</hibernate-configuration>
The mapping of my files are:
+src
---hibernate.cfg.xml
---DAL
------Users.hbn.xml
------Users.java
When i compile, i get the same file but in the /classes dir. All the xml's are also in that dir or subdir.
I really can't see what the problem is... [/code]