Effective October 27, 2012, online and email support for FuseSource products will move to Red Hat support channels. For more information, please see the JIRA Migration to Red Hat FAQ.
As of October 27th, please open all new issues in the Red Hat Customer Portal .
Issue Details (XML | Word | Printable)

Key: ESB-1014
Type: Bug Bug
Status: Reopened Reopened
Priority: Major Major
Assignee: Willem Jiang
Reporter: deleted user
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
FUSE ESB

Camel CXF Consumer does not work when deployed in JBI

Created: 10/Nov/09 05:23 PM   Updated: 07/Dec/09 11:45 AM
Component/s: None
Affects Version/s: 4.2.0-fuse-01-00
Fix Version/s: None

File Attachments: 1. Java Archive File camel-cxf-2.0.0-psc-01-00M2.jar (193 kB)
2. Java Archive File camel-cxf-2.0.0-psc-01-00M2.jar (193 kB)
3. Zip Archive camelcxf-smxcxf-camel-osgi.zip (9 kB)
4. File camelcxfProblem2.tgz (6 kB)
5. Zip Archive camelcxfProblem2.zip (16 kB)
6. Java Archive File servicemix-camel-2009.02.0-psc-01-00M2.jar (48 kB)
7. Java Archive File servicemix-camel-2009.02.0-psc-01-00M2.jar (48 kB)



 Description  « Hide
When SA containing the following camel context :

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:cxf="http://camel.apache.org/schema/cxf"

xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf-2.0.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">

<cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:9001/PersonService"
serviceClass="org.apache.servicemix.samples.wsdl_first.PersonService">
<cxf:properties>
<entry key="dataFormat" value="MESSAGE"/>
<entry key="wsdlURL" value="person.wsdl"/>
<entry key="serviceName" value="{http://servicemix.apache.org/samples/wsdl-first}PersonService"/>
<entry key="portName" value="{http://servicemix.apache.org/samples/wsdl-first}soap4"/>
</cxf:properties>
</cxf:cxfEndpoint>

<camel:camelContext>
<camel:route>
<camel:from uri="jbi:endpoint:http://servicemix.apache.org/samples/wsdl-first/receiver/endpoint" />
<setHeader headerName="Content-Type">
<constant>application/xml</constant>
</setHeader>
<camel:to uri="http://localhost:9000/PersonService/"/>
<!--
<camel:to uri="cxf:http://localhost:9000/PersonService/?dataFormat=MESSAGE&amp;wsdlURL=person.wsdl&amp;serviceName={http://servicemix.apache.org/samples/wsdl-first}PersonService&amp;portName={http://servicemix.apache.org/samples/wsdl-first}soap3" />
-->

<camel:to uri="log:soapresponse"/>
</camel:route>

<camel:route>
<camel:from uri="cxf:bean:serviceEndpoint"/>
<camel:to uri="log:soapresponse2"/>
</camel:route>

</camel:camelContext>

</beans>

is deployed, the following exception is thrown :

Caused by: javax.jbi.management.DeploymentException: <component-task-result xmln
s="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-camel</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
<task-status-msg><msg-loc-info><loc-token/><loc-message>
Could not deploy xbean service unit</loc-message></msg-loc-info></task-status-ms
g>
<exception-info>
<nesting-level>1</nesting-level>
<msg-loc-info>
<loc-token />
<loc-message>Unrecognized xbean namespac
e mapping: http://camel.apache.org/schema/cxf</loc-message>
<stack-trace><![CDATA[org.springframewor
k.beans.factory.BeanDefinitionStoreException: Unrecognized xbean namespace mappi
ng: http://camel.apache.org/schema/cxf
at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFr
omExtensionElement(XBeanNamespaceHandler.java:277)
at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBean
NamespaceHandler.java:155)
at org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanN
amespaceHandler.java:49)

The test SA will be attached shortly



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order

Willem Jiang added a comment - 11/Nov/09 03:20 AM
@ Sergey,
I just submit a patch to the SMX4-423. Hope it will be committed very soon.

deleted user added a comment - 11/Nov/09 12:40 PM
the namespace problem has gone with the fix but the next exception is

