gpt4 book ai didi

java.rmi.UnmarshalException : unrecognized method hash: method not supported by remote object 错误

转载 作者:行者123 更新时间:2023-11-29 05:01:10 25 4
gpt4 key购买 nike

我有两个 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....
}

然后在注册表中注册一个 EasyPDFGenerator 类型的对象。

第二个包含

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) {

}

}
}

我不确定是什么导致了问题,因为我正在获取远程对象,并且它确实包含调用时抛出 UnmarshalException 的方法。

最佳答案

您更改了远程接口(interface)定义,但没有重新部署所有受影响的 .class 文件。如果您使用的是生成的 stub ,则您也没有重新生成它。

关于java.rmi.UnmarshalException : unrecognized method hash: method not supported by remote object 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32047232/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com