Note that there are some explanatory texts on larger screens.

plurals
  1. POmapping file not found error
    text
    copied!<p>I tried to write a simple programm with hibernate and MySQL but I get this error:</p> <pre><code>INFO: Configuration resource: /hibernate.cfg.xml Aug 06, 2013 3:51:37 PM org.hibernate.cfg.Configuration addResource INFO: Reading mappings from resource : /hibernate-contact.hbm.xml resource: /hibernate-contact.hbm.xml not found BUILD SUCCESSFUL (total time: 0 seconds) </code></pre> <p>This is my mapping file:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt; &lt;hibernate-mapping&gt; &lt;class name="Untersuchungsraum.Contact" table="contact"/&gt; &lt;id column="firstname" type="string" &gt; &lt;generator class="native"&gt; &lt;/generator&gt; &lt;/id&gt; &lt;property name="firstname"&gt; &lt;column name="firstname"&gt;&lt;/column&gt; &lt;/property&gt; &lt;property name="lastnamename"&gt; &lt;column name="lastname"&gt;&lt;/column&gt; &lt;/property&gt; &lt;property name="email"&gt; &lt;column name="email"&gt;&lt;/column&gt; &lt;/property&gt; ... </code></pre> <p>and it is my XML configuration file:</p> <pre><code>&lt;hibernate-configuration&gt; &lt;session-factory&gt; &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt; &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt; &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/rcf?zeroDateTimeBehavior=convertToNull&lt;/property&gt; &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt; &lt;mapping resource="/hibernate-contact.hbm.xml"/&gt; &lt;mapping/&gt; &lt;/session-factory&gt; &lt;/hibernate-configuration&gt; </code></pre> <p>an my project looks like this: <img src="https://i.stack.imgur.com/2L7Mj.png" alt="enter image description here"></p> <p>why I do get this problem and hw can I solve it? </p> <p><strong>EDIT</strong> my <code>hbm.xml</code> file is:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt; &lt;hibernate-mapping&gt; &lt;class name="Untersuchungsraum.Contact" table="contact"&gt; &lt;property name="firstname"&gt; &lt;column name="Firstname"&gt;&lt;/column&gt; &lt;/property&gt; &lt;property name="lastname"&gt; &lt;column name="lastname"&gt;&lt;/column&gt; &lt;/property&gt; &lt;property name="email"&gt; &lt;column name="email"&gt;&lt;/column&gt; &lt;/property&gt; &lt;/class&gt; &lt;/hibernate-mapping&gt; </code></pre> <p>and my POJO Class:</p> <pre><code>package Untersuchungsraum; public class Contact { private String email; private String firstname; private String lastname; public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getFirstname() { return firstname; } public void setFirstname(String firstname) { this.firstname = firstname; } public String getLastname() { return lastname; } public void setLastname(String lastname) { this.lastname = lastname; } </code></pre> <p>}</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload