2012-06-27 49 views
0

我只是想知道當我嘗試部署Spring Web服務(jax-ws)應用程序時,與Jboss和xerces jar文件有衝突。這是錯誤。Jboss xml解析器與xerces衝突

09:58:50,852 ERROR [JBossContextConfig] XML error parsing: context.xml 
org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser 

經過一些技術論壇,發現這是一個在jboss服務器中的錯誤。 這是該錯誤報告的link。它說從lib文件夾中刪除xercec.jar。

但是,如果我刪除xerces jar,服務器會彈出錯誤信息,因爲我認爲我的應用程序需要xcerces jar來解析applicationContext.xml中的某些特定xml sysntaxes。這是春天的錯誤。

09:14:38,175 ERROR [org.springframework.web.context.ContextLoader] Context 
initialization failed: org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 
'com.sun.xml.ws.transport.http.servlet.SpringBinding#0 defined in ServletContext 
resource [/WEB-INF/applicationContext.xml]: Cannot create inner bean '(inner bean)' 
of type [org.jvnet.jax_ws_commons.spring.SpringService] while setting bean property 
'service'; nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name '(inner bean)': FactoryBean threw exception on object 
creation; nested exception is java.lang.LinkageError: loader constraint violation: when  
resolving field "DATETIME" the class loader (instance of 
org/jboss/classloader/spi/base/BaseClassLoader) of the referring class, 
javax/xml/datatype/DatatypeConstants, and the class loader (instance of <bootloader>) 
for the field's resolved type, loader constraint violation: when resolving field 
"DATETIME" the class loader 

它包含以下xml sysntax。

<wss:service> 
     <ws:service bean="#helloWs"/> 
</wss:service> 

我認爲服務器拋出,因爲jboss的XML解析器可能無法識別這個特定的XML sysntax其中涉及創建春天內部bean(豆=「#helloWs」)春天錯誤。所以我認爲使用xercess xml解析器覆蓋現有的Jboss xml解析器將會有所斬獲。我的問題是如何做到這一點?對這個問題的任何替代建議也是受歡迎的。

感謝所有提前。

供參考:相同的應用程序在glassfish服務器3.x中順利運行(沒有任何修改)但是我需要在Jboss服務器中部署它。

回答

1

我也遇到過這個問題。在我的情況下,解決方案是從我的應用程序中刪除Xerces,但你需要它。

可以找到另一種解決方法「從應用程序中除去xercers」here

+0

嗨,我嘗試了替代解決方案,並做了類加載配置。現在我得到了那個春天的內部bean異常。我已經使用xfire插件及其工作實現了相同的應用程序。我不知道這個錯誤的原因是什麼。感謝您的建議。 –

+0

終於我找到了那個彈簧錯誤的解決方案。我已經從lib目錄除去一些額外的廣口瓶中。(Jaxen的-1.1-β-9 STAX-API-1.0.1 STAX-API-1.0-2 STAX-utils的-20040917 WSDL4J-1.6.1 xbean- 2.2.0 xercesImpl xmlParserAPIs-2.2.6.2 XmlSchema-1.1)現在它的工作:)謝謝你的提示! –