Problem: Im trying to use an Applet to interact with my Tomcat code via
sockets to transfer files. I get the following exception:
java.net.ConnectException: Connection refused: connect
and it points to a line in my code where I call
URLConnection::getOutputStream();
All well and good. I can see where this needs to be protected. I STFW
for information about setting tomcat security (since my books don't seem
to cover it very well.. bad books I guess) and found this page:
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/security-manager-howto.h
tml
Sounds like a good thing to try. My applet lives in
${catalina.home}/webapps/viewer so I added this line to my
catalina.policy file:
grant codebase "file:{catalina.home}/webapps/viewer/-" {
permission java.security.AllPermission;
};
and restarted the server with
bin/startup.sh -security
.. to no avail. The situation hasn't changed.
is this the right approach? Am I barking up the wrong proverbial tree?
(The applet in question is signed with a test cert - it makes it past
client security and sees my local drive ok)