从我在glassfish服务器中部署的应用程序调用webservice时出现ArrayIndexOutOfBoundsException

时间:2012-07-24 10:06:52

标签: java web-services glassfish axis2

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

我报告了以下问题:

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

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

处理进展顺利但某些请求的webservice请求失败(即)失败,每1000个请求发生以下错误,20个请求失败。

在axis2跟踪中找到的错误日志如下:

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,它在调用webservice时使用它。
  2. 此错误在popContext()方法内的NamespaceSupport类中抛出。
  3. 此外,此错误可能是由于尝试使用popContext而不先调用pushContext方法。
  4. 除上述情况外,无法确定其他任何帮助。

    有人可以帮我解决究竟是什么问题吗?

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

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

1 个答案:

答案 0 :(得分:1)

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