2 Replies Latest reply on Oct 6, 2003 12:04 AM by chemapo

    RMI security problem

    chemapo

      Hi,

      I'm trying to connect a stateful session bean to a RMI server running in the same machine. When the session bean tries to connect, i get the next exception in the jboss console, I think that it is a security issue, but i can't find how to change the SocketPermission. The server.policy file contains the next lines:

      grant {
      // Allow everything for now
      permission java.security.AllPermission;
      };

      I'm using jboss 3.0.7
      Here you are the exception i get , please can you help me to solve this problem?



      16:29:10,984 INFO [STDOUT] Trying to connect to rmi server
      16:29:11,015 INFO [STDOUT] Can't connect to server java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:2323 con
      nect,resolve)
      16:29:11,015 ERROR [STDERR] java.security.AccessControlException: access denied
      (java.lang.RuntimePermission setContextClassLoader)
      16:29:11,015 ERROR [STDERR] at java.security.AccessControlContext.checkPermi
      ssion(AccessControlContext.java:270)
      16:29:11,015 ERROR [STDERR] at java.security.AccessController.checkPermissio
      n(AccessController.java:401)
      16:29:11,015 ERROR [STDERR] at java.lang.SecurityManager.checkPermission(Sec
      urityManager.java:542)
      16:29:11,015 ERROR [STDERR] at java.lang.Thread.setContextClassLoader(Thread
      .java:1219)
      16:29:11,015 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invok
      e(LocalInvoker.java:110)
      16:29:11,015 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invok
      e(InvokerInterceptor.java:102)
      16:29:11,015 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke
      (TransactionInterceptor.java:77)
      16:29:11,015 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(Se
      curityInterceptor.java:80)
      16:29:11,015 ERROR [STDERR] at org.jboss.proxy.ejb.StatefulSessionIntercepto
      r.invoke(StatefulSessionInterceptor.java:117)

        • 1. Re: RMI security problem

          try some debugging on that.
          use -Djava.securtity.debug=all.
          Other opiosn you can use are
          all - turns all the debugging.
          policy - loadinga nd granting. (this might be handy)
          scl - permissions SecureClassLoader assigns.
          jar
          access -

          I hope this will lead to the solution.

          Vishal.

          • 2. Re: RMI security problem
            chemapo

            Hi

            I have been searching the web and finally I have found the solution.

            I havedeleted the line

            //System.setSecurityManager(new RMISecurityManager());

            from my ejb, and then all works fine.

            thanks