Hi
I try to use hibernate, but I always get following error (some error with the DTD sheme) when I try to configure hibernate:
Configuration cfg = new Configuration().configure ("/resources/hibernate.cfg.xml");
->
0 [main] INFO net.sf.hibernate.cfg.Environment - Hibernate 2.1.1
0 [main] INFO net.sf.hibernate.cfg.Environment - hibernate.properties not found
0 [main] INFO net.sf.hibernate.cfg.Environment - using CGLIB reflection optimizer
15 [main] INFO net.sf.hibernate.cfg.Configuration - configuring from resource: /resources/hibernate.cfg.xml
15 [main] INFO net.sf.hibernate.cfg.Configuration - Configuration resource: /resources/hibernate.cfg.xml
78 [main] DEBUG net.sf.hibernate.util.DTDEntityResolver - trying to locate
http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath under net/sf/hibernate/
net.sf.hibernate.HibernateException: problem parsing configuration/resources/hibernate.cfg.xml
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:906)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:845)
at ch.ejpd.jdbkof.client.testClient.<init>(testClient.java:56)
at ch.ejpd.jdbkof.client.testClient.main(testClient.java:85)
Caused by: org.dom4j.DocumentException: Error on line 3 of document : java.lang.NullPointerException Nested exception: java.lang.NullPointerException
at org.dom4j.io.SAXReader.read(SAXReader.java:355)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:901)
... 3 more
78 [main] ERROR net.sf.hibernate.cfg.Configuration - problem parsing configuration/resources/hibernate.cfg.xml
org.dom4j.DocumentException: Error on line 3 of document : java.lang.NullPointerException Nested exception: java.lang.NullPointerException
at org.dom4j.io.SAXReader.read(SAXReader.java:355)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:901)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:845)
at ch.ejpd.jdbkof.client.testClient.<init>(testClient.java:56)
at ch.ejpd.jdbkof.client.testClient.main(testClient.java:85)
Nested exception:
java.lang.NullPointerException
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:658)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:901)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:845)
at ch.ejpd.jdbkof.client.testClient.<init>(testClient.java:56)
at ch.ejpd.jdbkof.client.testClient.main(testClient.java:85)
My config doc:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<!--Mapping files -->
<mapping resource="DTOSystemInfo.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Whats wrong ... (I am using jdk 1.4.2_02 with eclipse, hibernate 2.1.3)
Thanks very much