I'm trying to get data via the Java XmlRpcClient. I created a user in class ROBOTS and a key of ROBOT. When I try to connect I get a FileNotFoundException. Here is my code:
public void getData() {
System.setProperty("org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser");
try {
XmlRpcClient XmlRpcClient = new XmlRpcClient("http://server/queuemetrics/xmlrpc.do", false);
ArrayList arrayList = new ArrayList();
//arrayList.add("KoDO.DiscCauses");
//arrayList.add("KoDO.UnansByQueue");
//arrayList.add("DetailsDO.CallsKO");
Object[] objectArray = {"queue-0001", "user1", "something", "", "", "2008-08-06.08:00:00", "2008-08-07.08:00:00", "", arrayList};
Object token = XmlRpcClient.invoke("QM.stats", objectArray);
HashMap hashMap = (HashMap) token;
System.out.println("Response: " + hashMap);
} catch (Exception ex) {
ex.printStackTrace();
}
}
Here's the errors when trying to connect:
11:05:32,272 ERROR [STDERR] redstone.xmlrpc.XmlRpcException: The response could not be parsed.
11:05:32,273 ERROR [STDERR] at redstone.xmlrpc.XmlRpcClient.handleResponse(Unknown Source)
11:05:32,273 ERROR [STDERR] at redstone.xmlrpc.XmlRpcClient.endCall(Unknown Source)
11:05:32,274 ERROR [STDERR] at redstone.xmlrpc.XmlRpcClient.invoke(Unknown Source)
11:05:32,274 ERROR [STDERR] at mypackage.QueueMetricsUtil.getData(QueueMetricsUtil.java:36)
11:05:32,274 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:05:32,274 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
11:05:32,274 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
11:05:32,275 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
11:05:32,275 ERROR [STDERR] at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
11:05:32,275 ERROR [STDERR] at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
11:05:32,275 ERROR [STDERR] at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
11:05:32,275 ERROR [STDERR] at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
11:05:32,275 ERROR [STDERR] at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
11:05:32,276 ERROR [STDERR] at javax.faces.component.UICommand.broadcast(UICommand.java:383)
11:05:32,276 ERROR [STDERR] at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:317)
11:05:32,276 ERROR [STDERR] at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:292)
11:05:32,276 ERROR [STDERR] at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:249)
11:05:32,276 ERROR [STDERR] at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:462)
11:05:32,276 ERROR [STDERR] at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
11:05:32,276 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
11:05:32,277 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
11:05:32,277 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
11:05:32,277 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
11:05:32,277 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:05:32,277 ERROR [STDERR] at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
11:05:32,277 ERROR [STDERR] at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
11:05:32,278 ERROR [STDERR] at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
11:05:32,278 ERROR [STDERR] at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
11:05:32,278 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
11:05:32,278 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:05:32,278 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
11:05:32,278 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
11:05:32,278 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
11:05:32,279 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
11:05:32,279 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
11:05:32,279 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
11:05:32,279 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
11:05:32,279 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
11:05:32,279 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
11:05:32,280 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
11:05:32,280 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
11:05:32,280 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
11:05:32,280 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
11:05:32,280 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
11:05:32,280 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
11:05:32,280 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
11:05:32,281 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
11:05:32,281 ERROR [STDERR] Caused by: java.io.FileNotFoundException: http://192.168.1.2:8080/queuemetrics/n/a
11:05:32,282 ERROR [STDERR] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1168)
11:05:32,282 ERROR [STDERR] ... 48 more
Notice the url next to the FileNotFoundException: queuemetrics/n/a why???
Thank you,
TK