Sinking in the JAVA quicksandbox

From: S J Rulison (srulison_at_aol.com)
Date: 10/28/04


Date: 28 Oct 2004 08:51:28 -0700

A few days ago I posted a message regarding a problem I'm having with
establishing a socket connection between an applet and a server to
this group. I have recapped the crux of the situation below. After
conferring with some helpful individuals on this group and doing some
additional research on my own, I now believe that this has something
to do with the java SecurityManager. While I have been doing a lot of
research in this area I have yet to find what program, server /
applet, needs to be modified and which methods need to be overridden
in the SecurityManager. Some code samples in this area would really
be helpful. Any help would be greatly appreciated.

Thank you.

Sincerely,
Steve Rulison

PREVIUOUS POSTING:
I have a JAVA Applet and Server application written in version
1.4.2_05 running on a Windows XP platform. I use the socket (String
host, int port) class on the applet side to establish a connection
with the Server and the ServerSocket (int port) class on the server
side. When I run both the Server and Applet on the same workstation,
everything works fine but if I move the Server portion onto another
machine, I am unable to establish a connection with that Server (see
exceptions listed below). I've tried using the IP address of the
server, the name of the server, and the fully qualified name (server
name. domain name). All of these conventions work fine when both the
applet and the server are run from the same machine but as soon as I
separate the two programs to two different computers, it stops
working.
I even went so far as to purposely feed the server a factitious IP
Address and machine ID when I was running both processes from the same
machine to see if it would run anyway. It did not, which tells me
that the server application is doing something with that parameter
when it establishes a connection.

EXCEPTIONS:
java.security.AccessControlException: access denied
(java.net.SocketPermission 10.44.1.250 resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at java.net.InetSocketAddress.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at PTABLookup.createSocket(PTABLookup.java:110)
at PTABLookup.init(PTABLookup.java:87)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)



Relevant Pages

  • Re: JDBC Applets - MS Access
    ... > I am working on a Applet at the moment which must be able to access ... > I need to be able to setup a jdbc connection to an Access database. ... JDataConnect also uses a server side JDBC server. ...
    (comp.lang.java.databases)
  • Re: IIS 6 & Server Permisions
    ... I am running a server side applett. ... link where I can find the correct changes to make in IIS6. ... is this Java application running on the Web Server or the Web Browser. ... where is the Applet trying to store the hit counters? ...
    (microsoft.public.inetserver.iis)
  • Applet Hangs when submitting data to servlet
    ... on our web server. ... applet that demonstrates the problem. ... private JButton theSubmitButton_, theClearButton_; ... public void actionPerformed ...
    (comp.lang.java.programmer)
  • Re: Thread info
    ... > I have an applet which automatically connects to my application server ... > as the applet closes it kills the connection with the application ... Or are you trying to reuse the server's thread so that it ...
    (comp.lang.java.programmer)
  • Re: Applet Hangs when submitting data to servlet
    ... on our web server. ... applet that demonstrates the problem. ... private JButton theSubmitButton_, theClearButton_; ... public void actionPerformed ...
    (comp.lang.java.programmer)