• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jboss e Hibernate sobre OpenSuse.

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Paco,

Could you please provide an english version of your question?
 
Paco Martin Duque
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

After fightting with the classes , I read that if you use Jboss you don't need to pack the hibernate classes in your .ear.
And until in Windows I have the hibernate classes and it run ok on Jboss, when I deploy my ear in linux-Jboss it doesn't work.

Finally the conclusion and the resume is that it's not necessary to pack the classes. In my pom.xml I use the following dependencies only for compiling:

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.1.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-testing</artifactId>
<version>3.3.1.GA</version>
<scope>provided</scope>
</dependency>
<!-- Add the required libraries that the hibernate distribution brings -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<!--<version>1.5.2</version>-->
<version>1.5.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.4.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.6</version>
<scope>provided</scope>
</dependency>
<!-- Java Transaction API -->
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.5.5</version>
<scope>provided</scope>
</dependency>

and it is working like a champion

Many thanks
 
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic