Dear all,
   
    I am using Apache 1.3.4 + Jserv 1.0b2 + SSL on Solaris 2.5.1.  These days, I am trying to write a simple servlets to talk to my first RMI server.  However, the servlet keep throughing the following exception:
   
       java.security.AccessControlException: access denied (java.net.SocketPermission 1
27.0.0.1:2233 connect,resolve)
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at java.lang.RuntimeException.<init>(RuntimeException.java:47)
        at java.lang.SecurityException.<init>(SecurityException.java:39)
        at java.security.AccessControlException.<init>(AccessControlException.java:57)
        at java.security.AccessControlContext.checkPermission(Compiled Code)
        at java.security.AccessController.checkPermission(Compiled Code)
        at java.lang.SecurityManager.checkPermission(Compiled Code)
        at java.lang.SecurityManager.checkConnect(SecurityManager.java:1006)
        at java.net.Socket.<init>(Socket.java:258)
        at java.net.Socket.<init>(Socket.java:98)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect SocketFactory.java:29)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Compiled Code)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:462)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:194)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(Compiled Code)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
        at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
        at Srmi.doGet(Srmi.java:36)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at org.apache.jserv.JServConnection.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)
 
    The servlet throws the exception at the code registry.lookup:
 
    try {
            Registry registry = LocateRegistry.getRegistry("localhost", 2233);
            ms = (MessageServer) registry.lookup("KinMessageServer");
    } catch (Exception e) {
            e.printStackTrace();
    }
 
    I have already add the directory of the servlet to java.policy and grant all permission to it.  Also, I have copied the server stub/skel classes to the directoy of the servlet.  Is there anyone know how to fix this problem?
 
    Thank you very much for your help.
 
yours,
 
kin       

Reply via email to