FUSE ESB
  1. FUSE ESB
  2. ESB-1014

Camel CXF Consumer does not work when deployed in JBI

    Details

    • Type: Bug Bug
    • Status: Reopened Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.2.0-fuse-01-00
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      Description

      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&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

      1. camelcxfProblem2.tgz
        6 kB
        Willem Jiang

        Activity

        Hide
        Willem Jiang
        added a comment -

        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

        Show
        Willem Jiang
        added a comment - 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
        Hide
        deleted user
        added a comment -

        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>

        Show
        deleted user
        added a comment - 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>
        Hide
        deleted user
        added a comment -

        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 ?

        Show
        deleted user
        added a comment - 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 ?
        Hide
        Willem Jiang
        added a comment -

        resend the camel-cxf and servicemix-camel jars

        Show
        Willem Jiang
        added a comment - resend the camel-cxf and servicemix-camel jars
        Hide
        deleted user
        added a comment -

        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

        Show
        deleted user
        added a comment - 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

          People

          • Assignee:
            Willem Jiang
            Reporter:
            deleted user
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: