1 Reply Latest reply on Jun 27, 2013 2:49 PM by Wolf-Dieter Fink

    no security manager: RMI class loader disabled

    matt 2007 Newbie

      hi

      I'm using JBoss 5 and trying to call a bean's method which deployed on JBoss. My project outline is like this:

      -enterprise app

         - ejbmodule

           -statelessBean

                -ejbmoduleClient

           -statelessBeanRemote

       

      -ClientProject ( has ejbmoduleClient.jar as library)

       

       

      Properties properties = new Properties();

                                    properties.put("java.security.policy", "policy/client.policy");

                                    properties.put("java.naming.factory.initial",

                                                        "org.jnp.interfaces.NamingContextFactory");

                                    properties.put("java.naming.factory.url.pkgs",

                                                        "org.jboss.naming:org.jnp.interfaces");

                                    properties.put("java.naming.provider.url", "127.0.0.1");

                                    Context ctx = new InitialContext(properties);

                                    statelessBeanRemote temp  = (statelessBeanRemote ) ctx.lookup("statelessBeanRemote");

       

                                    temp.foo(arg);

       

       

      "foo" accepts string or class as argument. everything is fine when I call foo like :

      temp.foo("temp.class");

      but I get error when I call foo another way:

      temp.foo(temp.class);

       

      java.lang.RuntimeException: java.lang.ClassNotFoundException: Client (no security manager: RMI class loader disabled)

                at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:318)

                at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:415)

                at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)

                at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)

                at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)

                at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)

                at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)

                at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)

                at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)

                at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)

      Caused by: java.lang.ClassNotFoundException: Client (no security manager: RMI class loader disabled)

                at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)

                at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)

                at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)

                at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:91)

                at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)

                at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)

                at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)

                at java.io.ObjectInputStream.readClassDesc(Unknown Source)

                at java.io.ObjectInputStream.readClass(Unknown Source)

                at java.io.ObjectInputStream.readObject0(Unknown Source)

                at java.io.ObjectInputStream.readArray(Unknown Source)

                at java.io.ObjectInputStream.readObject0(Unknown Source)

                at java.io.ObjectInputStream.readObject(Unknown Source)

                at java.rmi.MarshalledObject.get(Unknown Source)

                at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:309)

                at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:415)

                at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)

                at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)

                at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)

                at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)

                at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)

                at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)

                at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)

                at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)

                at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:211)

                at org.jboss.remoting.Client.invoke(Client.java:1724)

                at org.jboss.remoting.Client.invoke(Client.java:629)

                at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)

                at $Proxy3.invoke(Unknown Source)

                at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)

                at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)

            at Client.main(Client.java:30)

                at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

                at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)

                at $Proxy3.invoke(Unknown Source)

                at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)

                at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)

                at Client.main(Client.java:30)

       

       

      also here is my client.policy :

      grant {

      permission java.security.AllPermission;

      };