javax.jbi.JBIException: java.lang.Exception: Error deploying SU camelcxf-smxcxf-
camel1-su
at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.inst
all(ServiceAssemblyInstaller.java:101)
at org.apache.servicemix.jbi.deployer.impl.Deployer.onBundleStarted(Depl
oyer.java:352)
at org.apache.servicemix.jbi.deployer.impl.Deployer.bundleChanged(Deploy
er.java:282)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEv
ent(BundleContextImpl.java:916)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventM
anager.java:220)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchr
onous(ListenerQueue.java:149)
at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent
Privileged(Framework.java:1350)
at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent
(Framework.java:1301)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(Bundl
eHost.java:362)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(Abstrac
tBundle.java:280)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(Abstrac
tBundle.java:272)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.start(Director
yWatcher.java:1027)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.start(Director
yWatcher.java:1013)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(Direct
oryWatcher.java:398)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryW
atcher.java:206)
Caused by: java.lang.Exception: Error deploying SU camelcxf-smxcxf-camel1-su
at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.depl
oySUs(ServiceAssemblyInstaller.java:213)
at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.inst
all(ServiceAssemblyInstaller.java:85)
... 14 more
Caused by: javax.jbi.management.DeploymentException: <component-task-result xmln
s="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-camel</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
<task-status-msg><msg-loc-info><loc-token/><loc-message>
Could not deploy xbean service unit</loc-message></msg-loc-info></task-status-ms
g>
<exception-info>
<nesting-level>1</nesting-level>
<msg-loc-info>
<loc-token />
<loc-message>org.apache.camel.FailedToSt
artRouteException: org.apache.cxf.service.factory.ServiceConstructionException</
loc-message>
<stack-trace><![CDATA[org.apache.camel.R
untimeCamelException: org.apache.camel.FailedToStartRouteException: org.apache.c
xf.service.factory.ServiceConstructionException
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHe
lper.java:1037)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringC
amelContext.java:121)
at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(Ca
melContextFactoryBean.java:510)
at org.springframework.context.event.SimpleApplicationEventMulticaster$1
.run(SimpleApplicationEventMulticaster.java:78)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecut
or.java:49)
at org.springframework.context.event.SimpleApplicationEventMulticaster.m
ulticastEvent(SimpleApplicationEventMulticaster.java:76)
at org.springframework.context.support.AbstractApplicationContext.publis
hEvent(AbstractApplicationContext.java:274)
at org.springframework.context.support.AbstractApplicationContext.finish
Refresh(AbstractApplicationContext.java:736)
at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:383)
at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstr
actXBeanDeployer.java:87)
at org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDep
loyer.java:77)
at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServ
iceUnitManager.java:88)
at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServic
eUnitManager.java:69)
at org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.deploy(S
erviceUnitImpl.java:104)
at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.depl
oySUs(ServiceAssemblyInstaller.java:207)
at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.inst
all(ServiceAssemblyInstaller.java:85)
at org.apache.servicemix.jbi.deployer.impl.Deployer.onBundleStarted(Depl
oyer.java:352)
at org.apache.servicemix.jbi.deployer.impl.Deployer.bundleChanged(Deploy
er.java:282)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEv
ent(BundleContextImpl.java:916)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventM
anager.java:220)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchr
onous(ListenerQueue.java:149)
at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent
Privileged(Framework.java:1350)
at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent
(Framework.java:1301)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(Bundl
eHost.java:362)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(Abstrac
tBundle.java:280)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(Abstrac
tBundle.java:272)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.start(Director
yWatcher.java:1027)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.start(Director
yWatcher.java:1013)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(Direct
oryWatcher.java:398)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryW
atcher.java:206)
Caused by: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.
factory.ServiceConstructionException
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.j
ava:903)
at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelCont
ext.java:99)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringC
amelContext.java:119)
... 28 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.ja
va:128)
at org.apache.camel.component.cxf.CxfConsumer.<init>(CxfConsumer.java:12
0)
at org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint
.java:97)
at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrive
nConsumerRoute.java:59)
at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.ja
va:83)
at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.j
ava:871)
... 30 more
Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the
namespace http://schemas.xmlsoap.org/soap/http.
at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestination
Factory(DestinationFactoryManagerImpl.java:115)
at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:85
)
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:69)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.ja
va:109)
... 37 more
]]></stack-trace>
</msg-loc-info>
</exception-info>
</task-result-details>
</component-task-result-details>
</component-task-result>
at org.apache.servicemix.common.ManagementSupport.failure(ManagementSupp
ort.java:46)
at org.apache.servicemix.common.AbstractDeployer.failure(AbstractDeploye
r.java:43)
at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstr
actXBeanDeployer.java:117)
at org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDep
loyer.java:77)
at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServ
iceUnitManager.java:88)
at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServic
eUnitManager.java:69)
at org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.deploy(S
erviceUnitImpl.java:104)
at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.depl
oySUs(ServiceAssemblyInstaller.java:207)
... 15 more,

