axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yiman Wang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AXIS2-5426) ArrayIndexOutOfBoundsException in BeanUtil.deserialize()
Date Tue, 12 Mar 2019 07:34:00 GMT

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

Yiman Wang commented on AXIS2-5426:
-----------------------------------

Hi, I am also facing the same issue using Axis2-1.7.6,CXF. Did you resolve this issue?

> 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
>            Priority: Major
>              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
(v7.6.3#76005)

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


Mime
View raw message