Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[higgins-dev] Problems running STS on Tomcat6 using JVM 1.6.x

Mike,
 
Working with Pam Dingle, we have discovered a problem running the STS on Tomcat6 using a 1.6.x JVM.
 
The root cause of the problem is that the 1.6.x JVM apparently has a built-in version of the javax.xml.stream.XMLOutputFactory class that is not the precisely compatible with the XMLOutputFactory class that we supply in the stax-api-1.0.1.jar file.  There is a subtle difference in what methods are available.  The stax-api-1.0.1.jar file has the following method:
 
   javax.xml.stream.XMLOutputFactory newInstance( String, ClassLoader);
 
while the one in the 1.6.x JVM (inside rt.jar) has the following method:
 
   javax.xml.stream.XMLInputFactory newInstance( String, ClassLoader);
 
Basically, the 1.6.x JVM version returns an XMLInputFactory object instead of an XMLOutputFactory object.
 
The axiom code expects to be able to call a newInstance method that returns an XMLOutputFactory object.  It is called called in the following stack:
 
   org.apache.axiom.om.util.StAXUtils.getXMLOutputFactory(StAXUtils.java:97)
   org.apache.axiom.om.util.StAXUtils.createXMLStreamWriter(StAXUtils.java:111)
   org.apache.axiom.om.impl.llom.OMNodeImpl.serialize(OMNodeImpl.java:381)
   org.eclipse.higgins.sts.utilities.XMLHelper.toDOM(XMLHelper.java:464)
   ...
 
but the method is not available in the 1.6.x version of the XMLOutputFactory class.  This is going to be a problem for folks running on a 1.6.x JVM, because the builtin XMLOutputFactory class takes precedence over the one in stax-api-1.0.1.jar when the JVM loads classes.
 
Sigh....
 
Any thoughts? or workarounds?  Anyone?
 
Daniel



Back to the top