title: Could not start jstatd on ubuntu server
body: <p>I want to setup two servers with jstatd running so I can monitoring my applications on the fly. The web server have been up and running, but another server always get some exceptions like this.</p>
  
  <blockquote>
    <p>Could not bind /JStatRemoteHost to RMI Registry
    java.rmi.ServerException: RemoteException occurred in server thread;
    nested exception is:      java.rmi.UnmarshalException: error
    unmarshalling arguments; nested exception is: 
      java.lang.ClassNotFoundException:
    sun.jvmstat.monitor.remote.RemoteHost (no security manager: RMI class
    loader disabled)  at
    sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:419)
      at
    sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
      at sun.rmi.transport.Transport$1.run(Transport.java:177)    at
    sun.rmi.transport.Transport$1.run(Transport.java:174)     at
    java.security.AccessController.doPrivileged(Native Method)    at
    sun.rmi.transport.Transport.serviceCall(Transport.java:173)   at
    sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
      at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
      at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
      at
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:722)    at
    sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
      at
    sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:377)    at
    sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)     at
    java.rmi.Naming.rebind(Naming.java:177)   at
    sun.tools.jstatd.Jstatd.bind(Jstatd.java:57)  at
    sun.tools.jstatd.Jstatd.main(Jstatd.java:143) Caused by:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested
    exception is:     java.lang.ClassNotFoundException:
    sun.jvmstat.monitor.remote.RemoteHost (no security manager: RMI class
    loader disabled)  at
    sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)   at
    sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
      at
    sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
      at sun.rmi.transport.Transport$1.run(Transport.java:177)    at
    sun.rmi.transport.Transport$1.run(Transport.java:174)     at
    java.security.AccessController.doPrivileged(Native Method)    at
    sun.rmi.transport.Transport.serviceCall(Transport.java:173)   at
    sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
      at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
      at
    sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
      at
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:722) Caused by:
    java.lang.ClassNotFoundException:
    sun.jvmstat.monitor.remote.RemoteHost (no security manager: RMI class
    loader disabled)  at
    sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:554)
      at
    java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:646)
      at
    java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:311)
      at
    sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:263)
      at
    java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1556)
      at
    java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1512)
      at
    java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
      ... 13 more</p>
  </blockquote>
  
  <p>I am sure jstatd loaded the policy file which content is </p>
  
  <blockquote>
    <p>grant codebase "file:${java.home}/../lib/tools.jar" {    permission
    java.security.AllPermission; };</p>
  </blockquote>
  
  <p>I cannot figure whats the problem come from, please help.</p>