Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5190

Throwing ArrayStoreException on construction of URI List

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.6.1
    • Fix Version/s: None
    • Component/s: databinding
    • Labels:
      None
    • Environment:
      Windows 7, 64-bit; Java 1.6.0_24; Tomcat 7.0.8

      Description

      This stacktrace is generated on the client side when constructing Java classes by parsing xml data

      org.apache.axis2.databinding.utils.ConverterUtil$ObjectConversionException: java.lang.ArrayStoreException
      at org.apache.axis2.databinding.utils.ConverterUtil.ConvertToArbitraryObjectArray(ConverterUtil.java:1211)
      at org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(ConverterUtil.java:1172)
      at au.gov.business.ablis._2011_09.data.ServiceType$Factory.parse(ServiceType.java:3864)
      at au.gov.business.ablis._2011_09.messages.contentmanagement.RequestItemChoice_type0$Factory.parse(RequestItemChoice_type0.java:1202)
      at au.gov.business.ablis._2011_09.messages.contentmanagement.RequestItem_type0$Factory.parse(RequestItem_type0.java:463)
      at au.gov.business.ablis._2011_09.messages.contentmanagement.ManageContentRequest$Factory.parse(ManageContentRequest.java:544)
      at com.geometryit.blis.production.Publish.publishLicenceUsingWebService(Publish.java:762)
      .. 21 more (mainly tomcat portion of stacktrace, excluded for brevity)
      Caused by: java.lang.ArrayStoreException
      at java.lang.System.arraycopy(Native Method)
      at java.util.ArrayList.toArray(ArrayList.java:306)
      at org.apache.axis2.databinding.utils.ConverterUtil.ConvertToArbitraryObjectArray(ConverterUtil.java:1207)
      ... 27 more

      The section of code that creates the Java classes follows:

      757 StringReader in = new StringReader( xmlString );
      758 XMLStreamReader reader = StAXUtils.createXMLStreamReader( in );
      759
      760 try
      761

      { 762 ManageContentRequest.Factory.parse( reader ); 763 }


      764 catch ( Exception e )
      765

      { 766 this.log.error( xmlString ); 767 this.log.info( e.getLocalizedMessage(), e ); 768 e.printStackTrace(); 769 }

      The portion of the Java-Axis2 class that is involved in the stacktrace is

      java.util.ArrayList list25 = new java.util.ArrayList();

      // Process the array and step past its final element's end.
      list25.add(reader.getElementText());

      //loop until we find a start element that is not part of this array
      boolean loopDone25 = false;

      while(!loopDone25){
      // Ensure we are at the EndElement
      while (!reader.isEndElement())

      { reader.next(); }

      // Step out of this element
      reader.next();

      // Step to next element event.
      while (!reader.isStartElement() && !reader.isEndElement())
      reader.next();

      if (reader.isEndElement())

      { //two continuous end elements means we are exiting the xml structure loopDone25 = true; }

      else {
      if (new javax.xml.namespace.QName("http://ablis.business.gov.au/2011-09/Data","URL").equals(reader.getName()))

      { list25.add(reader.getElementText()); }

      else

      { loopDone25 = true; }

      }
      }

      // call the converter utility to convert and set the array
      object.setURL((org.apache.axis2.databinding.types.URI[])
      3864 org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(
      org.apache.axis2.databinding.types.URI.class,list25));

      See the attachments for the relevant xml string and the relevant xsd. These are not complete files but snippets. More detailed information can be provided if required.

        Attachments

        1. wsdl.zip
          13 kB
          Brett Walker
        2. service.xsd
          5 kB
          Brett Walker
        3. request.xml
          5 kB
          Brett Walker

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bwalker Brett Walker
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: