org.apache.xmlrpc.server.XmlRpcServer失败,传入请求出现NoSuchMethod异常:
Caused by: java.lang.NoSuchMethodError: org.apache.xml.serializer.Encodings.isRecognizedEncoding(Ljava/lang/String;)Z
api-server_1 | at org.apache.xml.serializer.dom3.LSSerializerImpl.write(LSSerializerImpl.java:926)
classpath包括
xalan-j2-serializer.jar
与
sh-4.2# jar tvf xalan-j2-serializer.jar | grep Encodings
7717 Tue Jan 01 00:00:00 UTC 1980 org/apache/xml/serializer/Encodings.class
11598 Tue Jan 01 00:00:00 UTC 1980 org/apache/xml/serializer/Encodings.properties
Encodings.class反编译:
sh-4.2# javap org.apache.xml.serializer.Encodings
Compiled from "Encodings.java"
public final class org.apache.xml.serializer.Encodings {
...
public org.apache.xml.serializer.Encodings();
...
public static boolean isRecognizedEncoding(java.lang.String);
...
服务器正在Centos:7映像上的docker中运行。 OpenJDK Java 8。 客户端是一个Python2.7脚本,调用xmlrpclib.ServerProxy。