My suggestion is your endpoint publishing code need be put into the
AbcCxfServlet, so you could get the full control of the bus.
BTW, CXFNoSpringServlet will replace Jetty http transport factory with
the servlet transport factory.
You need to call the
BusFactory.setDefaultBus(bus);
just before
Endpoint.publish(endpointUrl, new UserAccountServiceImpl());
If you call the publishing code in another servlet which could load by another
classloader, CXF will create another bus for this endpoint.
The service url should be a related path, such as "/users". CXF don't
know the application's name, so it will update the endpoint's address
with the request url and the related path is the best way to resolve
this problem.
Willem
[EMAIL PROTECTED] wrote:
Ok,
I made some progress today:
<servlet>
<servlet-name>CXFServlet</servlet-name>
<display-name>CXF Web services Servlet</display-name>
<servlet-class>cz.abclinuxu.servlets.ws.AbcCxfServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
public class AbcCxfServlet extends CXFNonSpringServlet {
public void init(ServletConfig servletConfig) throws ServletException {
super.init(servletConfig);
Bus bus = this.getBus();
BusFactory.setDefaultBus(bus);
}
}
some other servlet loaded later:
String endpointUrl = "http://"+getHostname()+"/services/users";
Endpoint.publish(endpointUrl, new UserAccountServiceImpl());
@WebService(endpointInterface = "cz.abclinuxu.servlets.ws.UserAccountService",
serviceName = "Users")
public class UserAccountServiceImpl implements UserAccountService {
saaj-impl-1.3.jar wsdl4j-1.6.1.jar wstx-asl-3.2.4.jar xml-resolver-1.2.jar
cxf-2.0.5-incubator.jar jaxb-api-2.0.jar saaj-api-1.3.jar
xml-resolver-1.2.jar
geronimo-annotation_1.0_spec-1.1.1.jar jaxb-impl-2.0.5.jar saaj-impl-1.3.jar
XmlSchema-1.3.2.jar
geronimo-stax-api_1.0_spec-1.0.1.jar jaxws-api-2.0.jar wsdl4j-1.6.1.jar
geronimo-ws-metadata_2.0_spec-1.1.2.jar neethi-2.0.2.jar wstx-asl-3.2.4.jar
When I start jetty:
24.4.2008 19:04:27 org.apache.cxf.transport.servlet.CXFNonSpringServlet
loadBusNoConfig
INFO: Load the bus without application context
24.4.2008 19:04:28 org.apache.cxf.transport.servlet.AbstractCXFServlet
replaceDestinationFactory
INFO: Replaced the http destionFactory with servlet transport factory
24.4.2008 19:04:28 org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
INFO: Creating Service {http://ws.servlets.abclinuxu.cz/}Users from class
cz.abclinuxu.servlets.ws.UserAccountServiceImpl
24.4.2008 19:04:30 org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
INFO: {http://ws.servlets.abclinuxu.cz/}arg0 part element name
{http://ws.servlets.abclinuxu.cz/}arg0 references element
{http://ws.servlets.abclinuxu.cz/}arg0
{http://ws.servlets.abclinuxu.cz/}arg1 part element name
{http://ws.servlets.abclinuxu.cz/}arg1 references element
{http://ws.servlets.abclinuxu.cz/}arg1
24.4.2008 19:04:30 org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be http://localhost/services/users
2008-04-24 19:04:42.618::INFO: Started [EMAIL PROTECTED]:8080
24.4.2008 19:04:51 org.apache.cxf.transport.servlet.ServletController invoke
WARNING: Can't find the the request for http://localhost:8080/services/users's
Observer
What's wrong?
Leos