ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raja Subramanian <>
Subject workaround for xmlrpc-client exception in applet context
Date Wed, 01 Sep 2004 15:37:21 GMT

I have started using xmlrpc-1.2-b1 as a client and am extremely pleased
with it.  My thanks to all the developers for their efforts.

When I run my application as a standalone app, all goes well.  But when
I run the same as an (unsigned) applet, the following exception is
raised.  Yes, yes, I'm aware of applet restrictions and such.

===== my code
    try {
        fetchMethod = new SecureXmlRpcClient(fetch);
        fetchMethod.setBasicAuthentication(user, passwd);
    } catch (MalformedURLException e) {
        System.err.println("ERROR: Bad URL " + e);
    // This bombs when called from applet context!
    result = (Hashtable) fetchMethod.execute("fetchJob", new Vector());

===== Exception raised access denied (java.util.PropertyPermission org.apache.xmlrpc.TypeFactory
        at java.lang.SecurityManager.checkPermission(
        at java.lang.SecurityManager.checkPropertyAccess(
        at java.lang.System.getProperty(
        at org.apache.xmlrpc.XmlRpc.<init>(
        at org.apache.xmlrpc.XmlRpcClient$Worker.<init>(
        at org.apache.xmlrpc.XmlRpcClient.getWorker(
        at org.apache.xmlrpc.XmlRpcClient.execute(

The offending line is in ./org/apache/xmlrpc/ line 201.  The
following change to XmlRpc() seems to fix the problem for me.  For the
record, I'm using java 1.4.2_04 on linux.  I have not tested on other

protected XmlRpc()
//  System.get...() always returns null on my box anyway!
//  this(System.getProperty(TypeFactory.class.getName()));

    this((String) null);

I admit that my workaround is too crude, but can someone offer a better
solution that is more acceptable for all?  Can someone help?

- Raja

View raw message