ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration when packaging xerces in application in JBoss EAP 5.1.2 and 5.2.0

Solution Verified - Updated -

Issue

  • Upgrading to JBoss EAP 5.1.2 or 5.2.0, one of our applications packages xerces.jar but does not package xalan.jar. It looks like the CXF we are packaging is using the xalan in JBoss which is using the xerces in JBoss instead of in our application and causes the ClassCastException below:
Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
    at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
    at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
    at org.apache.xml.utils.XMLReaderManager.getXMLReader(XMLReaderManager.java:81)
    at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:437)
    at org.apache.cxf.interceptor.AbstractLoggingInterceptor.writePayload(AbstractLoggingInterceptor.java:113)
    at org.apache.cxf.interceptor.LoggingInInterceptor.logging(LoggingInInterceptor.java:140)
    ... 33 more

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 5.2.0
    • 5.1.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content