I have been trying my hand to implement hibernate using a small example.
Below is my hibernate.config.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>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/abc
</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="show_sql">true</property>
<mapping
resource="HibernateExample/src/HibernateExposed/Resource/Person.hbm.xml"/>
</session-factory>
</hibernate-configuration>
When running the code I am getting error org.hibernate.boot.MappingNotFoundException: Mapping (RESOURCE) not found.
I tried replacing mapping as below
<mapping
resource="Resource/Person.hbm.xml"/>
and also tried to keep the mapping xml at same location as hibernate.config.xml.
<mapping
resource="Person.hbm.xml"/>
Under none of above mentioned cases, code can find my Person.hbm.xml.
My folder structure looks as below
I looked at all other answers for this error on Stackoverflow but none of the approaches resolved this issue. Any help is highly appreciated. Also, is there any approach to debug this further to granular level?