Hi Freeman,
Thanks for your reply.
I am using v3.2.2 and am using the web console for deploying the SA. My
web.xml looks like:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<description>
Apache ServiceMix Console
</description>
<display-name>Apache ServiceMix Console</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml
/WEB-INF/servicemix.xml</param-value>
</context-param>
<context-param>
<param-name>contextClass</param-name>
<param-value>org.apache.xbean.spring.context.XmlWebApplicationContext</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>cxf</servlet-name>
<display-name>cxf</display-name>
<description>Apache CXF Endpoint</description>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- Configuration of the SiteMesh Filter.
-->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- Expose Spring POJOs to JSP .
-->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<filter>
<filter-name>spring</filter-name>
<filter-class>org.apache.servicemix.web.filter.ApplicationContextFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>spring</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- ServiceMix servlets
-->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- Spring listener. -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- Configuration of the Spring MVC dispatcher -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<!--
<servlet>
<servlet-name>servicemix-http</servlet-name>
<servlet-class>org.apache.servicemix.web.http.HttpManagedServlet</servlet-class>
</servlet>
<init-param>
<param-name>mapping</param-name>
<param-value>/services</param-value>
</init-param>
-->
<!-- <servlet-mapping>
<servlet-name>BindingServlet</servlet-name>
<url-pattern>/jbi/*</url-pattern>
</servlet-mapping> -->
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.svg</url-pattern>
</servlet-mapping>
<!-- <servlet-mapping>
<servlet-name>servicemix-http</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
-->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<!-- Factor out common headers in JSP pages -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
<jsp-config>
<taglib>
<taglib-uri>
http://www.opensymphony.com/sitemesh/decorator
</taglib-uri>
<taglib-location>
/WEB-INF/sitemesh-decorator.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
http://www.opensymphony.com/sitemesh/page
</taglib-uri>
<taglib-location>
/WEB-INF/sitemesh-page.tld
</taglib-location>
</taglib>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<include-prelude>/WEB-INF/jspf/headertags.jspf</include-prelude>
</jsp-property-group>
</jsp-config>
</web-app>
My xbean.xml looks like:
<beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
<cxfbc:consumer wsdl="classpath:Test.wsdl"
targetService="person:TestImplService"
targetInterface="person:TestService"/>
</beans>
(I tried adding locationURI = "/TestImplService/" and it threw me a
java.net.MalformedURL exception while deploying- if i change it to
locationURI="http://localhost:8080/<my-sm-context>/services/TestImplService/"
the application deploys but in the command prompt i see -
INFO - ServiceUnitLifeCycle - Starting service unit:
wsdl-first-cxfbc-su
INFO - jetty - jetty-6.1.9
INFO - jetty - Started
[email protected]:8080
)
Also when i try to access the url mentioned in the locationURI(with ?wsdl
appended to it) , it is saying "No Service Found" at this URL...
GV
Freeman Fang wrote:
Hi GV,
What ServiceMix version are you use?
I suppose you are using 3.2.3, so would you please post
/webapps/apache-servicemix-web-3.2.3/WEB-INF/web.xml
and the xbean.xml for your cxf bc consumer?
And do you install component and SA from the web console?
I post the necessary step again, just for your reference
You need add
<servlet>
<servlet-name>cxf</servlet-name>
<display-name>cxf</display-name>
<description>Apache CXF Endpoint</description>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
to the /webapps/apache-servicemix-web-3.2.3/WEB-INF/web.xml
this servlet just replace http transport with servlet transport, so that
you can avoid starting jetty server when start cxf bc consumer, just
reuse the http server provided by your servlet container(tomcat in your
case),
Also, you need add
locationURI="/whateveryouwant"
for your cxf bc consumer configuration
You need install cxf bc component and SA from the WEB console
then you can access the wsdl by
http://localhost:8080/apache-servicemix-web-3.2.2/services/whateveryouwant?wsdl
Freeman
GV wrote:
Hi
I am launching ServiceMix as a Web Application (Tomcat as the
container) -
it however kicks off an instance of Jetty. I want to use Tomcat as the
container for ServiceMix and would like to not use Jetty.
I referred to a few posts to use Servlet Transport instead of HTTP
transport by using CXFServlet as the destination of incoming requests.
While
this prompts the destination factory being replaced by the
ServletTransport
Factory, it still does not stop Jetty from getting spawned. Also, i am
unable to access the web service endpoint (which is a CXF BC in my case).
Basically, when my application (deployed as a Service Assembly) starts
up,
while starting up the cxf bc service unit in my application, it kicks off
jetty.
Again all posts i referred to with reference to this mentioned making
changes to web.xml which i did.
Can somebody list if i am missing anything here?
GV