I have an applet that attempts to open a JDBC connection to an Oracle 9i DB.
The applet runs in IE (latest version) using the Sun 1.4_03 JRE.
The SOCKS proxy runs on port 1080 on the same machine as the applet.
When run the applet displays:
java.net.SocketException: SOCKS: Connection not allowed by ruleset
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:405)
at java.net.Socket.connect(Socket.java:434)
(etc...)
I have specified the socks proxy explicity in the control panel java plugin
settings tool - also tried "use browser settings". Behaviour is the same.
Any ideas?
TIA - Adam
Is this an unsigned applet? Is it trying to connect to a host other
than the one it was downloaded from?
--Mike Amling
I added the following to the JRE java.policy file:
grant {
permission java.net.SocketPermission "192.168.0.154:1521",
"connect,resolve";
};
192.168.0.154:1521 is the machine and port where Oracle is listening.
Cheers - Adam
"Michael Amling" <nos...@nospam.com> wrote in message
news:3EF99092...@nospam.com...
I think there are two possibilities. Either your applet needs
additional priveleges or the policy file you have edited is not the
one being used. In order to test the first case, use the following
for your policy file.
grant codeBase "http://www.myserver.com/myappletdir/-" {
permission java.security.AllPermission;
};
where myserver is the hostname or IP of the host that is running your
web server, and myappletdir is the virtual directory where your applet
resides. If this fails, then the applet is probably not using the
security file that you think it is.
Java applets will ONLY use the security policy file in your home
directory. To confirm what that is, compile and run the following
program.
import java.io.*;
/*
* This class prints out the home directory
*/
public class CheckHomeDir
{
public static void main(String[] args)
{
String userHomeDir = System.getProperty("user.home");
System.out.println("Place the policy file .java.policy in " +
userHomeDir);
}
}
The file .java.policy (NOTE the leading dot) is the only one that the
applet will look at.