问题
I have a problem when I use both cxf and cxf-client together. The cxf says that it can't find any services. When I comment the configuration for the cxf-client the cxf finds the services.
The configuration for the servlet is the standard configuration. The configuration for the client made from EU TIN service.
The two plugins works find seperately but not together. Have anyone find a solution for this problem ?
Using grails version 2.3.7 Cxf version 1.1.4 cxf-client 1.6.1
回答1:
I managed to get around the same problem by modifying CXF client plugin a bit. In WebServiceClientFactoryImpl modify creating JaxWSProxyFactoryBean as follows:
Bus bus = Holders.grailsApplication.mainContext.getBean("cxf") as Bus
JaxWsProxyFactoryBean clientProxyFactory = new JaxWsProxyFactoryBean(serviceClass: serviceInterface,
address: serviceEndpointAddress, bus: bus)
CXF plugin creates that 'cxf' bean which is of type org.apache.cxf.bus.spring.SpringBus. CXF client creates (by default) another bus which seems to break CXF web service. By using the same bus in CXF client the problem was solved.
来源:https://stackoverflow.com/questions/26470223/cant-get-cxf-and-cxf-client-to-work-at-the-same-time-grails