[Solved] java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.internal.ws.api.BindingID

Error Messages:

16:47:56.249 [http-nio-8099-exec-9] ERROR invoking [Service:sys.login:public abstract java.lang.String com.icitic.sys.api.login.LoginService.jumpUrl(java.lang.String,ja
va.lang.String)] failed c.i.c.s.internal.ServiceRegistry
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.internal.ws.api.BindingID
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseBinding(RuntimeWSDLParser.java:445) ~[na:1.7.0_79]
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:342) ~[na:1.7.0_79]
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:157) ~[na:1.7.0_79]
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:120) ~[na:1.7.0_79]
at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:258) ~[na:1.7.0_79]
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:221) ~[na:1.7.0_79]
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:169) ~[na:1.7.0_79]
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:101) ~[na:1.7.0_79]
at javax.xml.ws.Service.<init>(Service.java:77) ~[na:1.7.0_79]

 

Solution:

the solution is to get rid of saaj-impl-1.3.2.jar and saaj-api-1.3.jar libraries from OUR_SERVICE_APP and’force’ it to use rt.jar / JDK implementations instead.

The solution is to remove the saaj-impl-1.3.2.jar and saaj-api-1.3.jar libraries from our _service_application and “force” it to use rt.jar/JDK.

However, since these two jar packages are provided by other third-party applications, they cannot be deleted. It is recommended to develop by writing a custom ClassLoader, and load it into the specified JAR first through the custom ClassLoader, and delegate the rest to the parent class loader to load.

Similar Posts: