[英]java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object
I have two web application, the first one RMIServer contains the following 我有两个Web应用程序,第一个RMIServer包含以下内容
public interface EasyPDFGeneratorRemoteInterface extends Remote {
public File generatePDFAmin(File sourceFile) throws RemoteException ;
}
public class EasyPDFGenerator extends UnicastRemoteObject
implements EasyPDFGeneratorRemoteInterface {
public File generatePDFAmin(File sourceFile) {
//implementation details....
}
then an object of type EasyPDFGenerator is registered in the registry. 然后在注册表中注册EasyPDFGenerator类型的对象。
And the Second contains 第二个包含
public interface EasyPDFGeneratorRemoteInterface extends Remote {
public File generatePDFAmin(File sourceFile) throws RemoteException ;
}
class test {
private File generatePDF(File file) {
File pdfFile = null;
try {
EasyPDFGeneratorRemoteInterface easyPDFGenerator = getRemoteEasyPDFGenerator();// get the remote object.
easyPDFGenerator.getClass.getMethods();// the array contains the method generatePDFAmin.
pdfFile = easyPDFGenerator.generatePDFAmin(file);// throws the exception.
} catch (RemoteException ex) {
}
}
}
I am not sure what could be causing the problem since am getting the remote object ,and it does contain the method that the UnmarshalException is thrown when it gets invoked. 我不确定是什么原因导致了此问题,因为正在获取远程对象,并且它确实包含调用UnmarshalException时抛出的方法。
You changed your remote interface definition without reploying all the .class files affected. 您无需重新部署所有受影响的.class文件即可更改了远程接口定义。 If you're using a generated stub, you didn't regenerate that either.
如果使用的是生成的存根,则也不会重新生成该存根。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.