f



XML-RPC - java.lang.ClassCastException: java.util.Date error during execute

Hello,

I am getting an error "XML-RPC - java.lang.ClassCastException:
java.util.Date" when I call the "XmlRpcClient" execute method.  I
believe the underlying classes are having trouble parsing the result
from the time.xmlrpc.com/RPC2:80 XML-RPC service.

I apologize that I could not navigate the Apache bug reporting and
search system.  I hope someone can recognize what is up with this.

Thank you in advance for any help,

Michael

import java.util.Vector;
import java.util.Hashtable;
import org.apache.xmlrpc.*;
    
public class GetTime {
  private final static String server_url
="http://time.xmlrpc.com/RPC2";
  public static void main (String [] args) {
    try {
    
      XmlRpcClient server = new XmlRpcClient(server_url);
      Vector params = new Vector();

      System.out.println("Calling execute method ");
      Hashtable response = new Hashtable();
      response = (Hashtable)
server.execute("currentTime.getCurrentTime",params);
      System.out.println("Time is: ");

    } catch (XmlRpcException exception) {
      System.err.println("GetTime1: XML-RPC Fault #" +
Integer.toString(exception.code) + ": " + exception.toString());

    } catch (Exception exception) {
      System.err.println("GetTime2: " + exception.toString());
    }
  }
}

Note:  This is similar to this post, but NOT the same.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=d5bcd7c4.0304081102.10e66eb4%40posting.google.com&rnum=1&prev=/groups%3Fq%3DXML-RPC%2Bjava.lang.ClassCastException%26hl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3Dd5bcd7c4.0304081102.10e66eb4%2540posting.google.com%26rnum%3D1
0
mgalaty (1)
9/10/2004 1:26:10 AM
comp.lang.java.programmer 52714 articles. 0 followers. Post Follow

0 Replies
367 Views

Similar Articles

[PageSpeed] 0

Reply: