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 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.ja
> va:179)
> at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.jav
> 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(ObjectHe
>> l
>> per.java:1133)
>> at
>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringC
>> a
>> melContext.java:103)
>> at
>> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(Ca
>> m
>> elContextFactoryBean.java:231)
>> at
>> org.springframework.context.event.SimpleApplicationEventMulticaster.m
>> u
>> lticastEvent(SimpleApplicationEventMulticaster.java:97)
>> at
>> org.springframework.context.support.AbstractApplicationContext.publis
>> h
>> Event(AbstractApplicationContext.java:303)
>> at
>> org.springframework.context.support.AbstractApplicationContext.finish
>> R
>> efresh(AbstractApplicationContext.java:911)
>> at
>> org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio
>> n
>> Context.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>> at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
>> p
>> licationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
>> v
>> a:358)
>> at
>> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus
>> t
>> omTCCL(PrivilegedUtils.java:85)
>> at
>> org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
>> p
>> licationContext.completeRefresh(AbstractDelegatedExecutionApplication
>> C
>> ontext.java:320)
>> at
>> org.springframework.osgi.extender.internal.dependencies.startup.Depen
>> d
>> encyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
>> 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.getDestinatio
>> n
>> (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.ja
>> v
>> a:106)
>> at
>> org.apache.camel.component.cxf.CxfConsumer.<init>(CxfConsumer.java:13
>> 7
>> )
>> at
>> org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint.
>> java:111)
>> at
>> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrive
>> n
>> ConsumerRoute.java:60)
>> at
>> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.ja
>> 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(DefaultCamel
>> C
>> ontext.java:1328)
>> at
>> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(De
>> f
>> aultCamelContext.java:1256)
>> at
>> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.j
>> a
>> va:952)
>> at
>> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelCont
>> e
>> xt.java:203)
>> at
>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringC
>> 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&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/
>
>
>
--
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/