views:

164

answers:

0

I am using JBOSS 5.1.0.GA and Hibernate

when I try to connect to the database I get the following errors

10:21:03,042 INFO  [Version] Hibernate Commons Annotations 3.1.0.GA
10:21:03,049 INFO  [Configuration] configuring from resource: /hibernate.cfg.xml
10:21:03,049 INFO  [Configuration] Configuration resource: /hibernate.cfg.xml
10:21:03,077 INFO  [STDOUT] Warning: Caught exception attempting to use SAX to load a SAX XMLReader 
10:21:03,077 INFO  [STDOUT] Warning: Exception was: java.lang.ClassCastException: org.apache.xerces.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader
10:21:03,077 INFO  [STDOUT] Warning: I will print the stack trace then carry on using the default SAX parser
10:21:03,077 ERROR [STDERR] java.lang.ClassCastException: org.apache.xerces.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader
10:21:03,078 ERROR [STDERR]     at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
10:21:03,078 ERROR [STDERR]     at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
10:21:03,078 ERROR [STDERR]     at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)
10:21:03,078 ERROR [STDERR]     at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894)
10:21:03,078 ERROR [STDERR]     at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715)
10:21:03,078 ERROR [STDERR]     at org.dom4j.io.SAXReader.read(SAXReader.java:435)
10:21:03,078 ERROR [STDERR]     at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1518)

then

10:21:03,386 INFO  [STDOUT] 10:21:03,382 ERROR [DatabaseManager] Error intialising Hibernate
org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1528)
    at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1035)
    at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:64)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
    at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1017)
    at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:64)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1448)


Caused by: org.dom4j.DocumentException: SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement XMLReader Nested exception: SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement XMLReader
    at org.dom4j.io.SAXReader.read(SAXReader.java:484)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1518)

I have the following dependencies:-

hibernate-annotations 3.4.0.GA hibernate-commons-annotations 3.1.0.GA hibernate-core 3.3.0.SP1

I suspect I have a conflict between a jar in the jboss lib and one in my dependencies. can anyone suggest what it might be?