An applet isn't affected by your server settings.  What is your applet
trying to connect to?  What port.  Also what servlet or jsp is it
connecting to on your server.  The applet will be affected by the client
system it is running on.  Send the link to the url you need the applet
to connect to.  

I setup a URLConnection like this:
      java.net.URL url = new java.net.URL(s);
      java.net.URLConnection urlc = url.openConnection();
      urlc.setDoInput(true);
      urlc.setDoOutput(true);
      urlc.setUseCaches(false);
        java.io.PrintStream pout = urlc.getOutputStream();//other
streams work as well, just an example.

But you need to understand where you are executing an applet and when
and where the security and settings matter.

Wade

-----Original Message-----
From: jon yeargers [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 08, 2003 5:28 PM
To: [EMAIL PROTECTED]
Subject: Trying to get past java.net.ConnectException


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)



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to