views:

907

answers:

2

Hi

I im developing a web application, its a servlet which basically acts as a front end for a web service, im using CXF for the web service client, the application is running on a WebLogic 9.10 server, every thing was working ok until the project owner decided to add ssl supprt, no big problem, since im using cxf whitout spring, i managed to configure the TLS parameters in the http conduit of the service client,also configured a keystore whit the server key, ca root certificate and a client certificate, tested under a development tomcat instance and worked fine.

Problems started when redeployed the app to the weblogic server again and started getting weird errors, first one was:

java.lang.ClassCastException: com.sun.xml.ws.client.sei.SEIStub cannot be cast to org.apache.cxf.frontend.ClientProxy
at org.apache.cxf.frontend.ClientProxy.getClient

then i realized than weblogic was loading its own implementation of JAX-WS, ok no probelm, just added a weblogic.xml whit "prefer-web-inf-classes" set to true, redeployed and now i got this exception:

java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.ws.Service.<init>(Ljava/net/URL;Ljavax/xml/namespace/QName;)V" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, com/adinfi/imgsvc/cm/service/CMBGenericWebServiceService, and the class loader (instance of <bootloader>) for resolved class, javax/xml/ws/Service, have different Class objects for the type javax/xml/namespace/QName used in the signature

That one got me, i thought something was wrong whit the class path,so i started removing jars from the application and still got some more linkage errors, last one i got is this:

java.lang.LinkageError: loader constraint violation: loader (instance of <bootloader>) previously initiated loading for a different type with name "org/w3c/dom/UserDataHandler"

and this is how the "Web-Inf/lib/" directory of my application looks like now:

   classes12.jar

   classes12.zip

   common.jar

   common.resources.jar

   commons-beanutils-1.8.0.jar

   commons-discovery.jar

   commons-logging-1.1.1.jar

   commons-logging-api.jar

   commons-logging-api-1.1.1.jar

   cxf-2.2.5.jar

   log4j-1.2.8.jar

   ras.jar

   runtimefw.jar

   wsdl4j-1.6.2.jar

   wss4j-1.5.8.jar

   xalan-2.7.1.jar

   xml-resolver-1.2.jar

   XmlSchema-1.4.5.jar

   xmlsec-1.4.3.jar

Any idea what im doing wrong? thanks in advance

+2  A: 

Rollback the prefer-web-inf-classes stuff and follow the WebLogic specific instructions from the Application Server Specific Configuration Guide of CXF's documentation. More precisely, provide a weblogic-application.xml as explained in the second option Pack war in an ear, deploy the ear with weblogic-application.xml with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application xmlns="http://www.bea.com/ns/weblogic/90"&gt;
    <application-param>
     <param-name>webapp.encoding.default</param-name>
     <param-value>UTF-8</param-value>
    </application-param>
    <prefer-application-packages>
     <package-name>javax.jws.*</package-name>
    </prefer-application-packages>
</weblogic-application>

Follow the additional steps of this post if required.

Pascal Thivent
Wow somehow managed to miss that piece of documentation....right now im off to my work, will try immediately, thanks for reply =)
Harima555
A: 

Hi, I am pretty much in the same case. I am developing a web application, its a servlet which basically acts as a front end for a web service, I use CXF for the web service client, tested under a development tomcat instance and worked fine. while I try to migrate to weblogic 10.3.2 follow the change as in http://cxf.apache.org/docs/application-server-specific-configuration-guide.html#ApplicationServerSpecificConfigurationGuide-WebLogic

Then I got the exception: java.lang.IncompatibleClassChangeError: Class com.ibm.wsdl.DefinitionImpl does not implement the requested interface javax.wsdl.extensions.AttributeExtensible at org.apache.cxf.wsdl11.WSDLServiceBuilder.copyExtensionAttributes(WSDLServiceBuilder.java:137) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:277)

I have the spring framework and the rest jars in the lib:

wsdl4j-1.6.1.jar wss4j-1.5.8.jar jaxb-api-2.0.jar cxf-2.2.3.jar

I have been research on this problem for a while, found some posts from experts like Dan on Nable... but I still didn't get it, could anyone help on this.

Thanks, Joel

Joel King