Results 1 to 4 of 4
  1. #1
    Xorty is offline Member
    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

    Default Java: no security manager: RMI class loader disabled

    Hi I have RMI application and now I try to invoke some methods at server from my client. I have following code:

    Java Code:
      public static void main(final String[] args) {
    		try {
    			System.setSecurityManager(new RMISecurityManager());
    			IndicatorsService server = (IndicatorsService) Naming
    					.lookup("rmi://localhost/" + IndicatorsService.SERVICE_NAME);
    			DataProvider provider = new OHLCProvider(server);
    			server.registerOHLCProvider(provider);
    		} catch (MalformedURLException e) {
    			e.printStackTrace();
    		} catch (RemoteException e) {
    			e.printStackTrace();
    		} catch (NotBoundException e) {
    			e.printStackTrace();
    		}
    	}
    server Is correctly loaded, but when I am trying to call `server.registerOHLCProvider(provider);` I get these errors:



    Java Code:
      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
        	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
        	java.lang.ClassNotFoundException: sk.xorty.client.providers.OHLCProvider (no security manager: RMI class loader disabled)
        	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:336)
        	at sun.rmi.transport.Transport$1.run(Transport.java:159)
        	at java.security.AccessController.doPrivileged(Native Method)
        	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
        	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
        	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
        	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        	at java.lang.Thread.run(Thread.java:662)
        	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
        	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
        	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
        	at sk.fri.statistics.service.impl.IndicatorsServiceImpl_Stub.registerOHLCProvider(Unknown Source)
        	at sk.fri.statistics.service.Client.main(Client.java:61)
        Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
        	java.lang.ClassNotFoundException: sk.xorty.client.providers.OHLCProvider (no security manager: RMI class loader disabled)
        	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:296)
        	at sun.rmi.transport.Transport$1.run(Transport.java:159)
        	at java.security.AccessController.doPrivileged(Native Method)
        	at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
        	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
        	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
        	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        	at java.lang.Thread.run(Thread.java:662)
        Caused by: java.lang.ClassNotFoundException: sk.xorty.client.providers.OHLCProvider (no security manager: RMI class loader disabled)
        	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:375)
        	at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
        	at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
        	at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
        	at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
        	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)
        	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
        	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
        	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
        	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
        	at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
        	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:290)
        	... 9 more

    I have added my policy file as VM argument, here is how it looks like:

    Java Code:
     grant {
        	permission java.security.AllPermission;
        }
    It keeps saying something about disabled classloading, so I guess problem is somewhere there ...
    Thanks!

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,331
    Rep Power
    25

    Default

    Does this part of the message show any thing useful:
    ClassNotFoundException: sk.xorty.client.providers.OHLCProvider

  3. #3
    Xorty is offline Member
    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

    Default

    No it doesn't. It's just simple interface implementation. I replaced it with anonymous implementation in same method, but no difference (it just complaimend about another class not OHLCProvider)

  4. #4
    Xorty is offline Member
    Join Date
    Jun 2011
    Posts
    3
    Rep Power
    0

Similar Threads

  1. which class loader cexecutes first
    By katturv in forum New To Java
    Replies: 1
    Last Post: 01-10-2011, 06:30 AM
  2. java.system.class.loader Not Working
    By kg1 in forum Advanced Java
    Replies: 2
    Last Post: 12-06-2010, 09:41 PM
  3. Replies: 6
    Last Post: 09-20-2010, 07:46 AM
  4. Question on java.security.manager
    By Lil_Aziz1 in forum New To Java
    Replies: 9
    Last Post: 06-07-2010, 03:50 AM
  5. Class loader
    By JavaJunkie in forum New To Java
    Replies: 1
    Last Post: 05-06-2009, 01:17 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •