I’ve got a problem with ClassCastException – maybe you could please suggest something ? I’m trying to get response from server via XMLRPC and get a CCE.
Here`s how I call it:
Object[] filesList = new Object[] {
new Object[] {"somefile.txt", lengthOfThatFile},
new Object[] {"somefile2.txt", lengthOfThatFile2}
};
ArrayList<Object[]> filesResent = (ArrayList<Object[]>) client.call("someserv.checkwhattoresend", userClientID, filesList);
That last line throws an exception:
09-11 16:14:33.953: ERROR/AndroidRuntime(389): java.lang.ClassCastException: [Ljava.lang.Object;
Procedure checkwhattoresend looks like this:
public List<Object[]> checkwhattoresend(String userClientID, Object[] fileInfo) {
ArrayList<Object[]> results = new ArrayList<Object[]>();
// doing some stuff
return results;
}
There should be no flaws on the server side.
UPDATE. SOLVED AS SIMPLY AS THIS:
Object[] filesResent = (Object[]) client.call("someserv.checkwhattoresend", userClientID, filesList);
[Ljava.lang.Object; indicates an array. Are you trying to cast an Array to a List? I’m not familiar with andriod or the client.call method you have listed, but you may want to check the return type of that call with
(client.call("someserv.checkwhattoresend", userClientID, filesList)).getClass().getName()