Xalan gotcha with OpenSSO on Tomcat on Ubuntu Feisty
I’ve been meaning to blog about this for a while, but haven’t been able to scrape together a few minutes. Anyway, if you’ve been reading Superpatterns for a while you’ll know that I use Tomcat on Ubuntu to run OpenSSO. I wrote a little while ago about some problems with Tomcat in Ubuntu 7.04 ‘Feisty Fawn’ - Ubuntu hanging at startup due to issues with catalina.out and security policy needing to be updated due to a change in where Tomcat keeps web applications on disk.
Another issue I’ve seen is the following stack trace when parsing XML:
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:119)
com.sun.identity.shared.xml.XMLUtils.print(XMLUtils.java:674)
com.sun.identity.saml.assertion.Assertion.parseAssertionElement(Assertion.java:191)
com.sun.identity.saml.assertion.Assertion.<init>(Assertion.java:147)
com.sun.identity.wsfederation.profile.RequestSecurityTokenResponse.<init>(RequestSecurityTokenResponse.java:131)
com.sun.identity.wsfederation.profile.RequestSecurityTokenResponse.parseXML(RequestSecurityTokenResponse.java:62)
com.sun.identity.wsfederation.servlet.RPSigninResponse.process(RPSigninResponse.java:93)
com.sun.identity.wsfederation.servlet.WSFederationServlet.doPost(WSFederationServlet.java:143)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
[...]</init></init>
A quick Google turns up this blog entry from Andrew Beacock in the UK. The issue is that, previously, Xalan was included in JDK 1.4, but since then, the Apache community has chosen XSLTC as the default processor for developing XSLT 2.0, and JDK 1.5 followed suit for JAXP 1.3. I’m running Tomcat on Sun’s 1.5.0_11-b03 JVM, hence the missing TransformerFactoryImpl. The bottom line is this: grab Xalan for yourself and put it in your web app’s WEB-INF/lib directory.
If you’re working with OpenSSO, you can just copy xalan.jar, xercesImpl.jar, xml-apis.jar and serializer.jar from Xalan to opensso/products/extlib, rebuild the OpenSSO WAR and you should be good to go.
And, again, before anyone asks “Why aren’t you using Glassfish?” - I am, I’m just using Tomcat as well, since a lot of the OpenSSO contributors use it. Their pain is my pain
Comments
anjan bacchu
Hi there,
nice tip.
Why doesn’t OpenSSO use the XSLT support that is available in the JDK ?
BR,
~A
Pat Patterson
Hi Anjan, Xalan was there in JDK 1.4 in javax.xml.transform etc, so, like others, we used it directly. Now that we are officially moving the server code to JDK 1.5, we will look at migrating.
Leave a Comment
Your email address will not be published. Required fields are marked *