Axis2
  1. Axis2
  2. AXIS2-5199

Deserialization of an array type property of a bean, while calling a web-service operation with an array of beans in the request, gives error

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.6.2, 1.7.0
    • Component/s: adb, client-api, databinding
    • Labels:
      None
    • Environment:
      ADB data-binding at client-side and and axis2 version is 1.6.0.

      Description

      I have described beans as follows:
      public class A implements Serializable

      { private String prop1; private Date prop2; private Integer prop3; private Double prop4; private B[] propArrayB; private C[] propArrayC; //getter and setter methods }

      public class B implements Serializable

      { private String prop1; private Date prop2; private Integer prop3; private Double prop4; //getter and setter methods }

      public class C implements Serializable { private String prop1; private Date prop2; private Integer prop3; private Double prop4; //getter and setter methods }

      I have implemented a web-service with an exposed operation as:
      public boolean saveAes(A[] aes, String token)

      The below line is giving an error, and finally a java.lang.StackOverflowError is thrown:
      org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:467)

      The error seems to be at the server-side before the object in SOAP request is deserialized into POJO. The web-service operation is not getting called (log statements within implemented 'init' method of org.apache.axis2.service.Lifecycle and the web-service operation are not seen).

      I am able to obtain request message from the MessageContext and the soap message structure of request message seems ok.

      I have another web-service operation in which sends a bean containing A[] in response. The above error is not seen in this case. So I think this issue is only when an array is sent to server packaged within a bean, and not when server is sending back a similar object in response.

      Regards,
      TAM Tenfold5

      1. Axis2Test.7z
        9.97 MB
        TAM Tenfold5

        Issue Links

          Activity

          Hide
          Sagara Gunathunga added a comment -

          Recently I have fixed a issue that something similar to this not sure this also got fix with it. (See https://issues.apache.org/jira/browse/AXIS2-5195)
          Can you download snapshot version from here https://builds.apache.org/view/A-F/view/Axis2/job/Axis2/ws/axis2/modules/distribution/target/ and test your sample again. If you will face same exception please attach all relevant server side source files in order to recreate this issue .

          Show
          Sagara Gunathunga added a comment - Recently I have fixed a issue that something similar to this not sure this also got fix with it. (See https://issues.apache.org/jira/browse/AXIS2-5195 ) Can you download snapshot version from here https://builds.apache.org/view/A-F/view/Axis2/job/Axis2/ws/axis2/modules/distribution/target/ and test your sample again. If you will face same exception please attach all relevant server side source files in order to recreate this issue .
          Hide
          TAM Tenfold5 added a comment - - edited

          Hello Sagara,

          https://issues.apache.org/jira/browse/AXIS2-5195 seems to be exactly describe the issue that I am facing currently.

          Error is thrown at below line infinitely, finally leading to java.lang.StackOverflowError:
          org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:467)

          AXIS2-5195 indicates that fix is present in version 1.6.2 and 1.7.0. So I would try to use the snapshot version and check if the issue exists.

          Regards,
          TAM Tenfold5, GDev.

          Show
          TAM Tenfold5 added a comment - - edited Hello Sagara, https://issues.apache.org/jira/browse/AXIS2-5195 seems to be exactly describe the issue that I am facing currently. Error is thrown at below line infinitely, finally leading to java.lang.StackOverflowError: org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:467) AXIS2-5195 indicates that fix is present in version 1.6.2 and 1.7.0. So I would try to use the snapshot version and check if the issue exists. Regards, TAM Tenfold5, GDev.
          Hide
          Sagara Gunathunga added a comment -

          Yes , AXIS2-5195 is already fixed in the trunk and 1.6.2 branch. Please try with snapshot version and let me know your results.

          Show
          Sagara Gunathunga added a comment - Yes , AXIS2-5195 is already fixed in the trunk and 1.6.2 branch. Please try with snapshot version and let me know your results.
          Hide
          Sagara Gunathunga added a comment -

          AXIS2-5195 already fixed this.

          Show
          Sagara Gunathunga added a comment - AXIS2-5195 already fixed this.
          Hide
          TAM Tenfold5 added a comment -

          The deserialization issue is fixed in 1.7.0 SNAPSHOT version. But before the response is generate below exception is thrown ->

          java.lang.NullPointerException
          at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:96)
          at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:391)
          at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:97)
          at org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:127)
          at org.apache.axis2.rpc.receivers.RPCUtil.processResponseAsDocLitWrapped(RPCUtil.java:533)
          at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:155)
          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:176)
          at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:163)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
          at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
          at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
          at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
          at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
          at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
          at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
          at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
          at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
          at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
          at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
          at java.lang.Thread.run(Thread.java:662)

          Show
          TAM Tenfold5 added a comment - The deserialization issue is fixed in 1.7.0 SNAPSHOT version. But before the response is generate below exception is thrown -> java.lang.NullPointerException at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:96) at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:391) at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:97) at org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:127) at org.apache.axis2.rpc.receivers.RPCUtil.processResponseAsDocLitWrapped(RPCUtil.java:533) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:155) 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:176) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:163) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:662)
          Hide
          Sagara Gunathunga added a comment -

          Is this exception occur with public boolean saveAes(A[] aes, String token) method or with new one ?

          I have tested again public boolean saveAes(A[] aes, String token) with following input message.

          <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:axis="http://axis5199.sample" xmlns:xsd="http://axis5199.sample/xsd">
          <soap:Header/>
          <soap:Body>
          <axis:saveAes>
          <axis:aes>
          <xsd:prop1>prop</xsd:prop1>
          <xsd:prop2>2011-12-15</xsd:prop2>
          <xsd:prop3>45</xsd:prop3>
          <xsd:prop4>42.3</xsd:prop4>
          <xsd:propArrayB>
          <xsd:prop1>prop</xsd:prop1>
          <xsd:prop2>2011-12-15</xsd:prop2>
          <xsd:prop3>56</xsd:prop3>
          <xsd:prop4>42.3</xsd:prop4>
          </xsd:propArrayB>
          <xsd:propArrayC>
          <xsd:prop1>prop</xsd:prop1>
          <xsd:prop2>2011-12-15</xsd:prop2>
          <xsd:prop3>67</xsd:prop3>
          <xsd:prop4>42.3</xsd:prop4>
          </xsd:propArrayC>
          </axis:aes>
          <axis:token>token</axis:token>
          </axis:saveAes>
          </soap:Body>
          </soap:Envelope>

          Can you provide input message you used and services.xml file of this service ?

          Show
          Sagara Gunathunga added a comment - Is this exception occur with public boolean saveAes(A[] aes, String token) method or with new one ? I have tested again public boolean saveAes(A[] aes, String token) with following input message. <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:axis="http://axis5199.sample" xmlns:xsd="http://axis5199.sample/xsd"> <soap:Header/> <soap:Body> <axis:saveAes> <axis:aes> <xsd:prop1>prop</xsd:prop1> <xsd:prop2>2011-12-15</xsd:prop2> <xsd:prop3>45</xsd:prop3> <xsd:prop4>42.3</xsd:prop4> <xsd:propArrayB> <xsd:prop1>prop</xsd:prop1> <xsd:prop2>2011-12-15</xsd:prop2> <xsd:prop3>56</xsd:prop3> <xsd:prop4>42.3</xsd:prop4> </xsd:propArrayB> <xsd:propArrayC> <xsd:prop1>prop</xsd:prop1> <xsd:prop2>2011-12-15</xsd:prop2> <xsd:prop3>67</xsd:prop3> <xsd:prop4>42.3</xsd:prop4> </xsd:propArrayC> </axis:aes> <axis:token>token</axis:token> </axis:saveAes> </soap:Body> </soap:Envelope> Can you provide input message you used and services.xml file of this service ?
          Hide
          TAM Tenfold5 added a comment - - edited

          Attaching a web project Axis2Test.7z created in Eclipse. The jars from 1.7.0 SNAPSHOT version are in the WEB-INF/lib folder. The client class is test.client.TestServiceTest. The exception can be seen while making a call to the web-service (test.TestService). Client side stub created using ADB data-binding.

          Regards,
          Tam Tenfold5

          Show
          TAM Tenfold5 added a comment - - edited Attaching a web project Axis2Test.7z created in Eclipse. The jars from 1.7.0 SNAPSHOT version are in the WEB-INF/lib folder. The client class is test.client.TestServiceTest. The exception can be seen while making a call to the web-service (test.TestService). Client side stub created using ADB data-binding. Regards, Tam Tenfold5
          Hide
          Marian Chlapecka added a comment -

          Hello,
          I had similar problem, but in version 1.7.0 the problem is resolved. I can send to server some object with any attribute which is array via Axis2.

          Show
          Marian Chlapecka added a comment - Hello, I had similar problem, but in version 1.7.0 the problem is resolved. I can send to server some object with any attribute which is array via Axis2.
          Hide
          Sagara Gunathunga added a comment -

          @TAM

          As I mentioned earlier I can invoke following method without any issue.

          public boolean saveAes(A[] aes, String token)

          Above method is smiler to GenericReturnDTO updateTimesheets(String token, TimesheetItem[] timesheets) and should work too.

          I'm getting some build issue with the project you shared also it contains lot of classes/configurations I don't have time to fix those build issues and debug your issue. If you still facing to same exception please create a simple project to reproduce this issue and attach here. I think single Java class with a service.xml file is enough for this.

          Show
          Sagara Gunathunga added a comment - @TAM As I mentioned earlier I can invoke following method without any issue. public boolean saveAes(A[] aes, String token) Above method is smiler to GenericReturnDTO updateTimesheets(String token, TimesheetItem[] timesheets) and should work too. I'm getting some build issue with the project you shared also it contains lot of classes/configurations I don't have time to fix those build issues and debug your issue. If you still facing to same exception please create a simple project to reproduce this issue and attach here. I think single Java class with a service.xml file is enough for this.
          Hide
          TAM Tenfold5 added a comment -

          Ok, let's call this issue resolved for now. I will test it with 1.6.2 once it releases and reopen the issue if need be.

          Thanks for the help extended.

          Regards.

          Show
          TAM Tenfold5 added a comment - Ok, let's call this issue resolved for now. I will test it with 1.6.2 once it releases and reopen the issue if need be. Thanks for the help extended. Regards.
          Hide
          Sagara Gunathunga added a comment -

          @TAM
          We have done lot of improvements for Axis2 POJO support recently targeting 1.7.0 release and most of them not available on 1,6 branch and will not ship with 1.6.2. My suggestion is test with 1.7.0-SNAPSHOT version and If you still having same issue provide a small sample (single Java class with a service.xml) to reproduce this issue that will help both of us to resolve this issue if it really exists. Your provided code is bit of a complex and just can't find enough time to look into it in near future.

          Show
          Sagara Gunathunga added a comment - @TAM We have done lot of improvements for Axis2 POJO support recently targeting 1.7.0 release and most of them not available on 1,6 branch and will not ship with 1.6.2. My suggestion is test with 1.7.0-SNAPSHOT version and If you still having same issue provide a small sample (single Java class with a service.xml) to reproduce this issue that will help both of us to resolve this issue if it really exists. Your provided code is bit of a complex and just can't find enough time to look into it in near future.

            People

            • Assignee:
              Sagara Gunathunga
              Reporter:
              TAM Tenfold5
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development