Using CXF under Tomcat:

When we are using the spring xml definition file to describe the endpoint,
there is an address value which can be used to specify the name of the
service. Like this:

<beans xmlns="http://www.springframework.org/schema/beans";
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xmlns:jaxws="http://cxf.apache.org/jaxws";
      xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd";>

  <jaxws:endpoint id="MonitorImpl"
                  implementor="uk.tamtam.monitor.MonitorImpl"
                  address="MonitorImpl"
          />
</beans>
 
Unfortunately when this value is used, the tomcat startup fails, with the
message:

Caused by: java.net.MalformedURLException: no protocol: MonitorImpl
        at java.net.URL.<init>(URL.java:567)
        at java.net.URL.<init>(URL.java:464)
        at java.net.URL.<init>(URL.java:413)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.<init>(JettyHTTPDestination.java:96)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTPTransportFactory.java:116)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTransportFactory.java:103)
        at 
org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90)
        at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:69)
        at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:106)
        ... 51 more

Off course this makes no sense, since the address is supposed to be added to
the servlet URL pattern in web.xml:

    <servlet-mapping>
      <servlet-name>CXFServlet</servlet-name>
      <url-pattern>/services/*</url-pattern>
    </servlet-mapping>

What to do?

It appears that if address is not specified, tomcat will start without to
much whining. So the big question is now: What is the address that CXF has
decided for the service?

TIA
Henrik

-- 
View this message in context: 
http://old.nabble.com/address-in-spring-bean-definition-tp27977016p27977016.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to