ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jzqa <jehanzeb.qay...@gmail.com>
Subject java.io.IOException: Insufficient user privileges
Date Mon, 16 Feb 2009 13:37:37 GMT

For one of my server's URL i am getting an exception while using apache xml
rpc 3.1.1. When i use apache commons httpclient directly it works correctly
but fails with apache xml rpc.

//Commons HTTPClient
        HttpClient client = new HttpClient();
        client.getParams().setAuthenticationPreemptive(true);
        UsernamePasswordCredentials upc = new
UsernamePasswordCredentials("test", "test");
        AuthScope as = new AuthScope("172.18.132.90", 10010, "realm");
        client.getState().setCredentials(as, upc);
        PostMethod postMethod = new
PostMethod("http://172.18.132.90:10010/Air");
        File f = new File(args[2]);
        postMethod.setRequestHeader("Connection:", "close");
        postMethod.setRequestHeader("User-Agent", "it/3.1/1.0");
        postMethod.setRequestHeader("Content-type", "text/xml;
charset=UTF-8");
        postMethod.setRequestBody(new FileInputStream(f));
        int statusCode1 = client.executeMethod(postMethod);
        postMethod.releaseConnection();

//Apache xml rpc
        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl()
        config.setServerURL("http://172.18.132.90:10010/Air");
        config.setConnectionTimeout(30000);
        config.setReplyTimeout(30000);
        config.setBasicEncoding(null); //UTF-8
        config.setUserAgent("it/3.1/1.0");
        config.setBasicUserName("test");
        config.setBasicPassword("test");
        XmlRpcClient client = new XmlRpcClient();
        client.setTransportFactory(new
XmlRpcLiteHttpTransportFactory(client));
        client.setConfig(config);
        client.setTypeFactory(new CustomTypeFactory(client));
        client.execute(methodName, params);

I have tried different transport factories but no success, get 403 forbidden
error.
Here is the stack trace with lite transport.
2009-02-16 18:10:20,619 : [ERROR] [com.warid.air.AirAPIAdapter] [execute] -
Failed to read server response: Unexpected Response from Server: 
Insufficient user privileges

org.apache.xmlrpc.client.XmlRpcClientException: Failed to read server
response: Unexpected Response from Server:  Insufficient user privileges
	at
org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.getInputStream(XmlRpcLiteHttpTransport.java:249)
	at
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:144)
	at
org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:115)
	at
org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.sendRequest(XmlRpcLiteHttpTransport.java:82)
	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 org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:147)
	at com.warid.air.AirAPIAdapter.execute(AirAPIAdapter.java:117)
	at com.warid.air.AirAPIAdapter.execute(AirAPIAdapter.java:121)
	at com.warid.happyhour.common.Util.airProvision(Util.java:56)
	at com.warid.happyhour.MainTask.createUpdateHappyHour(MainTask.java:372)
	at com.warid.happyhour.MainTask.processProvisionRequest(MainTask.java:290)
	at com.warid.happyhour.MainTask.routeRequest(MainTask.java:177)
	at com.warid.happyhour.MainTask.run(MainTask.java:133)
Caused by: java.io.IOException: Unexpected Response from Server: 
Insufficient user privileges
	at
org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.getInputStream(XmlRpcLiteHttpTransport.java:225)
	... 14 more
Caused by:
java.io.IOException: Unexpected Response from Server:  Insufficient user
privileges
	at
org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.getInputStream(XmlRpcLiteHttpTransport.java:225)
	at
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:144)
	at
org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:115)
	at
org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.sendRequest(XmlRpcLiteHttpTransport.java:82)
	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 org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:147)
	at com.warid.air.AirAPIAdapter.execute(AirAPIAdapter.java:117)
	at com.warid.air.AirAPIAdapter.execute(AirAPIAdapter.java:121)
	at com.warid.happyhour.common.Util.airProvision(Util.java:56)
	at com.warid.happyhour.MainTask.createUpdateHappyHour(MainTask.java:372)
	at com.warid.happyhour.MainTask.processProvisionRequest(MainTask.java:290)
	at com.warid.happyhour.MainTask.routeRequest(MainTask.java:177)
	at com.warid.happyhour.MainTask.run(MainTask.java:133)

Any help?
-- 
View this message in context: http://www.nabble.com/java.io.IOException%3A--Insufficient-user-privileges-tp22037394p22037394.html
Sent from the Apache Xml-RPC - User mailing list archive at Nabble.com.


Mime
View raw message