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</servlet-class>
 <init-param>
 
<param-name>org.apache.cxf.transport.servlet.CXFNonSpringServlet</param-name>
  <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/resources/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
>> 
>> 
>> -- 
>> View this message in context:
>> http://old.nabble.com/publishing-jaxws-service-endpoint-tp27638100p27638100.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>> 
> 
> Johan Edstrom
> 
> j...@opennms.org
> 
> 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
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/publishing-jaxws-service-endpoint-tp27638100p27647670.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to