Hi Brent,
Thanks for the answer.
>> 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).
>
Exactly. The message is parsed to a DOM by SAAJ, which it seems to load directly the com.sun.org.apache… implementation.
>
>>
>>
>>
>> 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!/ <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.
I am confused now. I always been told to always use xerces through the endorsing mechanism. Is it still the case with java8? This error of “DOM Element node adoption failed” throw
by xmltooling is a longstanding fact, and you actually have you the xmltooling the explicit check.
>
>> (
>>
>> 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.
What I found is that, once parsed, the Assertion (or in general XMLObject) object has a getDOM() method. What is the aim of that? It seems to retain the original DOM implementation!
In fact, in http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f on line 542, the code:
public static void <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#>adoptElement <>(Element <http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/org/w3c/dom/Element.java#Element> adoptee, Document <http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/org/w3c/dom/Document.java#Document> adopter) {
544 <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#544> <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#> if (!(adoptee.getOwnerDocument <http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/org/w3c/dom/Node.java#Node.getOwnerDocument%28%29>().equals <http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/lang/Object.java#Object.equals%28java.lang.Object%29>(adopter))) {
545 <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#545> <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#> if (adopter.adoptNode <http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/org/w3c/dom/Document.java#Document.adoptNode%28org.w3c.dom.Node%29>(adoptee) == null) {
546 <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#546> <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#> // This can happen if the adopter and adoptee were produced by different DOM implementations
547 <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#547> <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#> throw new XMLRuntimeException <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/XMLRuntimeException.java#XMLRuntimeException>("DOM Element node adoption failed");
548 <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#548> <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#> }
549 <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#549> <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#> }
550 <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#550> <http://grepcode.com/file/repo1.maven.org/maven2/org.opensaml/xmltooling/1.4.1/org/opensaml/xml/util/XMLHelper.java?av=f#> }
We have “adopter" which seems to be the Assertion.getDOM() while the adoptee is the new element created by xerces. What is exactly returning the getDOM()? HOw is it generated?
--
Anger is a gift, http://www.mascanc.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20160810/917c4b0c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/dev/attachments/20160810/917c4b0c/attachment-0001.gif>