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 NY...@aol.com on 2004/07/15 21:18:14 UTC

ClassCastException when Passing Array's Through Axis

Does anybody know how to stop getting a classCastException when getting an  
array back from Axis? I get it from executing the following line:
 
  java.lang.String[] yes_list =  (String[])handler.query(groupName, password, 
accountName, conditions);
 
If I attempt to change the data types to anything else I receive an error.  
Making them Objects[] does not work. The WSDL could not be simpler: Wrapped  
Literal with a message with one data type being an unbounded array.
 
I use a handler type fashion to run stuff through Axis; Establishing a  
Handler and calling handler.query etc...
 
James Crosson

Re: ClassCastException when Passing Array's Through Axis

Posted by Vy Ho <st...@drexel.edu>.
What I meant is:

java.lang.Object[] yes_list = (Object[])handler.query(groupName, 
password, accountName, conditions);


Vy Ho wrote:

> What does this mean?  Can you do this:
>
> java.lang.Object[] yes_list = (String[])handler.query(groupName, 
> password, accountName, conditions);
>
> Then:
> String syes_list [];
> if(yes_list != null){
>    syes_list [] = new String[yes_list.length];
>    ...array copy here.
> }else{
>    syes_list = null;
> }
>
> If this works, then search and vote for this bug in Sun's bug database.
>
>>  Making them Objects[] does not work.
>
>
>


Re: ClassCastException when Passing Array's Through Axis

Posted by Vy Ho <st...@drexel.edu>.
What does this mean?  Can you do this:

java.lang.Object[] yes_list = (String[])handler.query(groupName, 
password, accountName, conditions);

Then:
String syes_list [];
if(yes_list != null){
    syes_list [] = new String[yes_list.length];
    ...array copy here.
}else{
    syes_list = null;
}

If this works, then search and vote for this bug in Sun's bug database.

>  Making them Objects[] does not work.