I am introducing the support of WS-Security with Spring using Apache CXF. Application runs on Weblogic 10.3.6.
Our build.gradle file :-
compile("org.springframework:spring-web:4.2.6.RELEASE")
compile("org.springframework:spring-core:4.2.6.RELEASE")
compile("org.springframework:spring-beans:4.2.6.RELEASE")
compile("org.springframework:spring-jms:4.2.6.RELEASE")
compile("org.springframework:spring-orm:4.2.6.RELEASE")
compile("org.apache.cxf:cxf-rt-transports-http:3.1.6")
compile("org.apache.cxf:cxf-rt-bindings-soap:3.1.6")
compile("org.apache.cxf:cxf-rt-frontend-simple:3.1.6")
compile("org.apache.cxf:cxf-rt-frontend-jaxws:3.1.6")
compile("org.apache.cxf:cxf-rt-ws-addr:3.1.6")
compile("org.hibernate:hibernate-core:5.1.0.Final")
compile("commons-lang:commons-lang:2.6")
compile("org.apache.ws.security:wss4j:1.6.10")
compile("xalan:xalan:2.7.2")
During the implementation, I encountered the following error :-
java.lang.ClassNotFoundException: org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
So I introduced the following dependency to resolve the exception
compile("org.apache.cxf:cxf-rt-ws-security:3.1.6")
However, rebuilding and redeploying the application I encounter the following exception :-
Caused By: java.lang.LinkageError: loader constraint violation: when resolving overridden method "com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Ljavax/xml/stream/XMLEventReader;)Ljava/lang/Object;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, com/sun/xml/bind/v2/runtime/unmarshaller/UnmarshallerImpl, and its superclass loader (instance of <bootloader>), have different Class objects for the type allerImpl.unmarshal(Ljavax/xml/stream/XMLEventReader;)Ljava/lang/Object; used in the signature
I presume this is a ClassLoader issue, with the unmarshal() in class UnmarshallerIml.
I am surprised by introducing compile("org.apache.cxf:cxf-rt-ws-security:3.1.6") I am encountering this exception.
I would very much appreciate any suggestion on the cause and possible solution to this error.
Thank you in advance for your help.
Pete