jboss5.x - SaxParser errors with Hibernate and JBoss - conflicting versions? -
I use JBOSS 5.1.0.GA and Hibernate
while trying to connect to the database I am doing I get the following errors
10: 21: 03,042 information [version] Hibernate Commons Annotation 3.1.0.GA 10: 21: 03,049 Configuring Information [Configuration] Processing: /hibernate.cfg . XML 10: 21: 03,049 information [configuration] configuration resource: /hibernate.cfg.xml 10: 21: 03,077 information [STDOUT] WARNING: 21: Attempt to use the SAX caught SAX 03.077 information to load a SAX XMLReader 10 [STDOUT] WARNING: The exception was: java.lang.ClassCastException: org.apache.xerces.parsers.SAXParser can not be molded in org.xml.sax.XMLReader 10: 21: 03,077 information [STDOUT] Warning: I print stack trace If the default SAX Parser is used on 10: 21: 03,077 error [STDERR] java.lang.ClassCastException: 21 :: org.apache.xerces.parsers.SAXParser org.xml.sax.xmlReader 10 May Molded can not have 03,078 ERROR [STDERR] At org.xml.sax.helpers.XMLReaderFactory.loadClass (Unkno wn Source) 10: 21: 03,078 ERROR [STDERR] org.xml.sax.helpers.XMLReaderFactory.createXMLReader (Unknown Source ) 10: 21: 03,078 eRROR [STDERR] on org.dom4j.io.SAXHelper.createXMLReader (SAXHelper. Java: 83) 10: 21: 03,078 eRROR [STDERR] org.dom4j.io.SAXReader.createXMLReader (SAXReader.java : 894) on 10: 21: 03,078 error [STDERR] on 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.java1518)
then <10> 21: 03,386 [STDOUT] 10: 21: 03,382 error [DatabaseManager] error intialising org.hibernate.HibernateException hibernate: could not parse configuration: /hibernate.cfg.xml on org.hibernate.cfg.AnnotationConfiguration.doConfigure (org.hibernate.cfg.Configuration.doConfigure (Configuration.java:1528) on AnnotationConfiguration.java : 1035) org.hibernate.cfg on org.hibernate.cfg on tionConfiguration.doConfigure (AnnotationConfiguration.java:64) org.hibernate.cfg.Configuration.configure (Configuration.java:1462) on org.hibernate.cfg.Annota. on AnnotationConfiguration.configure (AnnotationConfiguration.java:1017) org.dom4j.DocumentException: on .AnnotationConfiguration.configure org.hibernate.cfg.Configuration.configure (AnnotationConfiguration.java:64) (Configuration.java:1448) Because of Sax2 driver class org.apache.xerces.parsers.SAXParser does XMLReader not apply nested exception: Sax2 driver class org.apache.xerces.parsers.SAXParser org.dom4j.io.SAXReader.read (SAXReader.java: 484) org.hibernate.cfg.Configuration.doConfigure does not apply to XMLReader (configuration. Java1518)
I have the following dependencies: -
Hibernate-annotation 3.4.0.ga Hibernate-Commons-Annotation 3.1.0.GA Hibernate-Core 3.3. 0.SP1
I suspect that I ji is a jar in jboss lib and a conflict in my dependen cies. Anyone can suggest what it can be?
Hibernate 4.0.0 in JBoss 5.0.1 .CR6.
The jboss support libraries ( /lib/endorsed/xercesImpl.jar I believe that is being provided by) to parse the necessary configuration files by Parser Hibernate and Hibernation-XML-API dependency interferes with them in some way.
The xml-apis .jar pack in the generated archive (in my case .war) turned out to fix the problem. To do this, I have a collection of projects. Override the scope of dependence in Pom (I do not override elsewhere because provided area is not transit):
& Lt; Version & gt; 1.0.b2 & lt; / Edition & gt; & Lt; Scope & gt; Provided & lt; / Scope & gt; & Lt; / Dependencies & gt;
Comments
Post a Comment