Forum Stats

  • 3,814,665 Users
  • 2,258,897 Discussions
  • 7,892,796 Comments

Discussions

Connecting to a different host..........

843811
843811 Member Posts: 49,851
Hi guys, well I have this problem, I have an JApplet that's a RMI client in the machine A and my RMI server is in the B machine, so I get security exceptions like these:

Client exception: checkconnect.networkhost1

sun.applet.AppletSecurityException: checkconnect.networkhost1
at sun.applet.AppletSecurity.checkConnect(AppletSecurity.java:576)
at sun.applet.AppletSecurity.checkConnect(AppletSecurity.java:618)
at sun.applet.AppletSecurity.checkConnect(AppletSecurity.java:518)
at sun.rmi.transport.proxy.AsyncConnector.<init>(RMIMasterSocketFactory.java:321)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPChannel.openSocket(TCPChannel.java:279)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:150)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:123)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:67)

I tried using policy files to grant socket permissions but it didn't work. I update the java.security file for the JRE adding the path where the policy lies and nothing, I'm still getting this awful exception.

This is the policy file:
---------------------------------------
keystore "file:d:/proys/mysecurity/userstore";

grant codeBase "file:d:/resin2.0.1/doc" {
permission java.net.SocketPermission "*:1024-65535", "accept, connect, listen, resolve";
};
---------------------------------------

What can I do? Do you know some way to workaround this?

Any help will be appreciated.

Notes: I'm using JDK1.3 and the Java Plugin 1.1.3, Netscape 4.61

Comments

  • 843811
    843811 Member Posts: 49,851
    Hi Qaorisq,


    If you are using the Java plugin, you should not get this type of security error. Whether you can able to get Java plugin console. whether this error message is generated out of ordinary browser console or java plugin console.

    Also please check this URL for configuring swings with browser.

    http://wwwipd.ira.uka.de/~jjh/tools/swing/products/jfc/swingdoc-current/applets.html


    I hope this will help you.

    Thanks
    Bakrudeen
  • 843811
    843811 Member Posts: 49,851
    Hi,
    I had the same situation as you. I have a stand-alone RMI client application. After the client got the reference to the remote server object, it called the method of the remote server object. Then this security exception was generated:
    *** Security Exception: checkConnect:To xxx.xxxxxxxx.com ***
    java.rmi.RMISecurityException: security.checkConnect: To xxx.xxxxxxxx.com
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.lang.RuntimeException.<init>(Compiled Code)
    at java.lang.SecurityException.<init>(Compiled Code)
    at java.rmi.RMISecurityException.<init>(Compiled Code)
    at java.rmi.RMISecurityManager.checkConnect(Compiled Code)
    at java.rmi.RMISecurityManager.checkConnect(Compiled Code)
    at sun.rmi.transport.tcp.TCPChannel.checkConnect(Compiled Code)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Compiled Code)
    at sun.rmi.server.UnicastRef.newCall(Compiled Code)
    at ServerImpl_Stub.getStuff(Compiled Code)
    at Client.main(Compiled Code)

    Did you find the reason? here is my email adress:
    [email protected]

    Thanks for help in advance,

    Yirong
    Hi guys, well I have this problem, I have an JApplet
    that's a RMI client in the machine A and my RMI server
    is in the B machine, so I get security exceptions like
    these:

    Client exception: checkconnect.networkhost1

    sun.applet.AppletSecurityException:
    checkconnect.networkhost1
    at
    sun.applet.AppletSecurity.checkConnect(AppletSecurity.
    ava:576)
    at
    sun.applet.AppletSecurity.checkConnect(AppletSecurity.
    ava:618)
    at
    sun.applet.AppletSecurity.checkConnect(AppletSecurity.
    ava:518)
    at
    sun.rmi.transport.proxy.AsyncConnector.<init>(RMIMaste
    SocketFactory.java:321)
    at
    sun.rmi.transport.proxy.RMIMasterSocketFactory.createS
    cket(RMIMasterSocketFactory.java:128)
    at
    sun.rmi.transport.tcp.TCPChannel.openSocket(TCPChannel
    java:279)
    at
    sun.rmi.transport.tcp.TCPChannel.createConnection(TCPC
    annel.java:150)
    at
    sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChan
    el.java:123)
    at
    sun.rmi.server.UnicastRef.newCall(UnicastRef.java:67)

    I tried using policy files to grant socket permissions
    but it didn't work. I update the java.security file
    for the JRE adding the path where the policy lies and
    nothing, I'm still getting this awful exception.

    This is the policy file:
    ---------------------------------------
    keystore "file:d:/proys/mysecurity/userstore";

    grant codeBase "file:d:/resin2.0.1/doc" {
    permission java.net.SocketPermission "*:1024-65535",
    , "accept, connect, listen, resolve";
    };
    ---------------------------------------

    What can I do? Do you know some way to workaround
    this?

    Any help will be appreciated.

    Notes: I'm using JDK1.3 and the Java Plugin 1.1.3,
    Netscape 4.61
  • 843811
    843811 Member Posts: 49,851
    Your applet must be signed before it can access resources not on the host which it was launched from.

This discussion has been closed.