after trying to execute the route


Willem Jiang added a comment - 13/Nov/09 07:51 AM
Hi Sergey,

I can only reproduce this issue on Windows, the test case can run successfully in Mac OSX.

After digging the code for a while I guess your issue is caused by the CXF BusFactory created a wrong version of BusFactory.
When I added this system property into the SMX/etc/system.properties , the error went way.

org.apache.cxf.bus.factory=org.apache.cxf.bus.spring.SpringBusFactory

Willem


Willem Jiang added a comment - 13/Nov/09 08:27 AM
The patch committed into apache SMX component repository.

Willem Jiang added a comment - 13/Nov/09 08:44 AM
The system properties patch is same with ESB-1013, so I close this issue.

Willem Jiang added a comment - 24/Nov/09 01:55 PM
This issue should be fix with CAMEL-2216 in camel-cxf.

deleted user added a comment - 24/Nov/09 02:08 PM
Hi Willem

The producer issue is indeed fixed, but I'm still seeing a problem with the namespaces :

Caused by: javax.jbi.management.DeploymentException: <component-task-result xmln
s="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-camel</component-name>
<component-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
<task-status-msg><msg-loc-info><loc-token/><loc-message>
Could not deploy xbean service unit</loc-message></msg-loc-info></task-status-ms
g>
<exception-info>
<nesting-level>1</nesting-level>
<msg-loc-info>
<loc-token />
<loc-message>Unrecognized xbean namespac
e mapping: http://camel.apache.org/schema/cxf</loc-message>
<stack-trace><![CDATA[org.springframewor
k.beans.factory.BeanDefinitionStoreException: Unrecognized xbean namespace mappi
ng: http://camel.apache.org/schema/cxf
at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFr
omExtensionElement(XBeanNamespaceHandler.java:277)

It is a different exception than the one I reported here but it is still happening.
thanks


deleted user added a comment - 24/Nov/09 02:09 PM
This exception is reported when I have a cxf:bean consumer endpoint in the camel context

deleted user added a comment - 25/Nov/09 10:25 AM
Trying the not-yet-released servicemix-camel component leads to :

atcher.java:206)
Caused by: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.
factory.ServiceConstructionException
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.j
ava:903)
at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelCont
ext.java:99)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringC
amelContext.java:119)
... 28 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.ja
va:128)
at org.apache.camel.component.cxf.CxfConsumer.<init>(CxfConsumer.java:12
0)
at org.apache.camel.component.cxf.CxfEndpoint.createConsumer(CxfEndpoint
.java:98)
at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrive
nConsumerRoute.java:59)
at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.ja
va:83)
at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.j
ava:871)
... 30 more
Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the
namespace http://schemas.xmlsoap.org/soap/http.
at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestination
Factory(DestinationFactoryManagerImpl.java:115)
at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:85
)
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:69)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.ja
va:109)
... 37 more
]]></stack-trace>
</msg-loc-info>
</exception-info>
</task-result-details>
</component-task-result-details>
</component-task-result>
at org.apache.servicemix.common.ManagementSupport.failure(ManagementSupp
ort.java:46)
at org.apache.servicemix.common.AbstractDeployer.failure(AbstractDeploye
r.java:43)
at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstr
actXBeanDeployer.java:117)
at org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDep
loyer.java:77)
at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServ
iceUnitManager.java:88)
at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServic
eUnitManager.java:69)
at org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.deploy(S
erviceUnitImpl.java:104)
at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.depl
oySUs(ServiceAssemblyInstaller.java:207)
... 15 more


Willem Jiang added a comment - 30/Nov/09 02:01 AM
@Sergey,

Can you make sure you also updated the camel-cxf jar which will not try to load the default bus any more?
This issue should be fix with these two jar ( servicemix-camel and camel-cxf).
I will attached them into this JIRA.


Willem Jiang added a comment - 30/Nov/09 02:05 AM
Attached camel-cxf-2.0.0-psc-01-00M2.jar and servicemix-camel-2009.02.0-psc-01-00M2.jar.
Please copy them into the Fuse-ESB system directory.

deleted user added a comment - 01/Dec/09 04:02 PM
Hi Willem

Unfortunately, installing these attachments into system did not help.

So I decided to just try to go a different route and create a cxf:endpoint in an osgi bundle....

So far I'm just getting nowhere, not quite sure how to make it work, will keep trying.
Ex, here is the Camel context which I'm trying :

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:cxf="http://camel.apache.org/schema/cxf"

xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf-2.0.0.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.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-jetty.xml" />

<cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:9001/PersonService"
serviceClass="org.apache.servicemix.samples.wsdl_first.PersonService">
<cxf:properties>
<entry key="dataFormat" value="MESSAGE"/>
<entry key="wsdlURL" value="person.wsdl"/>
<entry key="serviceName" value="{http://servicemix.apache.org/samples/wsdl-first}PersonService"/>
<entry key="portName" value="{http://servicemix.apache.org/samples/wsdl-first}soap4"/>
</cxf:properties>
</cxf:cxfEndpoint>

<camel:camelContext>
<camel:route>
<camel:from uri="cxf:bean:serviceEndpoint/>
<camel:to uri="log:serviceEndpointResponse"/>
</camel:route>
</camel:camelContext>

I'd just like a message be sent to http://localhost:9001/PersonService" and be logged but this throws NPE.

Next, I'm trying this :

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:camel="http://cxf.apache.org/transports/camel"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
http://cxf.apache.org/transports/camel http://cxf.apache.org/transports/camel.xsd
">
<import resource="classpath:META-INF/cxf/cxf-extension-camel.xml" />

<bean class="org.apache.servicemix.samples.wsdl_first.PersonImpl" id="jaxwsBean" />

<!-- END SNIPPET: beanDefinition -->

<cxf:cxfEndpoint id="routerEndpoint"
address="http://localhost:8092/PersonService/" serviceClass="org.apache.servicemix.samples.wsdl_first.Person"
endpointName="person:soap" serviceName="person:PersonService" wsdlURL="person.wsdl"
xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
</cxf:cxfEndpoint>

<cxf:cxfEndpoint id="serviceEndpoint"
address="camel://direct:servicemix.apache.org.samples.wsdl-first.PersonService" serviceClass="org.apache.servicemix.samples.wsdl_first.Person"
endpointName="person:soap3" serviceName="person:PersonService"
wsdlURL="person.wsdl"
xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
</cxf:cxfEndpoint>

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="cxf:bean:routerEndpoint?dataFormat=PAYLOAD" />
<to uri="cxf:bean:serviceEndpoint?dataFormat=PAYLOAD" />
</route>
</camelContext>

<camel:conduit name="{http://servicemix.apache.org/samples/wsdl-first}soap3.camel-conduit">
<camelContext id="PersonServiceClientContext" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct:servicemix.apache.org.samples.wsdl-first.PersonService"/>
<to uri="cxfbean:jaxwsBean"/>
</route>
</camelContext>
</camel:conduit>

</beans>

This does not work either,

this time <import resource="classpath:META-INF/cxf/cxf-extension-camel.xml" />

can not be found, even though it actually does exist in the camel-cxf :

eption parsing XML document from OSGi resource[classpath:META-INF/cxf/cxf-extens
ion-camel.xml|bnd.id=175|bnd.sym=camelcxf-smxcxf-camel-osgi]; nested exception i
s java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf-extens
ion-camel.xml|bnd.id=175|bnd.sym=camelcxf-smxcxf-camel-osgi] cannot be resolved
to URL because it does not exist
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea


deleted user added a comment - 01/Dec/09 04:35 PM
Please see the attached bundle. The current spring context in META-INF/spring attempts to use camel conduit (see the pom.xml for the correct imports).

Can you please have a look and check what may not be set up correctly ?


Willem Jiang added a comment - 02/Dec/09 07:25 AM
@Sergey,

Please check out the camelcxfProblem2.tgz which I used to test my fix.

In Fuse ESB 4.x, we already install the CXF and it depends third party bundles, so please don't include the CXF jars into your camel-su's lib, and don't import the below files in your camel context (because camel-su can't see CXF bundle which are installed into ESB). camel-cxf will create a default bus for you.

<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-jetty.xml" />

Willem Jiang added a comment - 02/Dec/09 07:42 AM
For import the cxf-extenstion-camel.xml here is the walk around method CAMEL-2185

BTW, you can create a bundler which holds the camel-context.xml to access the JBI endpoints, and it will give you more flexibility


deleted user added a comment - 02/Dec/09 10:47 AM
Hi Willem

Still having problems with using an camel transport, here's the exception :

