We found a workable solution to our problem although we never really found the exact cause of the behavior.
Our fix: We downloaded Xalan 2.7.1-2 binaries which included a serializer jar and xerces-impl 2.9.0. In tomcat we create a shared libraries folder, added the folder path to the common loader in catalina.properties, and copied the xalan and serializer jars into it. We removed the xalan decency from our applications and updated our xerces-impl from 2.8.0 to 2.9.0 and rebuilt our applications. Now things are working as expected. Chuck Chuck Boehle wrote: > > I have two jdk 6 applications running in tomcat 6 under two different > context names. Both applications call the same api to connect to a web > service. The strange thing is, if I run one application first, everything > is fine, but when I run the 2nd application I get an exception. If I > restart tomcat and call the other application first it works but now the > other one doesn't work. > > I have traced it down to the SerializerFactory in XALAN 2.7 where I see > this code... > > Class cls = ObjectFactory.findProviderClass(className, loader, true); > > ...the Class that gets created here for my app is a ToXMLStream class. > The first application to run returns the ToXMLStream class that IS an > instance of SerializationHandler and things run fine. The 2nd app to run > returns a ToXMLStream class that IS NOT an instance of > SerializationHandler but IS an instance of ContentHandler. It then > attempts to load the class org.apache.xml.serializer.ToXMLSAXHandler and > tries to cast a new instance of this object to a SerializationHandler. At > this point I get a class cast exception. > > Once again if I switch the order of apps that run first the same thing > happens, so it is not app specific, it has to do with the order of the > applications. Has anyone run across a scenario like this before? > > > -- View this message in context: http://www.nabble.com/XALAN-in-Tomcat-6-and-JDK-6-oddity-tp23488528p23524206.html Sent from the Xalan - J - Users mailing list archive at Nabble.com.