QueueMetrics > Scripting QueueMetrics

XMLRPC Connection issues.

(1/1)

djkrite:
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:


--- 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();
        }
    }
--- End code ---

Here's the errors when trying to connect:

--- Code: ---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
--- End code ---

Notice the url next to the FileNotFoundException: queuemetrics/n/a why???

Thank you,

TK

QueueMetrics:
What do you get in QM's catalina.out and localhost.txt?

djkrite:
Here's catalina.out:

--- Code: ---REQUEST:

redstone.xmlrpc.XmlRpcException: Could not instantiate XMLReader parser
at redstone.xmlrpc.XmlRpcParser.parse(Unknown Source)
at redstone.xmlrpc.XmlRpcDispatcher.dispatch(Unknown Source)
at redstone.xmlrpc.XmlRpcServer.execute(Unknown Source)
at it.loway.app.queuemetrics.xmlrpc.tpfServer.doRun(Unknown Source)
at it.loway.tpf.transaction.servlets.LowayTransactionController.serveRequest(Unknown Source)
at it.loway.tpf.transaction.servlets.LowayTransactionController.serveRequestWrapper(Unknown Source)
at it.loway.tpf.transaction.servlets.LowayTransactionController.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:189)
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:150)
... 21 more
[E8E3DD127E6529943DCFF1611CBE94F2] Tempo totale esecuzione verbo 'xmlrpc': 8 ms
--- End code ---
Looks like it can't find the xmlrpc api. If I need to add this where does it go and does it require Tomcat to be restarted?

Here's the localhost file:

--- Code: ---Aug 11, 2008 8:37:33 AM org.apache.catalina.core.ApplicationContext log
INFO: [E8E3DD127E6529943DCFF1611CBE94F2] Inizio classe it.loway.app.queuemetrics.xmlrpc.tpfServer
Aug 11, 2008 8:37:33 AM org.apache.catalina.core.ApplicationContext log
INFO: [E8E3DD127E6529943DCFF1611CBE94F2] Fine classe it.loway.app.queuemetrics.xmlrpc.tpfServer
Aug 11, 2008 8:37:33 AM org.apache.catalina.core.ApplicationContext log
INFO: LowayTransactionController: [E8E3DD127E6529943DCFF1611CBE94F2] Tempo totale esecuzione verbo 'xmlrpc': 8 ms
--- End code ---

QueueMetrics:
Likely you're missing Xerces. Try this recipe here: http://astrecipes.net/index.php?n=231

Navigation

[0] Message Index

Go to full version