It turns out the problem was with the spaces in the directory name. I tried escaping the spaces with %20 but that didn't work, either. Once I took the spaces out, everything is working as it's supposed to.
Assuming this isn't a bug...I would recommend that there be a quick mention of this on the Camel CXF component page, and also possibly the example. It's an easy but non-obvious thing to trip up anyone who hasn't seen it before. Thanks for all the help. --Scott -----Original Message----- From: Claus Ibsen [mailto:[email protected]] Sent: Friday, February 04, 2011 7:00 AM To: [email protected] Subject: Re: Exception with cxfEndpoint address On Fri, Feb 4, 2011 at 3:45 PM, Scott Came <[email protected]> wrote: > Thanks, Claus. I'll give that a try, along with a couple of other > workarounds I can think of. > > However, it should be able to handle WSDLs like this, right? So should this > be filed as a bug? > > Any idea why it would work fine in the cxfbc and not in Camel CXF? > Different code :) cxfbx is JBI and the other OSGi. > -----Original Message----- > From: Claus Ibsen [mailto:[email protected]] > Sent: Thursday, February 03, 2011 10:41 PM > To: [email protected] > Subject: Re: Exception with cxfEndpoint address > > On Fri, Feb 4, 2011 at 7:11 AM, Scott Came <[email protected]> wrote: >> Sure... >> >> The directory structure looks like this: >> >> src/main/resources >> > schema >> >> WS SIP 1.2 >> >>> TSCEIServiceCore.wsdl >> >>> TSCEI-FCServiceInterface >> >>>> TSCEI-FCServiceInterface.wsdl >> >> The import in TSCEIServiceCore.wsdl looks like this: >> >> <wsdl:import >> namespace="http://it.ojp.gov/GlobalJRA/TSCEI/0.9.4/ws" >> location="TSCEI-FCServiceInterface/TSCEI-FCServiceInterface.wsdl"/> >> > > I would assume the relative location would be classpath specific. > Maybe you can try to put the wsdl and schemas in the src/main/resources > folder as the "base". Just to see if that helps. > > > > > >> I should've pointed out in my last message that, in addition to >> successful wsdl2java runs on these wsdls, the cxfbc handled them >> fine, as well. (In a previous iteration of this project, I >> successfully created a cxfbc:consumer service unit with these >> wsdls...) >> >> Thanks again. >> --Scott >> >> -----Original Message----- >> From: Claus Ibsen [mailto:[email protected]] >> Sent: Thursday, February 03, 2011 10:03 PM >> To: [email protected] >> Subject: Re: Exception with cxfEndpoint address >> >> On Fri, Feb 4, 2011 at 6:56 AM, Scott Came <[email protected]> wrote: >>> 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. >>> j >>> ava:230) >>> at >>> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl. >>> j >>> a >>> va:179) >>> at >>> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.j >>> a >>> v >>> a: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. >>> >> >> >> Can you post snippets of your imports in your wsdl / xsd files? >> >> And where do those reside? Are they included in the JAR somewhere, and if so >> in which location? >> >> >> >> >>> 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(Object >>>> H >>>> e >>>> l >>>> per.java:1133) >>>> at >>>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(Sprin >>>> g >>>> C >>>> a >>>> melContext.java:103) >>>> at >>>> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent( >>>> C >>>> a >>>> m >>>> elContextFactoryBean.java:231) >>>> at >>>> org.springframework.context.event.SimpleApplicationEventMulticaster. >>>> m >>>> u >>>> lticastEvent(SimpleApplicationEventMulticaster.java:97) >>>> at >>>> org.springframework.context.support.AbstractApplicationContext.publ >>>> i >>>> s >>>> h >>>> Event(AbstractApplicationContext.java:303) >>>> at >>>> org.springframework.context.support.AbstractApplicationContext.fini >>>> s >>>> h >>>> R >>>> efresh(AbstractApplicationContext.java:911) >>>> at >>>> org.springframework.osgi.context.support.AbstractOsgiBundleApplicat >>>> i >>>> o >>>> n >>>> Context.finishRefresh(AbstractOsgiBundleApplicationContext.java:235 >>>> ) >>>> at >>>> org.springframework.osgi.context.support.AbstractDelegatedExecution >>>> A >>>> p >>>> p >>>> licationContext$4.run(AbstractDelegatedExecutionApplicationContext. >>>> j >>>> a >>>> v >>>> a:358) >>>> at >>>> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithC >>>> u >>>> s >>>> t >>>> omTCCL(PrivilegedUtils.java:85) >>>> at >>>> org.springframework.osgi.context.support.AbstractDelegatedExecution >>>> A >>>> p >>>> p >>>> licationContext.completeRefresh(AbstractDelegatedExecutionApplicati >>>> o >>>> n >>>> C >>>> ontext.java:320) >>>> at >>>> org.springframework.osgi.extender.internal.dependencies.startup.Dep >>>> e >>>> n >>>> d >>>> encyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Depend >>>> e >>>> n >>>> c >>>> 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.getDestinat >>>> i >>>> o >>>> n >>>> (OsgiTransportFactory.java:39) >>>> at >>>> org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java: >>>> 9 >>>> 2 >>>> ) >>>> at >>>> org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:71) >>>> at >>>> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean. >>>> j >>>> a >>>> v >>>> a:106) >>>> at >>>> org.apache.camel.component.cxf.CxfConsumer.<init>(CxfConsumer.java: >>>> 1 >>>> 3 >>>> 7 >>>> ) >>>> at >>>> org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint. >>>> java:111) >>>> at >>>> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDri >>>> v >>>> e >>>> n >>>> ConsumerRoute.java:60) >>>> at >>>> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute. >>>> j >>>> a >>>> v >>>> 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(DefaultCam >>>> e >>>> l >>>> C >>>> ontext.java:1328) >>>> at >>>> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices( >>>> D >>>> e >>>> f >>>> aultCamelContext.java:1256) >>>> at >>>> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext. >>>> j >>>> a >>>> va:952) >>>> at >>>> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelCo >>>> n >>>> t >>>> e >>>> xt.java:203) >>>> at >>>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(Sprin >>>> g >>>> C >>>> a >>>> 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&serviceName={http: >>>> //servicemix.apache.org/samples/wsdl-first}PersonService&portNa >>>> m e = {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/ >>> >>> >>> >> >> >> >> -- >> 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/ >> >> >> > > > > -- > 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/ > > > -- 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/
