Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SOCKS problem with applet

36 views
Skip to first unread message

Adam Lipscombe

unread,
Jun 25, 2003, 7:57:08 AM6/25/03
to
Folks,

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


Michael Amling

unread,
Jun 25, 2003, 8:07:19 AM6/25/03
to

Is this an unsigned applet? Is it trying to connect to a host other
than the one it was downloaded from?

--Mike Amling

Adam Lipscombe

unread,
Jun 25, 2003, 8:35:29 AM6/25/03
to
Yes its unsigned and is trying to connect to another host.
Its loaded from the local machine (in JBuilder), and tries to connect to a
remote DB).


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...

JGuy

unread,
Jul 3, 2003, 4:02:04 PM7/3/03
to
"Adam Lipscombe" <ad...@cobar.fsbusiness.co.uk> wrote in message news:<bdc4uh$f5f$1...@newsg1.svr.pol.co.uk>...

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.

0 new messages