log:display-exception
karaf@root> log:display-exception
org.apache.cxf.interceptor.Fault: Could not send Message.
at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Mes
sageSenderInterceptor.java:48)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:236)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:483)
at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:1
44)
at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor
.java:86)
at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor
.java:84)
at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:1
46)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:8
3)
at org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:67)
at org.apache.camel.processor.DelegateProcessor.processNext(DelegateProc
essor.java:53)
at org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcesso
r.java:82)
at org.apache.camel.processor.interceptor.TraceInterceptor.process(Trace
Interceptor.java:85)
at org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:67)
at org.apache.camel.processor.RedeliveryErrorHandler.processExchange(Red
eliveryErrorHandler.java:232)
at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler
(RedeliveryErrorHandler.java:162)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE
rrorHandler.java:91)
at org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHa
ndler.java:49)
at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java
:201)
at org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWork
Processor.java:54)
at org.apache.camel.processor.DelegateProcessor.process(DelegateProcesso
r.java:48)
at org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:67)
at org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:
95)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInv
okerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:41
7)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecu
tor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(Se
rviceInvokerInterceptor.java:98)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept
orChain.java:236)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIniti
ationObserver.java:109)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceReque
st(JettyHTTPDestination.java:312)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(Je
ttyHTTPDestination.java:276)
at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTP
Handler.java:70)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7
66)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHand
lerCollection.java:230)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1
52)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:53
4)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnectio
n.java:879)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja
va:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.j
ava:522)
Caused by: java.net.MalformedURLException: unknown protocol: camel
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.apache.cxf.transport.http.HTTPConduit.getURL(HTTPConduit.java:826
)
at org.apache.cxf.transport.http.HTTPConduit.getURL(HTTPConduit.java:815
)
at org.apache.cxf.transport.http.HTTPConduit.setupURL(HTTPConduit.java:7
42)
at org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:49
1)
at org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(Mes
sageSenderInterceptor.java:46)
... 43 more

here is the beans.xml :

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:camel="http://cxf.apache.org/transports/camel"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
http://cxf.apache.org/transports/camel http://cxf.apache.org/transports/camel.xsd
">
<!--
<import resource="classpath:META-INF/cxf/cxf-extension-camel.xml" />
-->
<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-jetty.xml" />

<bean class="org.apache.camel.component.cxf.transport.CamelTransportFactory" lazy-init="false">
<property name="bus" ref="cxf" />
<property name="camelContext" ref="camelContext" />
<property name="transportIds">
<list>
<value>http://cxf.apache.org/transports/camel</value>
</list>
</property>
</bean>

<bean class="org.apache.servicemix.samples.wsdl_first.PersonImpl" id="jaxwsBean" />

<!-- END SNIPPET: beanDefinition -->

<cxf:cxfEndpoint id="routerEndpoint"
address="http://localhost:9001/PersonService/" serviceClass="org.apache.servicemix.samples.wsdl_first.Person"
endpointName="person:soap2" serviceName="person:PersonService" wsdlURL="person.wsdl"
xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
</cxf:cxfEndpoint>

<cxf:cxfEndpoint id="serviceEndpoint"
address="camel://direct:servicemix.apache.org.samples.wsdl-first.PersonService" serviceClass="org.apache.servicemix.samples.wsdl_first.Person"
endpointName="person:soap3" serviceName="person:PersonService"
wsdlURL="person.wsdl"
xmlns:person="http://servicemix.apache.org/samples/wsdl-first">
</cxf:cxfEndpoint>

<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="cxf:bean:routerEndpoint?dataFormat=PAYLOAD" />
<to uri="cxf:bean:serviceEndpoint?dataFormat=PAYLOAD" />
</route>
</camelContext>

<camel:conduit name="{http://servicemix.apache.org/samples/wsdl-first}soap3.camel-conduit">
<camelContext id="PersonServiceClientContext" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct:servicemix.apache.org.samples.wsdl-first.PersonService"/>
<to uri="cxfbean:jaxwsBean"/>
</route>
</camelContext>
</camel:conduit>

</beans>


deleted user added a comment - 02/Dec/09 10:50 AM
Likewise, camel-su does not seem to work. I downloaded the latest snapshot, saved camel-cxf and service-camel into system, updated system properties, still the same problem (No Destination factory). Canel su context has no extra imports and pom.xml does not include cxf

Have you tried the fix on windows ?


Willem Jiang added a comment - 02/Dec/09 12:02 PM
resend the camel-cxf and servicemix-camel jars

deleted user added a comment - 04/Dec/09 11:19 AM
I can have a camel cxf consumer working when it is packaged in an OSGI bundle.
It is likely it's also working when it is packaged in JBI SU but I could not confirm yet..
This issue is not blocking now ESBSYSTEMTESTS-19