Hi ,

I am sorry to reply your letter so late. If you still not find a solution yet, please take a look at my suggestion.

Yes, CXFServlet will try to load a bus without spring support.
But before you use the JAXWS Endpoint.publish() API , you need to setup the default bus with the CXFServlet bus.
The code could be

       CXFServlet servlet = getCXFServlet();
       ......
       Bus bus = servlet.getBus();
       BusFactory.setDefaultBus(bus);
       ......
       Endpoint endpoint = Endpoint.create(new GreeterImpl());
       endpoint.publish(address);
       ......


Willem.
Yeroc wrote:
All...

I've been trying to create a web service deployed as a .war file to a Tomcat
v5.5 container whilst avoiding the usage of the Spring xml config.  The
documentation at http://cwiki.apache.org/CXF20DOC/servlet-transport.html
suggests it is possible to use the CXFServlet in this configuration using
the API to publish the Endpoint (see the "Publishing an endpoint with the
API" sub-section). I haven't been able to get this to work successfully. My first attempt used a ServletContextListener (similar to what Spring does)
and called Endpoint.publish() from there but doing that resulted in CXF
attempting to fire up Jetty from within Tomcat (I assume this is because my
code was running before the servlet was initialized.)  My second attempt is
calling the Endpoint.publish() from within a servlet filter but the
CXFServlet seems to be looking for a JNDI server on port 1099 that doesn't
exist.

Is what I'm attempting to do possible?  How do I initialize things
appropriately via the API when using the servlet in a container?

Incidentally, the documentation suggests Spring isn't a required dependency
but the CXFServlet can't be instantiated without Spring being on the
classpath due to it relying on a number of Spring classes.  Is this an
oversight that will be corrected in the future?

Thanks for your help,
Corey

Reply via email to