I am trying to establish a simple connection to my database using sleep mode. Here is my configuration file:
<?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">org.hsqldb.jdbcDriver</property> <property name="connection.url">jdbc:hsqldb:hsql://localhost</property> <property name="connection.username">user</property> <property name="connection.password">pass</property> <property name="connection.pool_size">1</property> <property name="dialect">org.hibernate.dialect.HSQLDialect</property> <property name="current_session_context_class">thread</property> <property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property> <property name="show_sql">true</property> <property name="hbm2ddl.auto">update</property> <mapping resource="com/mycomp/pro/model/elem/elem.hbm.xml"/> </session-factory> </hibernate-configuration>
I get the following error:
Exception in thread "main" org.hibernate.internal.util.config.ConfigurationException: Unable to perform unmarshalling at line number 6 and column 26 in RESOURCE hibernate.cfg.xml. Message: cvc-elt.1: Cannot find the declaration of element 'hibernate-configuration'. ...
This seems to be counterintuitive. Since I have "hibernate-configuration" as the root element in the hibernate.cfg.xml file.
I am using Hibernate 4.1.1 (just mentioning, as I have some hints that the new hibernation may have some problems)
Hope someone can help as I am new to Hibernate, and right now I am not getting any help from google either.
source share