Hi Andreas,
From your stack trace , I think you did not use the right bus when you
publish the endpoint.
Because it uses the JettyHttpTransportFactory , not the
CXFServletTransportFactory
Can you get the CXFServlet's reference cxfServlet?
If so , you can take a look at this blew codes, which just uses the
cxfServlet already loaded bus.
BusFactory.setThreadDefaultBus(cxfServlet.getBus());
Endpoint.publish("/Greeter", new GreeterImpl());
BusFactory.setThreadDefaultBus(null);
Willem.
Andreas Bucksteeg wrote:
Hi,
I have the same problem and I understand what the code should do, but I
dont see, how I should get access to the CXFServlet from my code.
I am trying to setup my service using the CXFServlet running in an
Tomcat using the Endpoint API.
http://cwiki.apache.org/CXF20DOC/servlet-transport.html describes to
configure the servlet in the web.xml of the webapp and then just to use
Endpoint.publish("/Greeter", new GreeterImpl());
I am not sure, where to put this code. For tests I used a jsp in the
webapp I configured the CXFServlet and using the above line results in:
java.net.MalformedURLException: no protocol: /HelloWorldService
java.net.URL.<init>(URL.java:567)
java.net.URL.<init>(URL.java:464)
java.net.URL.<init>(URL.java:413)
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.<init>(JettyHTT
PDestination.java:86)
org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDest
ination(JettyHTTPTransportFactory.java:96)
org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestina
tion(JettyHTTPTransportFactory.java:83)
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTran
sportFactory.java:74)
How should I get the CXFServlet to set its bus as the default bus?
I search the docs and the mailing list, some people had the same problem
to get CXFServlet running without xml configuration in Tomcar, but I
havent found a solution yet...
Any ideas?
Cheers,
Andreas