Hi I think you need to import the Jetty file if you want absolute address (it will then embed and use Jetty as container). You have defined the http which relies on the container having a HTTP service, and thus the address should be relative
<import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" /> <import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" /> Import the jetty schema instead: See the Camel CXF examples such as: http://camel.apache.org/cxf-proxy-example.html Also chapter 13 (13.4.2) in Camel in Action book shows and talks about this. On Thu, Feb 3, 2011 at 7:50 PM, Scott Came <[email protected]> wrote: > When I build-install and deploy the attached in SMX4 (FUSE ESB 4.3.0-03-00) I > get the following: > > Exception in thread "SpringOsgiExtenderThread-16" > org.apache.camel.RuntimeCamelException: java.lang.IllegalStateException: > Endpoint address should be a relative URI wrt to the servlet address (use > '/xxx' for example) > at > org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1133) > at > org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103) > at > org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:231) > at > org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97) > at > org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303) > at > org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911) > at > org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235) > at > org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358) > at > org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) > at > org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320) > at > org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136) > at java.lang.Thread.run(Thread.java:680) > Caused by: java.lang.IllegalStateException: Endpoint address should be a > relative URI wrt to the servlet address (use '/xxx' for example) > at > org.apache.cxf.transport.http_osgi.OsgiTransportFactory.getDestination(OsgiTransportFactory.java:39) > at > org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:92) > at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:71) > at > org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:106) > at > org.apache.camel.component.cxf.CxfConsumer.<init>(CxfConsumer.java:137) > at > org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint.java:111) > at > org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60) > at > org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:75) > at org.apache.camel.impl.RouteService.doStart(RouteService.java:132) > at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:56) > at > org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1328) > at > org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1256) > at > org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:952) > at > org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203) > at > org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101) > ... 10 more > > For ease of reference, my camel-context.xml is: > > <beans xmlns="http://www.springframework.org/schema/beans" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:osgi="http://camel.apache.org/schema/osgi" > xmlns:cxf="http://camel.apache.org/schema/cxf" > xsi:schemaLocation=" > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd > http://camel.apache.org/schema/spring > http://camel.apache.org/schema/spring/camel-spring.xsd > http://camel.apache.org/schema/osgi > http://camel.apache.org/schema/osgi/camel-osgi.xsd > http://camel.apache.org/schema/cxf > http://camel.apache.org/schema/cxf/camel-cxf-2.6.0.xsd > "> > > <import resource="classpath:META-INF/cxf/cxf.xml" /> > <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> > <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" /> > <import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" /> > > <cxf:cxfEndpoint > id="routerEndpoint" > address="http://localhost:18080/services/TSCEIServiceCore" > wsdlURL="classpath:person.wsdl"/> > > <osgi:camelContext xmlns="http://camel.apache.org/schema/spring" > xmlns:ws="http://servicemix.apache.org/samples/wsdl-first"> > <route> > <from > uri="cxf:bean:routerEndpoint?dataFormat=PAYLOAD&serviceName={http://servicemix.apache.org/samples/wsdl-first}PersonService&portName={http://servicemix.apache.org/samples/wsdl-first}soap"/> > <convertBodyTo type="java.lang.String"/> > <to uri="file:/tmp/router-output"/> > </route> > </osgi:camelContext> > > </beans> > > The wsdl is from the wsdl-first example in the distro, though this scenario > is different than the sample. > > I searched the list and found this > http://fusesource.com/forums/thread.jspa?threadID=566&tstart=0 which seems to > be someone using JBI (which per Claus's recent comments, in response to my > other post, is something I'm no longer considering). Then there was this > post > http://servicemix.396122.n5.nabble.com/jaxws-endpoint-address-should-be-a-relative-URI-wrt-to-the-servlet-address-td420837.html > which also looks like, in the end, recommended using the cxf bc (JBI) > component. > > Do I have to use JBI to get this scenario working (i.e., specifying the > endpoint address in the configuration)? > > Thanks. > --Scott > > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
