Hello,
I am newbie for CXF. I am using CXF, osgi (equinox), tomcat configuration
for testing. My motto to expose restful web services with tomcat in osgi
enviroment.
I succeeded in exposing CXF in tomcat without OSGI. For this I forwarded all
the request to CXFServlet with some of spring configuration.
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/beans.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<display-name>CXF Servlet</display-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
Now I try to use tomcat and osgi environement. I am using servletbrigge.jar
for tomcat configuration.
My understanding is... request should come to websevice should first
redirect to servlet bridge. From here it should go to CXFServlet.
Now I should expose any endpoint, This endpoint will be called by CXFServlet
without jetty and with tomcat.
Now my problem is: I read the CXF document and how to publish endpoint. for
this I am using code snippet:
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(CustomerService.class);
sf.setResourceProvider(CustomerService.class, new
SingletonResourceProvider(new CustomerService()));
sf.setAddress("http://localhost:9000/");
sf.create();
When I give the address "http://localhost:9000", it is invoking jetty. how
to avoid jetty invocation and use tomcat configuration?
Is it possible to solve this by any configuration, please advice me or any
code snippet will help me a lot.
Another problem: I also tried it with DOSGI. The problem with DOSGI is, I
can't get Grammer tag and not able to generate stubs. If any body can
suggest me how to overcome both the problem for DOSGI, I can take this
solution and start working on this.
--
View this message in context:
http://old.nabble.com/CXF%2C-osgi-and-tomcat-problem-tp27223821p27223821.html
Sent from the cxf-user mailing list archive at Nabble.com.