title: Spring RMI error java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationHandler
body: <p>I am trying to create some beans using <code>Spring</code> and export them to RMI...</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;bean class="org.springframework.remoting.rmi.RmiServiceExporter"&gt;
      &lt;property name="serviceName" value="OfferService" /&gt;
      &lt;property name="service" ref="offerService" /&gt;
      &lt;property name="serviceInterface" value="ro.project.services.OfferService" /&gt;
      &lt;property name="registryPort" value="1199" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I created a file called "policy.all" in my root folder and I am running my VM with that arguments but I still have this error:</p>
  
  <pre><code>java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationHandler (no security manager: RMI class loader disabled)
  </code></pre>
  
  <p>I don't know what to do... in linux, the exact same project is running ok (with jdk 1.7.0.4) but in windows not... in java 1.5 (windows) it's working.. but in java 1.7.0.4 (windows) it's not working...</p>
  
  <p><strong>EDITED:</strong></p>
  
  <p>My error is:</p>
  
  <pre><code>Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.rmi.RmiServiceExporter#0' defined in class path resource [spring/services.xml]: Invocation of init method failed; nested exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
  java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
  java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationHandler (no security manager: RMI class loader disabled)
  </code></pre>
  
  <p>After adding this lines:</p>
  
  <pre><code>if (System.getSecurityManager() == null)
  { 
      RMISecurityManager manager = new RMISecurityManager();
      System.setSecurityManager(manager); 
  }
  </code></pre>
  
  <p>I have this error:</p>
  
  <pre><code>Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring/application-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/application-context.xml] cannot be opened because it does not exist
  </code></pre>
  
  <p>thank you in advance</p>