开发者

Apache CXF nightmare

I have a Spring Framework based application which we have previous deployed successfully and are adding new functionality. Our dev machines are JDK6 and Tomcat7. We are using Spring 3.1.0.M2. The old code uses Apache CXF 2.4.1 to provide web services and deploys onto our test severs which are Tomcat 5.0 and JDK5.

As part of the new functionality I did this spring web service client definition to access an external service

<bean id="urlWebService" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">
    <property name="serviceInterface" value="au.com.company.app.client.urlservice.UrlWebService" />
    <property name="wsdlDocumentUrl" value="http://dev.urlservice-int.services.company.com.au/v1_0/shortener?wsdl" />
    <property name="namespaceUri" value="http://urlservice.services.company.com.au/shortener" />
    <property name="serviceName" value="GenerateShortenedUrlWebServiceImplService" />
    <property name="portName" value="generateShortenedUrlWebServicePort" />
</bean>

But now when I try and deploy onto the test server I get:

Caused by: java.lang.AbstractMethodError: org.apache.xerces.dom.ElementNSImpl.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object;
    at org.apache.cxf.staxutils.StaxUtils.addLocation(StaxUtils.java:1083)
    at org.apache.cxf.staxutils.StaxUtils.rea开发者_高级运维dDocElements(StaxUtils.java:971)
    at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:947)
    at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:874)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)
    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
    at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
    at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
    at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:90)
    at javax.xml.ws.Service.<init>(Service.java:56)
    at javax.xml.ws.Service.create(Service.java:697)
    at org.springframework.remoting.jaxws.LocalJaxWsServiceFactory.createJaxWsService(LocalJaxWsServiceFactory.java:125)
    at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.prepare(JaxWsPortClientInterceptor.java:334)
    at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.afterPropertiesSet(JaxWsPortClientInterceptor.java:316)
    at org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean.afterPropertiesSet(JaxWsPortProxyFactoryBean.java:42)

I've been on this for two days now and have tried everything I can google and think of. The Tomcat 5.0 appears to have had an old version of Xerces installed in it's endoresed directories and CXF appears to be attempting to use.

Reality is that I don't want CXF involved at all with this spring client code. It's only there because of legacy code I cannot remove. I've not been able to figure out anyway way to get CXF to ignore this client. I cannot upgrade the server and JDK, or remove the old Xerces. I've attempted to include a later version of Xerces, and a wide range of other XML APIs in the hope that CXF will starting using one of them instead of Xerces, and I've tried any config type changes I can find. but so far nothing works.

Does anyone have any idea how to (a) stop CXF from getting it's hooks into this bean? or (b) tell CXF to at least not use the out of date Xerces?


You've forced that version of Xerces down CXF's throat via that old copy of Xerces in the Tomcat hierarchy. You need to upgrade the Xerces in tomcat -- that is how 'endorsed' works.

You cannot avoid using CXF for the web service client in Java 1.5. There's no built-in JAX-WS alternative. If you were running in 1.6, you could use the built-in provider instead.


Try using TomEE 1.5.2 for your tomcat server instead of tomcat 7.0.39, TomEE is setup to have all the jars in the lib and everything you need.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