Moving from CXF 2.2.9 to 2.3.0

13 views
Skip to first unread message

Dave Burbridge

unread,
Nov 26, 2018, 8:12:13 AM11/26/18
to fosstrak
I recently had another look at this. If you remember, the problem was that, in trying to update CXF/Hibernate/Spring, I found that all I could get when accessing the epcis-repository web service was "No services have been found." It would appear that either the web service is not being created properly, or it's not being registered properly.

I've tried all sorts of combinations, and now narrowed things down to a very simple change.

I went right back to the original epcis-repository version 0.5.0 code (from https://github.com/Fosstrak/fosstrak-epcis/archive/epcis-0.5.0.zip ). I compiled it under JDK 7u55, and ran it on Tomcat 6.0.39 (thus trying to approximately replicate what was current in 2010/11). I navigated to http://localhost:8080/epcis-repository-0.5.3-SNAPSHOT/query/?wsdl and got a proper valid wsdl file.

I then amended CXF version from 2.2.9 to 2.2.12 (in epcis-repository\pom.xml and epcis-commons\pom.xml), recompiled, and re-ran. Again, no problem.

Finally, I amended CXF to version 2.3.0, added commons-lang:commons-lang:2.5 as a dependency (since cxf-common-utilities 2.2.x calls it as a dependency, but 2.3.x doesn't, yet it's required in CaptureOperationsModule). Recompiled, ran, but this time on navigating to http://localhost:8080/epcis-repository-0.5.3-SNAPSHOT/query/?wsdl I get "No services have been found."

I've compared the two wars produced; the *only* differences are as follows:

Version changes:
cxf-api: 2.2.12 -> 2.3.0
cxf-common-schemas: 2.2.12 -> 2.3.0
cxf-common-utilities: 2.2.12 -> 2.3.0
cxf-rt-bindings-soap: 2.2.12 -> 2.3.0
cxf-rt-bindings-xml: 2.2.12 -> 2.3.0
cxf-rt-core: 2.2.12 -> 2.3.0
cxf-rt-databinding-jaxb: 2.2.12 -> 2.3.0
cxf-rt-databinding-jaxws: 2.2.12 -> 2.3.0
cxf-rt-frontend-jaxws: 2.2.12 -> 2.3.0
cxf-rt-transports-http: 2.2.12 -> 2.3.0
cxf-rt-transports-local: 2.2.12 -> 2.3.0
cxf-rt-ws-addr: 2.2.12 -> 2.3.0
cxf-tools-common: 2.2.12 -> 2.3.0
geronimo-javamail_1.4_spec: 1.6 -> 1.7.1

Removed:
geronimo-activation_1.1_spec: 1.0.2
geronimo-annotation_1.0_spec: 1.1.1
geronimo-jaxws_2.1_spec: 1.0
geronimo-stax-api_1.0_spec: 1.0.1
geronimo-ws-metadata_2.0_spec: 1.1.2
saaj-api: 1.3
saaj-impl: 1.3.2
wstx-asl: 3.2.9

Added:
stax2-api: 3.0.2
woodstox-core-asl: 4.0.8

I have turned on trace logging and compared the logfiles from running the two wars. Though there are differences, there is nothing obvious. There is clearly some change in the way in which CXF 2.3 operates compared with CXF 2.2. I have checked the migration guide at http://cxf.apache.org/docs/23-migration-guide.html but there is nothing there that jumps out - most of the changes mentioned seem to be of the nature "you can now do xyz if you want to", with the implication that continuing to do things as you previously did would still work. Areas I've particularly looked at to no avail are "Schema Validation support for Aegis Databinding if Woodstox 4 is used for the Stax parser" and "the new JAX-WS 2.2 and JAXB 2.2 features" (which seems to apply to Java 6, not Java 7).

I have also tried compiling on JDK8, and running on Tomcat 9, with the exactly the same effect - using CXF 2.2 works, using CXF 2.3 doesn't!

My theory is that there is some subtle difference in the beans being created. From the log files ("Checking bean..."), I can see that the following are created under 2.2:
cxf
org.apache.cxf.bus.spring.BusApplicationListener
org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor
org.apache.cxf.bus.spring.Jsr250BeanPostProcessor
org.apache.cxf.bus.spring.BusExtensionPostProcessor
org.apache.cxf.resource.ResourceManager
org.apache.cxf.configuration.Configurer
org.apache.cxf.binding.BindingFactoryManager
org.apache.cxf.transport.DestinationFactoryManager
org.apache.cxf.transport.ConduitInitiatorManager
org.apache.cxf.wsdl.WSDLManager
org.apache.cxf.phase.PhaseManager
org.apache.cxf.workqueue.WorkQueueManager
org.apache.cxf.buslifecycle.BusLifeCycleManager
org.apache.cxf.endpoint.ServerRegistry
org.apache.cxf.endpoint.ServerLifeCycleManager
org.apache.cxf.endpoint.ClientLifeCycleManager
org.apache.cxf.transports.http.QueryHandlerRegistry
org.apache.cxf.endpoint.EndpointResolverRegistry
org.apache.cxf.headers.HeaderManager
org.apache.cxf.catalog.OASISCatalogManager
org.apache.cxf.endpoint.ServiceContractResolverRegistry
org.apache.cxf.binding.soap.SoapBindingFactory
org.apache.cxf.binding.soap.SoapTransportFactory
org.apache.cxf.binding.soap.customEditorConfigurer
org.apache.cxf.transport.servlet.ServletTransportFactory
dataPropertyConfigurer
dataSource
hibernateSessionFactory
queryOperationsModule
queryOperationsWebService
captureOperationsModule
org.springframework.web.context.support.ServletContextAttributeExporter#0
EpcisQueryEndpoint
EpcisQueryLocalEndpoint
org.apache.cxf.transport.local.LocalTransportFactory#0
cxf.config0

and the following under 2.3:
cxf
org.apache.cxf.bus.spring.BusApplicationListener
org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor
org.apache.cxf.bus.spring.Jsr250BeanPostProcessor
org.apache.cxf.bus.spring.BusExtensionPostProcessor
org.apache.cxf.resource.ResourceManager
org.apache.cxf.configuration.Configurer
org.apache.cxf.binding.BindingFactoryManager
org.apache.cxf.transport.DestinationFactoryManager
org.apache.cxf.transport.ConduitInitiatorManager
org.apache.cxf.wsdl.WSDLManager
org.apache.cxf.phase.PhaseManager
org.apache.cxf.workqueue.WorkQueueManager
org.apache.cxf.buslifecycle.BusLifeCycleManager
org.apache.cxf.endpoint.ServerRegistry
org.apache.cxf.endpoint.ServerLifeCycleManager
org.apache.cxf.endpoint.ClientLifeCycleManager
org.apache.cxf.transports.http.QueryHandlerRegistry
org.apache.cxf.endpoint.EndpointResolverRegistry
org.apache.cxf.headers.HeaderManager
org.apache.cxf.catalog.OASISCatalogManager
org.apache.cxf.service.factory.FactoryBeanListenerManager <-- NOT IN 2.2
org.apache.cxf.endpoint.ServiceContractResolverRegistry
org.apache.cxf.binding.soap.SoapBindingFactory
org.apache.cxf.binding.soap.SoapTransportFactory
org.apache.cxf.binding.soap.customEditorConfigurer
org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder <-- NOT IN 2.2
org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder <-- NOT IN 2.2
org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider <-- NOT IN 2.2
org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory <-- NOT IN 2.2
org.apache.cxf.transport.servlet.ServletTransportFactory
dataPropertyConfigurer
dataSource
hibernateSessionFactory
queryOperationsModule
queryOperationsWebService
captureOperationsModule
org.springframework.web.context.support.ServletContextAttributeExporter#0
EpcisQueryEndpoint
EpcisQueryLocalEndpoint
org.apache.cxf.transport.local.LocalTransportFactory#0
cxf.config0

Again, almost identical apart from five beans ones under 2.3. So, do these do something that prevents another bean from doing its thing? Or is there some change in the way one of the other beans works so that web services no longer get created or registered properly?

I'm stumped...!

Reply all
Reply to author
Forward
0 new messages