JBoss EAP 6.1中的验证器不接受StAXSource

时间:2013-12-10 11:32:22

标签: jboss xml-parsing jboss6.x xml-validation stax

在JBoss Server中验证StAXSource时发出问题,

我尝试了什么:
我尝试使用StAX一次进行解析和验证 如此example中所述。

我能够将程序作为独立应用程序执行,但当我在JBoss EAP 6.1服务器中尝试将其作为Web应用程序时,将其作为以下异常。

例外:

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)

从StAXSource到StreamSource修改了多个框架, TEIID-2046activiti ..等 我不确定,为什么JBoss不支持StAXSource,任何线索?

1 个答案:

答案 0 :(得分:3)

通过添加xercesImpl 2.11.0依赖项解决了问题。 (如forums_activiti中所述)

解决方案:添加xerces 2.11.0依赖关系。

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

<强>详细信息:
JBoss EAP 6.1具有Xerces 2.9.1-redhat-4,但在Xerces-J 2.10.0中发布了StaxSource增强功能(有关详细信息,请参阅JBoss EAP Component details)。
Xerces-J 2.10.0java.xml.validation实施了增强功能,并为JAXP验证器提供了StAXSource支持 enter image description here

更新:添加了Feature Request in JBoss EAP 1.6项目。

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