Hiya.
I'm trying to get to square one with Hibernate, but keep running into an error that claims that my hibernate configuration is bogus:
Quote:
INFO - Hibernate 2.1.1
INFO - hibernate.properties not found
INFO - using CGLIB reflection optimizer
INFO - configuring from file: for-testing-hibernate.cfg.xml
ERROR - Error parsing XML: for-testing-hibernate.cfg.xml(6) Document root element "hibernate-configuration", must match DOCTYPE root "hibernate-configuration".
ERROR - Error parsing XML: for-testing-hibernate.cfg.xml(17) The content of element type "session-factory" must match "(property*,mapping+,(class-cache|collection-cache|jcs-class-cache|jcs-collection-cache)*)".
ERROR - Error parsing XML: for-testing-hibernate.cfg.xml(19) The content of element type "hibernate-configuration" must match "(session-factory)".
ERROR - problem parsing configurationfor-testing-hibernate.cfg.xml
net.sf.hibernate.MappingException: invalid configuration
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:902)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:879)
I'm mystified. Lines like
Document root element "hibernate-configuration", must match DOCTYPE root "hibernate-configuration". seem kind of daft. I've tried configurations pulled directly from the site, as well as the one that I want to use:
Quote:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.connection.url">jdbc:hsqldb:testdata/test</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="dialect">net.sf.hibernate.dialect.HSQLDialect</property>
<property name="show_sql"> true </property>
<property name="transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.cache.provider_class">net.sf.hibernate.cache.HashtableCacheProvider</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="hibernate.connection.pool_size">3</property>
<mapping resource="com/ambientdevices/wine/database/PersistentState.hbm.xml"/>
</session-factory>
</hibernate-configuration>
...all the errors seem to be addressed in this. I realize this is just an XML parsing problem, nothing specifically Hibernate, but has anyone seen anything like this?
Thanks,
- Ert Dredge