Why do I see this when deploying CXF web service client application to weblogic 9.2
Caused by NoClassDefFoundError: null
->> 350 | newInstance0 in java.lang.Class
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 303 | newInstance in ''
| 36 | newInstance . in javax.xml.ws.spi.FactoryFinder
| 95 | find in ''
| 82 | provider . . . in javax.xml.ws.spi.Provider
| 56 | <init> in javax.xml.ws.Service
Running with WebLogic Server with Java HotSpot(TM) Server VM Version 1.5.0_10-b03
The deployment has jaxws-rt-2.1.3.jar with com/sun/xml/ws/spi/ProviderImpl.class The deployment has cxf-rt-frontend-jaxws-2.1.3.jar with org/apache/cxf/jaxws/spi/ProviderImpl
I found this issue when these dependencies were missing, but they are not missing in this case.
I do deploy the war with WEB-INF/weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app
xmlns="http://www.bea.com/ns/weblogic/90"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
I found two jars in the application WEB-INF that were not compatible as they both implement classes
javax.xml.ws.spi.FactoryFinder
javax.xml.ws.spi.Provider
javax.xml.ws.Service
The two conflicting jar were
jaxws-api-2.1.jar
geronimo-jaxws_2.2_spec-1.0.jar
I removed the jaxws-api-2.1.jar and was able to get past the issue.