Thanks, Claus...that fixed it.

However...  Now that I got my simple test case working, I took out the sample 
person.wsdl and replaced it with my actual project wsdl.  This wsdl is actually 
a bit complex...there is a "root" wsdl document that imports another wsdl 
document, and that second document in turn imports a quite complex wad of XML 
Schemas.  The second wsdl and the xsds are in different directories than the 
"root" wsdl.

It seems that CXF does not like relative paths in the wsdl:import location...I 
get a FileNotFoundException, with the following as the top of the stack trace:

at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseImport(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at 
org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:230)
        at 
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
        at 
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
        ... 26 more

I know my WSDL is valid; I can successfully generate code with wsdl2java, etc.

Is it a limitation in CXF...to have the wsdl referenced in wsdlURL="" import 
another wsdl that resides in a different directory?

Really appreciate the help...you've helped me move forward for the first time 
in a few days of trying to get this to work.

Thanks.
--Scott

-----Original Message-----
From: Claus Ibsen [mailto:[email protected]] 
Sent: Thursday, February 03, 2011 8:07 PM
To: [email protected]
Subject: Re: Exception with cxfEndpoint address

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(ObjectHel
> per.java:1133)
>        at 
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCa
> melContext.java:103)
>        at 
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(Cam
> elContextFactoryBean.java:231)
>        at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.mu
> lticastEvent(SimpleApplicationEventMulticaster.java:97)
>        at 
> org.springframework.context.support.AbstractApplicationContext.publish
> Event(AbstractApplicationContext.java:303)
>        at 
> org.springframework.context.support.AbstractApplicationContext.finishR
> efresh(AbstractApplicationContext.java:911)
>        at 
> org.springframework.osgi.context.support.AbstractOsgiBundleApplication
> Context.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>        at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApp
> licationContext$4.run(AbstractDelegatedExecutionApplicationContext.jav
> a:358)
>        at 
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCust
> omTCCL(PrivilegedUtils.java:85)
>        at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApp
> licationContext.completeRefresh(AbstractDelegatedExecutionApplicationC
> ontext.java:320)
>        at 
> org.springframework.osgi.extender.internal.dependencies.startup.Depend
> encyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependenc
> yWaiterApplicationContextExecutor.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.jav
> a: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(EventDriven
> ConsumerRoute.java:60)
>        at 
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.jav
> a: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(DefaultCamelC
> ontext.java:1328)
>        at 
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(Def
> aultCamelContext.java:1256)
>        at 
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.ja
> va:952)
>        at 
> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelConte
> xt.java:203)
>        at 
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCa
> melContext.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&amp;serviceName={http:
> //servicemix.apache.org/samples/wsdl-first}PersonService&amp;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/


Reply via email to