Hi everyone,
I'm having a problem that has me stumped--any input would be appreciated.
I have an application that makes requests to web services and reads the responses using the HttpURLConnection.getInputStream() method. When I run the application without a security manager enabled, it works in a perfectly normal manner--the results for a 60 byte request are returned in 150 ms.
But, when I enable the security manager using my own policy file, the same call to HttpURLConnection.getInputStream() takes 1000 times longer--150,000 ms.
Does anyone know why this might be? I know that the app is using the correct policy file, and I'm using the default Java security manager.
Here is the command I use to execute the app:
Here is my policy file:
Thanks,
Jenn
I'm having a problem that has me stumped--any input would be appreciated.
I have an application that makes requests to web services and reads the responses using the HttpURLConnection.getInputStream() method. When I run the application without a security manager enabled, it works in a perfectly normal manner--the results for a 60 byte request are returned in 150 ms.
But, when I enable the security manager using my own policy file, the same call to HttpURLConnection.getInputStream() takes 1000 times longer--150,000 ms.
Does anyone know why this might be? I know that the app is using the correct policy file, and I'm using the default Java security manager.
Here is the command I use to execute the app:
Code:
java -Djava.security.manager -Djava.security.policy=java.policy -jar test.jar
Here is my policy file:
Code:
grant codeBase "(url omitted)/*" {
permission java.net.SocketPermission "*:80", "accept, connect, resolve";
permission java.net.SocketPermission "*:8080", "accept, connect, resolve";
permission java.lang.RuntimePermission "accessDeclaredMembers";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission java.io.SerializablePermission "enableSubclassImplementation";
permission java.io.SerializablePermission "enableSubstitution";
permission java.lang.RuntimePermission "setFactory";
permission java.net.NetPermission "specifyStreamHandler";
};
Thanks,
Jenn