is there any way that i can get the correct xalan at runtime?

to recap this is the code that is blowing up for me:
Reader xsl = new InputStreamReader(filepath.openStream());
TransformerFactory transformerfactory = TransformerFactory.newInstance();
StreamSource ssXsl = new StreamSource(xsl);
Templates templates = transformerfactory.newTemplates(ssXsl);
Transformer transformer = templates.newTransformer();

last line causes:
java.lang.ClassCastException: org.apache.xml.dtm.ref.DTMManagerDefault cannot be cast to org.apache.xml.dtm.DTMManager
    at org.apache.xml.dtm.DTMManager.newInstance(
    at org.apache.xpath.XPathContext.<init>(
    at org.apache.xpath.XPathContext.<init>(
    at org.apache.xpath.XPathContext.<init>(
    at org.apache.xalan.transformer.TransformerImpl.<init>(     at org.apache.xalan.templates.StylesheetRoot.newTransformer(

maybe you know some way to find the Impl with the correct DTMManager?

On 30/11/2017 17:30, Romain Manni-Bucau wrote:
2017-11-30 16:51 GMT+01:00 Jeremy Boynes <>:
On Nov 30, 2017, at 3:14 AM, Matthew Broadhead <> 

has anything been decided?  if i try to redeploy a context in production all my 
xslt processors blow up.  there should be a solution that fits all?
Taglibs (both Apache and Glassfish) has always had a dependency on Xalan. My 
understanding is that TomEE did not include it and so broke users that use the 
XML tags. If so, TomEE should fix that.
Sadly this is not a bug on tomee but the best solution we went through
after having delivered xalan for some releases. Xalan dependency
breaks 80% of apps so no way to include it - and this is the issue of
Matthew. Note it also affects simple apps in tomcat including taglib
and other libs.

You can probably add Xalan to your TomEE installation somehow to work around it 
but how to do that is really a question for the TomEE users list.

A patch for Taglibs that removes the Xalan dependency and doesn't regress the 
#27717 performance fix would be great. A patch that removed the dependency but 
regressed performance would have to be evaluated at the time. The previous 
decision was not to do that.

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to