[one-users] Problem with OPENNEBULA XMLRPC client on linux
Shweta Gulati
shweta.svnit at gmail.com
Thu Jan 21 13:52:09 PST 2010
We are trying to run an xmlrpc client request with the following client :
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.XmlRpcException;
import java.util.Vector;
//import com.foo.Adder;
import java.net.URL;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
import org.apache.xmlrpc.client.util.ClientFactory;
public class XmlRpcTest {
public static void main( String args[] ) throws Exception {
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL("http://10.100.57.73:2633/RPC2"));
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
//ClientFactory factory = new ClientFactory(client);
//Adder adder = (Adder) factory.newInstance(Adder.class);
//int sum = adder.add(2, 4);
//XmlRpcClient client = new XmlRpcClient();
Vector params = new Vector();
params.addElement("oneadmin:4478db59d30855454ece114e8ccfa5563d21c9bd");
//params.addElement("MEMORY=64 CPU=0.1 DISK = [ source =
\"root at 10.100.57.73:/srv/cloud/images/ttylinux.img\", target =
\"hda\", readonly = \"no\" ] NIC = [ NETWORK = \"Small network\"
]FEATURES=[ acpi=\"no\" ] GRAPHICS = [ type = \"vnc\", listen =
\"127.0.0.1\", port = \"-1\"] ");
params.addElement(0);
try{
Vector result = (Vector)client.execute( "one.user.info", params );
if ( result != null )
System.out.println( result.elementAt(0) );
}catch(e){
System.out.print(e.getMessage());
}
}
}
When we use this client on Windows XP, while the opennebula XMLRPC
server runs on a Linux machine, the communication is fine and the info
of the user oneadmin is returned, as desired.
But trying to run the same client code on the same Linux machine (with
the modified server URL), we get the following Exception
command issued: java XlmRpcTest
output
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/xmlrpc/client/XmlRpcClientConfig
Caused by: java.lang.ClassNotFoundException:
org.apache.xmlrpc.client.XmlRpcClientConfig
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)t
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
More information about the Users
mailing list