Java.lang.ClassNotFoundException:org.springframework.remoting.rmi.RmiInvocationWrapper_Stub

Source: Internet
Author: User

Org.springframework.remoting.RemoteLookupFailureException:Lookup of RMI stub failed; Nested exception is java.rmi.UnmarshalException:error unmarshalling return; Nested exception is:
Java.lang.ClassNotFoundException:org.springframework.remoting.rmi.RmiInvocationWrapper_Stub (no security Manager: RMI class loader disabled)

This exception occurs when the Dubbo call uses the RMI protocol to invoke the interface. The root cause of the anomaly lies in the differences between Spring2 and Spring3 source code, remove the Rmiinvocationwrapper_stub the class, can be copied from the source to play jar package from the new deployment.

 PackageOrg.springframework.remoting.rmi;Importjava.io.IOException;ImportJava.io.ObjectInput;ImportJava.io.ObjectOutput;Importjava.lang.reflect.InvocationTargetException;ImportJava.lang.reflect.Method;Importjava.rmi.MarshalException;ImportJava.rmi.Remote;Importjava.rmi.RemoteException;Importjava.rmi.UnexpectedException;Importjava.rmi.UnmarshalException;Importjava.rmi.server.Operation;ImportJava.rmi.server.RemoteCall;ImportJava.rmi.server.RemoteObject;ImportJava.rmi.server.RemoteRef;Importjava.rmi.server.RemoteStub;Importorg.springframework.remoting.support.RemoteInvocation; Public Final classRmiinvocationwrapper_stubextendsremotestubImplementsrmiinvocationhandler{Private Static FinalOperation[] Operations = {NewOperation ("Java.lang.String gettargetinterfacename ()"),NewOperation ("Java.lang.Object Invoke (Org.springframework.remoting.support.RemoteInvocation)") }; Private Static Final LongInterfacehash = -1910731558l; Private Static Final LongSerialversionuid = 2L; Private Static BooleanUsenewinvoke; Private StaticMethod $method _gettargetinterfacename_0; Private StaticMethod $method _invoke_1; Static  {    Try{Tmp48_45.getmethod ("Invoke",NewClass[] {Remote.class, Method.class, Rmiinvocationwrapper_stub.array$ljava$lang$object =class$ ("[Ljava.lang.Object;"), long.type}); Usenewinvoke=true; $method _gettargetinterfacename_0= Rmiinvocationhandler.class. GetMethod ("Gettargetinterfacename",NewClass[0]); $method _invoke_1= Tmp194_191.getmethod ("Invoke",NewClass[] {remoteinvocation.class }); }    Catch(nosuchmethodexception localnosuchmethodexception) {Usenewinvoke=false; }  }   Publicrmiinvocationwrapper_stub (Remoteref paramremoteref) {Super(PARAMREMOTEREF); }   PublicString gettargetinterfacename ()throwsRemoteException {Try{String str; if(usenewinvoke) {LocalObject1= This. Ref.invoke ( This, $method _gettargetinterfacename_0,NULL, 370039408L); return(String) localObject1); } Object LocalObject1= This. Ref.newcall ( This, operations, 0, -1910731558l);  This. Ref.invoke ((Remotecall) localObject1); Try{objectinput Localobjectinput=((Remotecall) localObject1). getInputStream (); STR=(String) localobjectinput.readobject (); }      Catch(IOException localioexception) {Throw NewUnmarshalexception ("Error unmarshalling return", localioexception); }      Catch(ClassNotFoundException localclassnotfoundexception) {Throw NewUnmarshalexception ("Error unmarshalling return", localclassnotfoundexception); }      finally      {         This. Ref.done ((Remotecall) localObject1); }      returnstr; }    Catch(RuntimeException localruntimeexception) {Throwlocalruntimeexception; }    Catch(RemoteException localremoteexception) {Throwlocalremoteexception; }    Catch(Exception localexception) {Throw NewUnexpectedexception ("Undeclared checked exception", localexception); }  }   PublicObject Invoke (remoteinvocation paramremoteinvocation)throwsillegalaccessexception, Nosuchmethodexception, InvocationTargetException, remoteexception {Try{Object localObject2; if(usenewinvoke) {LocalObject1= This. Ref.invoke ( This, $method _invoke_1,NewObject[] {paramremoteinvocation}, -1509252135l); returnLocalObject1; } Object LocalObject1= This. Ref.newcall ( This, operations, 1, -1910731558l); Try{objectoutput Localobjectoutput=((Remotecall) localObject1). Getoutputstream ();      Localobjectoutput.writeobject (paramremoteinvocation); }      Catch(IOException localIOException1) {Throw NewMarshalexception ("Error marshalling arguments", LocalIOException1); }       This. Ref.invoke ((Remotecall) localObject1); Try{objectinput Localobjectinput=((Remotecall) localObject1). getInputStream (); LocalObject2=Localobjectinput.readobject (); }      Catch(IOException localIOException2) {Throw NewUnmarshalexception ("Error unmarshalling return", LocalIOException2); }      Catch(ClassNotFoundException localclassnotfoundexception) {Throw NewUnmarshalexception ("Error unmarshalling return", localclassnotfoundexception); }      finally      {         This. Ref.done ((Remotecall) localObject1); }      returnLocalObject2; }    Catch(RuntimeException localruntimeexception) {Throwlocalruntimeexception; }    Catch(RemoteException localremoteexception) {Throwlocalremoteexception; }    Catch(illegalaccessexception localillegalaccessexception) {Throwlocalillegalaccessexception; }    Catch(nosuchmethodexception localnosuchmethodexception) {Throwlocalnosuchmethodexception; }    Catch(InvocationTargetException localinvocationtargetexception) {Throwlocalinvocationtargetexception; }    Catch(Exception localexception) {Throw NewUnexpectedexception ("Undeclared checked exception", localexception); }  }}

Java.lang.ClassNotFoundException:org.springframework.remoting.rmi.RmiInvocationWrapper_Stub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.