Auto Login to BugZilla through java code

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Auto Login to BugZilla through java code

Neha Punia
I am trying to code for auto login to bugzilla using bugzilla API
 The sample code that i m trying is as given below:
import java.net.MalformedURLException;

import java.net.URL;

import java.util.HashMap;

import java.util.Map;

import org.apache.xmlrpc.XmlRpcException;

import org.apache.xmlrpc.client.XmlRpcClient;

import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

public class Bugzilla {

    public static void main(String[] args) throws MalformedURLException, XmlRpcException {

        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();

        config.setServerURL(new URL("http://chdsez119829d/xmlrpc.cgi"));

        XmlRpcClient client = new XmlRpcClient();

        client.setConfig(config);

        Map map = new HashMap();

        map.put("login", "sandeep_kumar01@infosys.com");

        map.put("password", "Sandeep");

        Map result = (Map) client.execute("ping", new Object[]{map});

        System.out.println("Result = " + result);

    }
My bugzilla is installed on chdsez119829d machine and i can access it  as http://chdsez119829d from anywhere. Is there a problem in the url i m specifying in config.setServerURL?
When i run this code i get an exception
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xmlrpc.client.XmlRpcClientWorkerFactory.releaseWorker(Lorg/apache/xmlrpc/common/XmlRpcWorker;)V
        at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:58)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
        at javaapplication2.Bugzilla.main(Bugzilla.java:44)

Reply | Threaded
Open this post in threaded view
|

Re: Auto Login to BugZilla through java code

ernitingoel
I am also looking for similar thing ...

Did you get some thing?

- Nitin