Announcement Announcement Module
Collapse
No announcement yet.
ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationHand ler when ex Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationHand ler when ex

    I start rmiregistry.exe on required port and execute code below. However, exception is thrown. I use cglib and, I guess, this is somehow related to classloaders.
    When the same code is executed without rmiregistry started manually, everything works fine.

    Any ideas? Thanks.

    Code:
    	@Bean
    	public RmiServiceExporter serviceExporter() throws Exception {
    		Registry registry = java.rmi.registry.LocateRegistry.getRegistry(MainRMIService.RMI_PORT);
    		
    		RmiServiceExporter se = new RmiServiceExporter();
    		se.setServiceName("QuoteService");
    		se.setService(quoteService());
    		se.setServiceInterface(QuoteService.class);
    		se.setRegistry(registry);
    		se.afterPropertiesSet();
    		RmiInvocationHandler.class.getCanonicalName();
    		se.setBeanClassLoader(Thread.currentThread().getContextClassLoader());
    		
    		return se;
    	}
    Stacktrace:
    Code:
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    	java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationHandler
    	at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    	at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
    	at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    	at sun.rmi.transport.Transport$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at sun.rmi.transport.Transport.serviceCall(Unknown Source)
    	at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationHandler
    	at java.net.URLClassLoader$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Unknown Source)
    	at sun.rmi.server.LoaderHandler.loadProxyInterfaces(Unknown Source)
    	at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
    	at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
    	at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
    	at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
    	at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
    	at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
    	at java.io.ObjectInputStream.readClassDesc(Unknown Source)
    	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    	at java.io.ObjectInputStream.readObject0(Unknown Source)
    	at java.io.ObjectInputStream.readObject(Unknown Source)
    	... 12 more

  • #2
    Was there a resolution to this? I'm coming upon the same problem and I can't find any references to fixes in either the documentation or via Google.

    Comment

    Working...
    X