【问题标题】:Why is taking too long to respond to Websphere the first time I invoke a SOAP Web Service (JAX-WS)?为什么在我第一次调用 SOAP Web 服务 (JAX-WS) 时响应 Websphere 需要很长时间?
【发布时间】:2016-07-07 21:10:22
【问题描述】:

我使用的是 Websphere 8.5.5,并且我注意到我对 JAX-WS Web 服务的第一次调用需要很长时间才能响应。我在 LOG(跟踪级别)中得到了这个,15 分钟后它就可以工作了。我有 EclipseLink MOXy 作为 JAXB 提供程序

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.]

【问题讨论】:

    标签: jaxb websphere jax-ws moxy


    【解决方案1】:

    好吧,经过大量研究后,我发现它似乎是 Websphere 的一个错误,因为它向 JAXB 上下文添加了一些数组类,例如 (byte[], int[], String[]) 问题是当它将 String[] 添加到 JAXB 上下文的类列表中时,MOXy 无法处理并给出该错误。

    好消息是它可以通过将自定义属性添加到“通用​​ JVM 参数”中来解决,因为 Websphere >= 8.5.5.2

    服务器 > 服务器类型 > WebSphere 应用程序服务器 > server_name > 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
    

    [7/7/16 16:34:28:908 CDT] 00000089 JAXBContextTr 3 org.apache.axis2.jaxws.message.databinding.JAXBUtils getJAXBContext 新的 JAXBContext 构造,经过的时间毫秒:1035

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-04-24
      • 2019-04-15
      • 1970-01-01
      • 1970-01-01
      • 2017-02-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多