Hi there, Is it possible to use CXF with Tomcat and without Spring?
I suppose you mean to create a Web Service with CFX that it would run in Tomcat? This is totally possible and Spring is optional. You don't have to use it, if you don't want to.
CXF is meant to be used with spring. It is strange you want to use it without it.
You could try NoSpringServletServer and use the ServerFactoryBean or JaxWS API.
There is an example on the CXF source distribution on:
But you will still need spring as a dependency. The basic JaxWS can be done without spring. But for almost anything else you will need at the very least spring-core.jar
I dont think it is possible to use CXF completely independent of spring in Tomcat.
Reason is that when I do a Maven dependency tree list (mvn dependency:tree) for a bare minimum CXF webservice, the following is listed (which shows that it needs Spring)
+- org.apache.cxf:cxf-rt-core:jar:2.2.2:compile
[INFO] | | +- com.sun.xml.bind:jaxb-impl:jar:2.1.9:compile
[INFO] | | +- org.springframework:spring-core:jar:2.5.5:compile
[INFO] | | +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.6:compile
org.apache.cxf:cxf-rt-transports-http:jar:2.2.2:compile
[INFO] \- org.springframework:spring-web:jar:2.5.5:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
You can configure CXF programmatically without Spring. See the code examples here. Putting the web application context path together with the end point extension--Greeter in the code example--will display a summary page in the browser with a link to the WSDL.
No Spring necessary, giving CXF a very small footprint. I found the only jars necessary to be (for CXF 2.2.1):
- XmlSchema-1.4.5.jar
- cxf-2.2.3.jar
- wsdl4j-1.6.2.jar
I believe neethi-2.0.4.jar may also be necessary for some configurations, but I haven't needed it.
Have fun!