Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Problem with apache xml-rpc lib

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Problem with apache xml-rpc lib

    hello
    i have problem with apache xml-rpc lib in my code
    my code:
    package com.thr.FireEagle;
     
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.ArrayList;
     
    import org.apache.xmlrpc.XmlRpcException;
    import org.apache.xmlrpc.client.XmlRpcClient;
    import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
     
     
    public class JavaClient{
     
     
    	       public static void main( String[] args )
    	       {
    	    	   ArrayList<String> params = new ArrayList<String>();
    	    	   params.add( new String("http://rs230dt.rapidshare.com/files/344243800/10012723.LinuxCBT.Debian.part8.rar"));
    	          System.out.println( "execute" );
    	          XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
    	          try {
    	            config.setServerURL(new URL("http://localhost:6800/rpc"));
    	         } catch (MalformedURLException e) {
    	            // TODO Auto-generated catch block
    	            e.printStackTrace();
    	         }
    	          XmlRpcClient client = new XmlRpcClient();
    	          client.setConfig(config);
     
    	          try {
    	            client.execute(config, "aria2.addUri", params);
    	         } catch (XmlRpcException e1) {
    	            // TODO Auto-generated catch block
    	            e1.printStackTrace();
    	         }
     
     
    	    }
    	}
    i want to communicate with aria2c command line software to send it url to download but i receive this error when i compile my code:
    execute
    org.apache.xmlrpc.XmlRpcException: URI is not provided.
    	at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197)
    	at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
    	at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
    	at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
    	at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
    	at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
    	at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158)
    	at com.thr.FireEagle.JavaClient.main(JavaClient.java:32)
    ERROR occurred at line
    client.execute(config, "aria2.addUri", params);
    tis is aria2.addUri method descriptions with python code:
    aria2.addUri (uris[, options[, position]])
     
    Description
    This method adds new HTTP(S)/FTP/BitTorrent Magnet URI. uris is of type array and its element is URI which is of type string. For BitTorrent Magnet URI, uris must have only one element and it should be BitTorrent Magnet URI. URIs in uris must point to the same file. If you mix other URIs which point to another file, aria2 does not complain but download may fail. options is of type struct and its members are a pair of option name and value. See Options below for more details. If position is given as an integer starting from 0, the new download is inserted at position in the waiting queue. If position is not given or position is larger than the size of the queue, it is appended at the end of the queue. This method returns GID of registered download.
     
    Example
    The following example adds http://example.org/file to aria2:
     
    >>> import xmlrpclib
    >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
    >>> s.aria2.addUri(['http://example.org/file'])
    '1'
    please help me to solve my problem.
    thanks


  2. #2
    Junior Member
    Join Date
    Nov 2010
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Problem with apache xml-rpc lib

    Is my code wrong?
    no everyone can help me?
    please help me.

Similar Threads

  1. need help with 'org.apache.commons.net.ftp.FTPClient'
    By rtumatt in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: May 22nd, 2013, 07:02 PM
  2. Apache server restsrting problem
    By Gaurav Gupta in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 13th, 2011, 05:50 AM
  3. Need Hellp!! problem with org.apache.struts.actions.DownloadAction.copy
    By nikshri in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 6th, 2010, 01:06 AM
  4. Problem running Apache tomcat 6.0 using i.p. address
    By nakul in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: April 8th, 2010, 07:58 AM
  5. apache-jboss
    By supriya ramjee in forum Web Frameworks
    Replies: 0
    Last Post: August 12th, 2009, 05:37 AM