Hi everyone,
I have been suprised while I was working with
Jboss and I would like to share with us.
I did a
test using hibernate and an
ejb. I deployed it on Jboss 4.2.3 on XP. After fighthing with the configuration files and the object mapping I achieved to execute.
Happy with the outcome, I launched to do a test in other platfom, in this case on linux to test if linux is faster that XP. I installed OpenSuse 11 and JBOSS for Linux , the same version as XP.
I deployed my ear file, and surprise!, I got the following error:
INFO: configuring from resource: /hibernate.cfg.xml
08:52:52,152 ERROR [STDERR] Nov 18, 2008 8:52:52 AM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
08:52:52,171 INFO [STDOUT] Warning: Caught exception attempting to use SAX to load a SAX XMLReader
08:52:52,171 INFO [STDOUT] Warning: Exception was: java.lang.ClassCastException: org.apache.xerces.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader
08:52:52,171 INFO [STDOUT] Warning: I will print the stack trace then carry on using the default SAX parser
08:52:52,171 ERROR [STDERR] java.lang.ClassCastException: org.apache.xerces.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader
08:52:52,172 ERROR [STDERR] at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
08:52:52,172 ERROR [STDERR] at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
08:52:52,172 ERROR [STDERR] at org.dom4j.io.SAXHelper.createXMLReader(SAXHelper.java:83)
08:52:52,172 ERROR [STDERR] at org.dom4j.io.SAXReader.createXMLReader(SAXReader.java:894)
08:52:52,172 ERROR [STDERR] at org.dom4j.io.SAXReader.getXMLReader(SAXReader.java:715)
08:52:52,172 ERROR [STDERR] at org.dom4j.io.SAXReader.read(SAXReader.java:435)
08:52:52,172 ERROR [STDERR] at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1518)
08:52:52,172 ERROR [STDERR] at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
08:52:52,172 ERROR [STDERR] at org.hibernate.cfg.Configuration.configure(Configuration.java:1448)
...
I think that there is a problem with a jar o a jar version when I read this message : java.lang.ClassCastException: org.apache.xerces.parsers.SAXParser cannot be cast to org.xml.sax.XMLReader
The fun facts is that the jboss is the same version and my ear is the same and is working in the other platform.
I wonder if anyone could give me a clue about it.
Meanwhile I am still checking the jars and testing if the root cause is the classloader. If I get the solution, I will post us.
Thanks in advance.
[ November 18, 2008: Message edited by: Paco Martin Duque ]