Search code examples
jbossxml-parsingjboss6.xxml-validationstax

StAXSource not accepted by validator in JBoss EAP 6.1


Issue while Validating StAXSource in JBoss Server,

What I Tried:
I try to do parsing and validation at a time using StAX.
As described in this example.

I am able to execute the program as standalone application,
but when I try it as a web application in JBoss EAP 6.1 server got below exception.

Exception:

java.lang.IllegalArgumentException: Source parameter of type      
javax.xml.transform.stax.StAXSource' is not accepted by this validator.
at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source)

There are multiple frame works modified from StAXSource to StreamSource, TEIID-2046, activiti..etc.
I am not sure, Why JBoss is not supporting StAXSource, any clues?


Solution

  • Issue got resolved by adding xercesImpl 2.11.0 dependency. (as mentioned in forums_activiti)

    Solution: add xerces 2.11.0 dependency.

    <dependency>         
       <groupId>xerces</groupId>         
       <artifactId>xercesImpl</artifactId>
       <version>2.11.0</version>
    </dependency>
    

    Details:
    JBoss EAP 6.1 has Xerces 2.9.1-redhat-4, but StaxSource enhancement released in Xerces-J 2.10.0 (For more details refer JBoss EAP Component details).
    Xerces-J 2.10.0 has implementation enhancement for java.xml.validation and supporting StAXSource for JAXP validator.
    enter image description here

    Update: Added Feature Request in JBoss EAP 1.6 project.

    References:
    http://comments.gmane.org/gmane.comp.apache.commons.general/1770
    http://xerces.apache.org/xerces2-j/
    http://people.apache.org/~edwingo/jaxp-faq.html