Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.io.IOException: org.apache.xml.serializer.ToXMLSAXHandler when deploying into Glassfish 2.1

 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

I have 2 war files which use Spring web services. When I deploy them into Tomcat 5.5 they work fine. However, in Glassfish one of them fails to work. I get the stack trace below. Some discussions on this problem seem to suggest that the xalan classes are interfering with each other but I have not been able to fix it. Any thoughts?

 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have sorted the problem out. This is what was happening: Glassfish has a jar called "webservices-rt.jar" and it contains some of the SOAP stuff. Furthermore, it loads this jar first which means that any subsequest classes that need the classes found in "webservices-rt.jar" then use the already loaded jar classes. In my apps I have "saaj-api-1.3.jar" and "saaj-impl-1.3.jar". I traced the classloader issue by enabling the JVM option -verbose:class and when I made a webservice request in my app I saw something like



I then appended my jars to the server Pre classpath and it now works. So as you can see I've been to Jar Hell and back ;) Happy coding!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic