You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Sebastian J. Schultheiss" <se...@umich.edu> on 2006/05/30 21:07:43 UTC

[Axis2][Current Nightly May 30th] ADB: Array Converter Utility is faulty

Hi there,

we have discovered a bug in ADB's array conversion. We are calling a service
that returns an array of integers and another one of doubles.

We used WSDL2Java to create a client and a service using ADB databinding from a
WSDL that contains the following return types:

<xs:element name="predictEpitopesResponse">
 <xs:complexType>
  <xs:sequence>
   <xs:element minOccurs="0" type="xs:integer" name="StartPositions"
maxOccurs="unbounded"/>
   <xs:element minOccurs="0" type="xs:double" name="Scores" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>

Curiously, WSDL2Java wants the integer array to be of type BigInteger, which is
not what we expected (long maybe? how can we ensure this?)

The code that causes the following exception looks like this:

System.err.println(list1);
object.setStartPositions( (java.math.BigInteger[])

org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(
                                    java.math.BigInteger.class, list1));

This is the output of the err.println and the exception:

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
java.lang.RuntimeException: java.lang.ArrayStoreException
	at org.apache.axis2.SVMHCServiceStub.fromOM(SVMHCServiceStub.java:952)
	at org.apache.axis2.SVMHCServiceStub.predictEpitopes(SVMHCServiceStub.java:149)
	at org.apache.axis2.schmain.main(schmain.java:24)
Caused by: java.lang.ArrayStoreException
	at java.lang.System.arraycopy(Native Method)
	at java.util.ArrayList.toArray(Unknown Source)
	at
org.apache.axis2.databinding.utils.ConverterUtil.convertToArray(ConverterUtil.java:697)
	at
org.apache.axis2.SVMHCServiceStub$PredictEpitopesResponse$Factory.parse(SVMHCServiceStub.java:791)
	at org.apache.axis2.SVMHCServiceStub.fromOM(SVMHCServiceStub.java:944)
	... 2 more


We think it looks like the numbers are integers... so there's no reason why the
ConverterUtil should fail like this. We've logged a JIRA bug at

http://issues.apache.org/jira/browse/AXIS2-782
and submitted all relevant files.

Please let us know if there's anything we can do to help.

-- Sebastian

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