2016-07-07 28 views
0

我使用的是Websphere 8.5.5,我注意到我第一次調用JAX-WS Web服務需要很長的時間來響應。我在LOG(跟蹤級別)得到這個,在15分鐘後它可以工作。我的EclipseLink莫西作爲JAXB提供第一次調用SOAP Web服務(JAX-WS)時,爲什麼要花太長時間來響應Websphere?

jaxb.properties:

javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory 

javax.xml.bind.JAXBException:

Exception Description: Name collision. Two classes have the XML type with uri http://www.w3.org/2001/XMLSchema and name string. 
- with linked exception: 
[Exception [EclipseLink-50007] (Eclipse Persistence Services - 2.4.2.qualifier): org.eclipse.persistence.exceptions.JAXBException 
Exception Description: Name collision. Two classes have the XML type with uri http://www.w3.org/2001/XMLSchema and name string.] 

回答

0

好了,經過了大量的研究,我的發現它似乎是Websphere的一個bug,因爲它向JAXB上下文添加了一些數組類,例如(byte [],int [],String []),問題是當它將String []添加到列表時的課程r MOXy無法處理JAXB上下文並提供該錯誤。

好消息是,它可以通過添加自定義屬性到「通用JVM參數」來解決由於WebSphere> = 8.5.5.2

服務器>服務器類型> WebSphere應用程序服務器>服務器名稱> Java和進程管理>進程定義> Java虛擬機 >通用JVM參數

-Dcom.ibm.websphere.webservices.jaxwsOptimizeLevelOne=true 

在下面的資源不說,它確實是,但檢查後在EclipseLink中創建JAXBContext,你可以看到它不再發送那些數組類來解決問題。在此

更多信息:

https://publib.boulder.ibm.com/httpserv/cookbook/WebSphere_Application_Server-WAS_Classic-Web_Services.html

http://www-01.ibm.com/support/docview.wss?uid=swg1PI14203

日誌跟蹤檢測需要花費多少時間在WebSphere創建的JAXBContext可以激活指定此日誌級別:

com.ibm.ws.websvcs.JAXBContextTrace=all 

[16年7月7日的16:34:28:908 CDT] 00000089 JAXBContextTr 3個 org.apache.axis2.jaxws.message.databinding.JAXBUtils getJAXBContext構造 新的JAXBContext,經過時間毫秒:1035

相關問題