Who knows what could be the problem with this mapping file?
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="test.Message" table="messages">
<id name="id" column="id" type="long">
<generator class="native"/>
</id>
<property name="text" type="string" />
</class>
</hibernate-mapping>
There are no problems with config file. Here it is:
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>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">free</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/test</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="test/Message.hbm.xml"/>
</session-factory>
</hibernate-configuration>
And there is my class (in the same package with mapping file):
Code:
package test;
public class Message {
private int id;
private String text;
public Message() {
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
So, when i try to run a public static void main() and just to create a SessionFactory, i get next error:
Code:
SEVERE: Error parsing XML: XML InputStream(3) Document is invalid: no grammar found.