XML Implementation issues
Brent Putman
putmanb at georgetown.edu
Wed Aug 10 12:02:47 EDT 2016
On 8/9/16 11:51 AM, Massimiliano Masi wrote:
> Hi All,
>
> I am running java 1.8 and wildfly 9. I have some issues with the DOM
> implementation, opensaml 2.6.1.
>
You know that OpenSAML 2.x is completely unsupported and EOL as of July
31, right? But the problems/solutions here will be the same as for
OpenSAML 3, so ...
> My soap message is handled by saaj. When I get the SOAP header, and I
> unmarshall it, the DOM is
>
> com.sun.xml.messaging.saaj.soap.impl.ElementImpl
>
I'm not personally familiar with SAAJ. But I'm assuming that the way
that you received the SOAP XML and parsed it to a DOM is not via our
ParserPool, etc, but rather using some mechanism specific to SAAJ . I
suspect therein lies the problem (indirectly).
>
>
>
> 2016-08-09 17:46:38,515 INFO [stdout] I got an exception. My
> implementation is: class org.apache.xerces.dom.NodeImplfrom:
> jar:file:/opt/bin/jboss1/modules/system/layers/base/com/main/xercesImpl-debug.2.9.1.jar!/
> 2016-08-09 17:46:38,515 INFO [stdout] Their implementation is: class
> com.sun.xml.messaging.saaj.soap.impl.ElementImplfrom:
> vfs:/opt/conf/jboss1/deployments/mydep.ear/lib/saaj-impl.jar
> 2016-08-09 17:46:38,515 ERROR [stderr] java.lang.ClassCastException:
> com.sun.xml.messaging.saaj.soap.impl.ElementImpl cannot be cast to
> org.apache.xerces.dom.NodeImpl
> 2016-08-09 17:46:38,515 ERROR [stderr] at
> org.apache.xerces.dom.CoreDocumentImpl.adoptNode(CoreDocumentImpl.java:1760)
> 2016-08-09 17:46:38,515 ERROR [stderr] at
> org.opensaml.xml.util.XMLHelper.adoptElement(XMLHelper.java:545)
>
It would seem that the root cause problem here is that the Apache
Xerces DOM classes don't support adopting Nodes from a different DOM
impl. The message seems to imply that it's trying to unconditionally
cast the passed-in to-be-adopted Node to a Xerces NodeImpl, and it's not.
> (
>
> Now, I really don’t know how to proceed. Any hints on aligning the
> DOM implementations? Before, with java6 and
> jboss4, I was used to the endorsing mechanism, but in java8 +
> wildfly9 it does not seem to have any effect.
I don't have any concrete ideas. The OpenSAML core code doesn't know
about or have special handling to deal with the specifics or
peculiarities of any particular DOM impl. We use the standard DOM API,
period. So this is an "environmental" problem. I'm not familiar with
Wildfly or SAAJ, so I can't give you specific suggestions unfortunately.
>
> Setting the system property on the DocumentBuilderFactory makes
> wildfly unhappy (ClassNotFoundExceptions).
>
That sounds like a good avenue to pursue. The CNFE's might be solvable
with classpath adjusting. Or, figure out if it's possible to have SAAJ
use the standard built-in Oracle Java Xerces impl, rather than whatever
it's currently using.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20160810/f72b7ba7/attachment.html>
More information about the dev
mailing list