WF20 to WF26 Xerces classpath issue

182 views
Skip to first unread message

Burt Repine

unread,
Mar 23, 2023, 5:22:44 PM3/23/23
to WildFly
I'm running into an issue in WF 26 where Im getting a mix of classes from 2 different Xerces libraries - the JDK one (com.sun.org.apache.xerces) and the WF system module one  (org.apache.xerces).
This is resulting in the following:

class org.apache.xerces.dom.ElementNSImpl cannot be cast to class com.sun.org.apache.xerces.internal.dom.NodeImpl (org.apache.xerces.dom.ElementNSImpl is in unnamed module of loader 'org.apac...@2.12.0.SP03' @1700d16; com.sun.org.apache.xerces.internal.dom.NodeImpl is in module java.xml of loader 'bootstrap')

Id like to exclude the JDK Xerces library. Is that possible to do at the server level? Or thru the jboss-deployment-structure.xml?

Thank you,
Burt

Richard Opalka

unread,
Mar 24, 2023, 3:37:39 AM3/24/23
to Burt Repine, WildFly
Hello Burt,

   Without the stack trace it is hard to provide a good answer.
Does your exception come from WildFly components or from your application code?
Do you include Xerces implementation in your application?
Just FYI JDK Xerces implementation is preferred over to Xerces implementation.

Rio


--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/7124db74-071e-452a-99b7-2ded9750cd4cn%40googlegroups.com.

Burt Repine

unread,
Mar 24, 2023, 12:25:15 PM3/24/23
to WildFly
Thanks Rio, the stack trace is of no use because the ClassCastException I showed in the post is swallowed in the Xerces code and null is returned.
I'm surprised that the JDK Xerces lib is preferred since I believe it's been removed in Java 11?

Richard Opalka

unread,
Mar 24, 2023, 3:05:33 PM3/24/23
to Burt Repine, WildFly
Hello Burt,

It was refactored but not removed in JDK11.
The xerces fork is still alive in recent OpenJDK upstream,

Rio

Burt Repine

unread,
Mar 24, 2023, 7:57:12 PM3/24/23
to WildFly
Thanks Rio I think I may have been confusing the Xerces lib with the JAXB one...
Reply all
Reply to author
Forward
0 new messages