2

我是这个网站的新手。在听到我的朋友说这个网站实际上会帮助我在技术上成长后,现在才订阅。

我报告了以下问题:

我的应用程序是这样开发的,它必须命中 5 个外部服务(Web 服务调用)进行处理。这些服务是使用axis2 存根调用的。

我的应用程序作为企业应用程序部署在 glassfish 应用程序服务器 2.1 版中。

处理进行得很好,但某些请求的 web 服务请求失败(即)失败,每 1000 个请求有 20 个请求失败,并出现以下错误。

在axis2 trace中发现的错误日志如下:

2012-04-19 15:42:10,328 DEBUG org.apache.axiom.om.util.StAXUtils - XMLStreamReader is com.sun.xml.stream.XMLReaderImpl
2012-04-19 15:42:10,326 DEBUG org.apache.axis2.description.ParameterIncludeImpl - ==================
2012-04-19 15:42:10,328 DEBUG org.apache.axis2.description.ParameterIncludeImpl -  Parameter add on object org.apache.axis2.description.ParameterIncludeImpl@3ee78dcc
2012-04-19 15:42:10,328 DEBUG org.apache.axis2.description.ParameterIncludeImpl -   Key =enableMTOM
2012-04-19 15:42:10,328 DEBUG org.apache.axis2.description.ParameterIncludeImpl -   Value =false
2012-04-19 15:42:10,328 DEBUG org.apache.axis2.description.ParameterIncludeImpl -   Value Class = java.lang.String
2012-04-19 15:42:10,328 DEBUG org.apache.axis2.description.ParameterIncludeImpl -   Value Classloader = null
2012-04-19 15:42:10,328 ERROR webServiceRequestConnector - Exception >>> webServiceRequestConnector.postRequest() >>> Interface Request >>> 3652467 >>> Exception Message is >>> 
java.lang.ArrayIndexOutOfBoundsException: -1
    at com.sun.xml.stream.xerces.util.NamespaceSupport.popContext(NamespaceSupport.java:223)
    at com.sun.xml.stream.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:359)
    at com.sun.xml.stream.XMLReaderImpl.setInputSource(XMLReaderImpl.java:207)
    at com.sun.xml.stream.ZephyrParserFactory.getXMLStreamReaderImpl(ZephyrParserFactory.java:291)
    at com.sun.xml.stream.ZephyrParserFactory.createXMLStreamReader(ZephyrParserFactory.java:173)
    at com.sun.xml.stream.ZephyrParserFactory.createXMLStreamReader(ZephyrParserFactory.java:156)
    at org.apache.axiom.om.util.StAXUtils$2.run(StAXUtils.java:137)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.axiom.om.util.StAXUtils.createXMLStreamReader(StAXUtils.java:133)
    at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:596)
    at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:581)
    at org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBuilder.java:97)
    at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:86)
    at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:641)
    at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:116)
    at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:68)
    at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:184)
    at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:150)
    at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:143)
    at QueryScoreStub.<init>(QueryScoreStub.java:91)
    at QueryScoreStub.<init>(QueryScoreStub.java:77)
    at QueryScoreStub.<init>(QueryScoreStub.java:125)
    at QueryScoreStub.<init>(QueryScoreStub.java:117)
    at webServiceRequestConnector.handleService(webServiceRequestConnector.java:1014)
    at webServiceRequestConnector.postRequest(webServiceRequestConnector.java:173)
    at FinalInterface.receiveResponse(FinalInterface.java:76)
    at ExtConnectionManager.processRequest(ExtConnectionManager.java:88)
    at ExtConnectionManager.processRequest(ExtConnectionManager.java:112)
    at InterfaceWorkflowExecutor.call(InterfaceWorkflowExecutor.java:242)
    at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:178)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
    at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
    at java.lang.Thread.run(Thread.java:595)

不知道为什么仅对某些请求就失败了。

从互联网上阅读了以下内容:

  1. Glassfish 有一个名为 webservice-rt.jar 的 jar,它在调用 web 服务时使用它。
  2. 此错误在 popContext() 方法内的 NamespaceSupport 类中引发。
  3. 此外,此错误可能是由于尝试 popContext 而不首先调用 pushContext 方法。

除了上述之外,找不到其他帮助。

谁能帮我解决一下到底是什么问题?

此外,在 5 项服务中,不仅仅是一项服务失败。有时 2 个服务失败,有时 1 个服务失败,有时 3 个服务失败。

因此,我怀疑问题出在外部服务上。:( :(

4

1 回答 1

1

此问题可能与AXIOM-74有关。将 Woodstox 打包到您的应用程序中,它可能会消失。

于 2012-07-24T20:17:19.507 回答