hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "D Alvarado" <laredotorn...@wildmail.com>
Subject Re: Re: access denied exception
Date Sat, 31 Jan 2004 06:46:33 GMT
Thanks kindly for the reponse.  Just one small
follow-up question.  What am I granting
permission to access what?

Much thanks - Dave

---- Begin Original Message ----

From: "Roland Weber" <ROLWEBER@de.ibm.com>
Sent: Fri, 30 Jan 2004 09:18:40 +0100
To: "Commons HttpClient Project"
<commons-httpclient-dev@jakarta.apache.org>
Subject: Re: access denied exception


Hello,

this looks like a Java2 security problem. Two
options:

Hack: Disable Java2 security.
Clean: grant your application the necessary
permissions
          in the java.policy file

The file should be in ${JAVA_HOME}/jre/lib/security/
I hope someone else can come up with the exact
permission entries required for the HTTP Client.

best regards,
  Roland






"D Alvarado" <laredotornado@wildmail.com>
30.01.2004 06:36
Please respond to "Commons HttpClient Project"
 
        To:    
commons-httpclient-dev@jakarta.apache.org
        cc: 
        Subject:        access denied exception


Hi, I was hoping someone could help me with this
exception.  I'm trying to POST some data to a
remote site using https.  The code is almost
directly from jakarta:

        // Create an instance of HttpClient.
        HttpClient client = new HttpClient();
 
client.getState().setCookiePolicy(CookiePolicy.COMPATIBILITY);

        // Create a method instance.
        PostMethod method = new
PostMethod("https://www.thirdparty.com");
        method.setRequestBody(data);

        // Execute the method.
        int statusCode = -1;
        int attempt = 0;
        // We will retry up to 3 times.
        while (statusCode == -1 && attempt < 3) {
                try {
                        // execute the method.
                        statusCode =
client.executeMethod(method);
                } catch (HttpRecoverableException
e) {
                        System.err.println("A
recoverable exception occurred, retrying." +
e.getMessage());
                } catch (IOException e) {
 
System.err.println("Failed to download file.");
                        e.printStackTrace();
                }
        }

        // Check that we didn't run out of retries.
        if (statusCode == -1) {
                System.err.println("Failed to
recover from exception.");
        }

I am running WebLogic 5.1 sp12, with the lastest
version of JSSE.  But the above code generates
the following exception:

java.security.AccessControlException: access
denied (java.security.SecurityPermission
getProperty.ssl.SocketFactory.provider)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
at
java.security.AccessController.checkPermission(AccessController.java:399)
at
java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at
java.security.Security.getProperty(Security.java:879)
at javax.net.ssl.SSLSocketFactory$1.run(DashoA6275)
at
java.security.AccessController.doPrivileged(Native
Method)
at javax.net.ssl.SSLSocketFactory.a(DashoA6275)
at
javax.net.ssl.SSLSocketFactory.getDefault(DashoA6275)
at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:112)
at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:663)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:661)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
at
jsp_servlet._ma._thinkwell._student.__tw_student_redirect._jspService(__tw_student_redirect.java:238)
at lycea.ui.LyceaJspServlet.service(Unknown Source)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:945)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:909)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274)
at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:130)

Any thoughts?  Thanks for your time, Dave




Care2 make the world greener!
Think twice before eating farmed salmon. Find out
why:
http://www.care2.com/go/z/11051/1067

---------------------------------------------------------------------
To unsubscribe, e-mail: 
commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: 
commons-httpclient-dev-help@jakarta.apache.org




---- End Original Message ----




Care2 make the world greener!
Think twice before eating farmed salmon. Find out why:
http://www.care2.com/go/z/11051/1067

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message