我在 websphere 8.5 中使用 spring/wss4j 来实现 web 服务安全。Wss4j 需要 xmlsec.jar,我在 WEB-INF/lib/xmlsec-2.0.4.jar 下包含了 xmlsec.jar。但是 websphere 类加载器找不到 DOMXMLSignatureFactory。
Caused by: java.lang.ClassNotFoundException: org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:599) ~[na:1.7.0]
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:204) ~[bootstrap.jar:WAS855.SERV1 [cf011339.02]]
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:760) ~[na:1.7.0]
at java.lang.ClassLoader.loadClass(ClassLoader.java:737) ~[na:1.7.0]
at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:119) ~[bootstrap.jar:WAS855.SERV1 [cf011339.02]]
at java.lang.ClassLoader.loadClass(ClassLoader.java:707) ~[na:1.7.0]
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62) ~[com.ibm.ws.runtime.jar:WAS855.SERV1 [cf011339.02]]
at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58) ~[com.ibm.ws.runtime.jar:WAS855.SERV1 [cf011339.02]]
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:616) ~[com.ibm.ws.runtime.jar:WAS855.SERV1 [cf011339.02]]
at java.lang.ClassLoader.loadClass(ClassLoader.java:707) ~[na:1.7.0]
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:616) ~[com.ibm.ws.runtime.jar:WAS855.SERV1 [cf011339.02]]
at java.lang.ClassLoader.loadClass(ClassLoader.java:707) ~[na:1.7.0]
at javax.xml.crypto.dsig.XMLDSigSecurity.doGetImpl(XMLDSigSecurity.java:181) ~[na:na]
... 98 common frames omitted
我正在为 APPLICATION 和 MODULE 设置 PARENT_LAST。Xmlsec-2.0.4.jar 显示在“类加载器查看器”下。我检查了我所有的库,没有重复的 DOMXMLSignatureFactory 类。有人可以帮帮我吗!