You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "abhijit jana (JIRA)" <ji...@apache.org> on 2017/11/28 12:14:00 UTC

[jira] [Commented] (AXIS2-5426) ArrayIndexOutOfBoundsException in BeanUtil.deserialize()

    [ https://issues.apache.org/jira/browse/AXIS2-5426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16268642#comment-16268642 ] 

abhijit jana commented on AXIS2-5426:
-------------------------------------

Hi I am also facing same issue using Axis2-1.7.0,Rampart-1.7.0  what needs to be done in order to resolve this issue?


java.lang.ArrayIndexOutOfBoundsException: 1
	at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:802)
	at org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:197)
	at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:250)
	at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:121)
	at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
	at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:106)
	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:169)
	at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:176)
	at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:163)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)

> ArrayIndexOutOfBoundsException in BeanUtil.deserialize()
> --------------------------------------------------------
>
>                 Key: AXIS2-5426
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5426
>             Project: Axis2
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.6.2
>            Reporter: Robert Jäschke
>              Labels: ArrayIndexOutOfBoundsException
>
> Using Axis2 I have created Java stubs for the Amazon Mechanical Turk WSDL and implemented the server and client side. Now upon receiving a SOAP message, I get an ArrayIndexOutOfBoundsException on the server side:
> [2012-09-19 17:26:32,907] [DEBUG] [org.apache.axis2.client.Options] - setAction Old action is (null)
> [2012-09-19 17:26:32,907] [DEBUG] [org.apache.axis2.client.Options] - setAction New action is (urn:createHITResponse)
> [2012-09-19 17:26:32,907] [DEBUG] [org.apache.axis2.context.ConfigurationContext] - OnDemandLogger initialized for class org.apache.axis2.context.ConfigurationContext is:org.apache.commons.logging.impl.Log4JLogger@1e34f445
> [2012-09-19 17:26:32,907] [DEBUG] [org.apache.axis2.context.ConfigurationContext] - messageID is null.
> [2012-09-19 17:29:17,286] [ERROR] [org.apache.axis2.rpc.receivers.RPCMessageReceiver] - 1
> java.lang.ArrayIndexOutOfBoundsException: 1
> 	at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:630)
> 	at org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:153)
> 	at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:206)
> 	at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
> 	at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
> 	at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
> 	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
> 	at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
> 	at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
> [...]
> This happens at this code position in BeanUtil.deserialize():
>        while ((parameterNames != null) &&
>                    (!omElement.getQName().getLocalPart().startsWith("arg")) &&
>                    (!omElement.getQName().getLocalPart().startsWith("item")) &&
>                    !omElement.getQName().getLocalPart().equals(parameterNames[count])) {
>                 // POJO handles OMElement in a differnt way so need this check for OMElement
>                 Class paramClassType = (Class) javaTypes[count];
>                 if (!paramClassType.getName().equals(OMElement.class.getName())) {
>                     count++;
>                 } else {
>                     break;
>                 }
>             }
> The access to parameterNames[count] in the while loop is causing the ArrayIndexOutOfBoundsException because count is increased beyond the array's size in the following if statement. In my case the value of paramClassType is "com.amazonaws.mturk.requester.doc._2012_03_25.CreateHIT" and not "org.apache.axiom.om.OMElement" and hence the check fails.
> Is this an error in Axis2 or am I doing something wrong? Actually, I have not modified the generated code (it's automatically re-generated by Maven anyway) so I would expect that I can't do anything wrong to this respect.
> (To be honest, I had to change something: I am doing
> client._getServiceClient().getOptions().setProperty(org.apache.axis2.Constants.Configuration.DISABLE_SOAP_ACTION, org.apache.axis2.Constants.VALUE_TRUE);
> because otherwise the client sends a SOAPAction HTTP header with the value "http://soap.amazon.com/" which causes the server not to find the action. My setup is "weird" in the sense that I am not just programming the client that shall work against Amazon Mechanical Turk but I have also implemented the server side myself and thus I am using http://localhost:4321/axis/services/amt as endpoint and not amazon.com.)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org