I think your web.xml would just be something like:
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>com.test.HelloWorldServer</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Dan
On Thu February 18 2010 6:32:48 pm SaravananRamamoorthy wrote:
> Hi Johan Edstrom,
>
>
> After creating HelloWorld webservice class. I have created a class called
> HelloWorldServer that extends extends CXFNonSpringServlet and override the
> loadBus method.
>
> CXFServlet cxf= new CXFServlet();
> Bus bus = cxf.getBus();
> BusFactory.setDefaultBus(bus);
> Endpoint.publish("/helloworld", new HelloWorld());
>
>
> and in web.xml I have mapped the HelloWorldServer like
>
> <servlet>
> <servlet-name>CXFServlet</servlet-name>
>
> <servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servl
> et-class> <init-param>
>
> <param-name>org.apache.cxf.transport.servlet.CXFNonSpringServlet</param-nam
> e> <param-value>com.test.HelloWorldServer</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>CXFServlet</servlet-name>
> <url-pattern>/*</url-pattern>
> </servlet-mapping>
>
> I try to retrieve the wsdl from browser like
> http://localhost:8080/testapplication/helloworld , It throws
>
> javax.servlet.ServletException: At least one resource class should be
> specified
>
> Am I missing something?
>
> Regards
> Saravanan
>
>
>
>
>
>
>
>
>
>
>
> Object implementor = new HelloWorld();
> String address = "/sara";
> Endpoint.publish(address, implementor);
>
> Johan Edstrom-3 wrote:
> > Have you configured web.xml?
> >
> > Look here :
> > http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/resourc
> > es/jaxrs_dispatch/WEB-INF/web.xml
> >
> > On Feb 18, 2010, at 9:06 AM, SaravananRamamoorthy wrote:
> >> Hi All,
> >>
> >> I have created a Helloworld webservice using cxf.When I publish the
> >> endpoint
> >> in standalone server, it works fine.
> >>
> >> How do I publish the Helloworld service in tomcat without using any
> >> spring
> >> stuff.
> >>
> >> I go-through the servlet transport without spring , I have created a
> >> servet
> >> which extends CXFNonSpringServlet and then override the method loadBus
> >> as given in the document.
> >>
> >> How do I use this servlet in web.xml and publish the endpoint.
> >>
> >> Please suggest me.
> >>
> >> Regards
> >> Saravanan
> >
> > Johan Edstrom
> >
> > [email protected]
> >
> > They that can give up essential liberty to purchase a little temporary
> > safety, deserve neither liberty nor safety.
> >
> > Benjamin Franklin, Historical Review of Pennsylvania, 1759
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog