2 Replies Latest reply on Apr 24, 2008 4:21 PM by Torsten Mielke

    CXF proxy inside ESB to CXF bc provider

    Torsten Mielke Apprentice

      Hello,

       

      I am trying to get the following usecase working inside FUSE ESB 3.3.1-fuse-SNAPSHOT.:

       

      some SMX component ===> cxf proxy inside servicemix ===> cxf bc provider ===> standalone cxf server outside servicemix

       

      This usecase is very similar to the one described on http://servicemix.apache.org/integrate-cxf-with-servicemix.html, section "CxfBcProvider".

       

      As of now, cxf generates the cxf proxy for me at deployment time and sets it on the smx bean component as it logs during deploy time:

       

      INFO: Creating Service MySoapProviderService from class org.apache.servicemix.sam ples.wsdl_first.Person

      DEBUG - CXFProxyBean                   - setProxy called

       

       

      Full log is provided below .

      However, when trying to invoke the service, it fails with on the call from the CXF proxy to the cxf bc provider with this error:

       

      org.apache.cxf.interceptor.Fault: no jbi message element

       

      I do not understand what configuration is missing in order to link the CXF proxy with the CXF bc provider.

       

      The invocation from the smx-bean to the proxy reads as follows:

      javax.xml.ws.Holder<java.lang.String> id = new 

      javax.xml.ws.Holder<java.lang.String>("123");       

      javax.xml.ws.Holder<java.lang.String> ssn = new

      javax.xml.ws.Holder<java.lang.String>();

      javax.xml.ws.Holder<java.lang.String> name = new

      javax.xml.ws.Holder<java.lang.String>();

      person.getPerson(id, ssn, name);

       

      the cxf proxy (used inside a SMX bean component) is configured as follows in xbean.xml:

       

      <bean:endpoint service="capita:CXFProxy" endpoint="endpoint" bean="#CXFProxyBean"/>

      <bean id="CXFProxyBean" class="com.dummy.test.CXFProxyBean">

      <property name="proxy">

      <cxfse:proxy service="person:PersonService"

      type="org.apache.servicemix.samples.wsdl_first.Person"/>

      </property>

      </bean>

       

       

      My cxf bc provider is configured as follows:

      <beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"

      xmlns:dummy="http://www.dummy.com"

      xmlns:person="http://servicemix.apache.org/samples/wsdl-first">

      <cxfbc:provider wsdl="classpath:person.wsdl"

      locationURI="http://localhost:8192/PersonService/"   

      endpoint="Person"

      service="person:PersonService"

      interfaceName="person:Person"

      useJBIWrapper="false">

      <cxfbc:inInterceptors>

      <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>

      </cxfbc:inInterceptors>

      <cxfbc:outInterceptors>

      <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>

      </cxfbc:outInterceptors>

      <cxfbc:inFaultInterceptors>

      <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>

      </cxfbc:inFaultInterceptors>

      <cxfbc:outFaultInterceptors>

      <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>

      </cxfbc:outFaultInterceptors>

      </cxfbc:provider>

      </beans>

       

       

      Any idea, what I might be missing?

       

      Many thanks

      Torsten

       

       

      log extract of deploy time and runtime.

       

      DEPLOY TIME:

      -


      INFO  - ComponentMBeanImpl             - Initializing component: ID:10.2.15.3-1197dc90b54-0:0

      INFO  - ComponentMBeanImpl             - Starting component: ID:10.2.15.3-1197dc90b54-0:0

      24-Apr-2008 01:18:37 org.apache.cxf.transport.jbi.JBITransportFactory setDeliveryChannel

      INFO: configuring DeliveryChannel:      DeliveryChannel

      24-Apr-2008 01:18:37 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass

      INFO: Creating Service MySoapProviderService from class org.apache.servicemix.sam ples.wsdl_first.Person

      DEBUG - CXFProxyBean                   - setProxy called

      INFO  - ServiceAssemblyLifeCycle       - Starting service assembly: GG_SA

      INFO  - ServiceUnitLifeCycle           - Initializing service unit: GG_CamelRoute

      INFO  - ServiceUnitLifeCycle           - Initializing service unit: ContentEnricherBean_SU

      INFO  - ServiceUnitLifeCycle           - Initializing service unit: GG_BeanCXFProxy_SU

      INFO  - ServiceUnitLifeCycle           - Initializing service unit: GG_CXF_BC_Provider

      INFO  - ServiceUnitLifeCycle           - Initializing service unit: GG_HTTPConsumer_SU

      INFO  - ServiceUnitLifeCycle           - Starting service unit: GG_CamelRoute

      INFO  - ServiceUnitLifeCycle           - Starting service unit: ContentEnricherBean_SU

      INFO  - ServiceUnitLifeCycle           - Starting service unit: GG_BeanCXFProxy_SU

      INFO  - ServiceUnitLifeCycle           - Starting service unit: GG_CXF_BC_Provider

      INFO  - WSDL1Processor                 - Endpoint ServiceEndpoint[service=PersonS

      ervice,endpoint=Person] has a service description, but no matching endpoint found in

      INFO  - ServiceUnitLifeCycle           - Starting service unit: GG_HTTPConsumer_SU

       

       

       

      RUNTIME:

      -


      INFO  - CXFProxyBean                   - Received exchange: InOut[

      id: ID:192.168.111.1-1197f8c0a4a-23:11

      status: Active

      role: provider

      service: CXFProxy

      endpoint: endpoint

      in: <?xml version="1.0" encoding="UTF-8"?><tns:getPerson xmlns:tns="http://servicemix.apache.org/samples/wsdl-first/types" xmlns

      :env="http://schemas.xmlsoap.org/soap/envelope/">

      <tns:personId>world</tns:personId>

      </tns:getPerson>

      ]

      24-Apr-2008 10:11:11 org.apache.cxf.transport.jbi.JBIConduitOutputStream commitOutputMessage

      INFO: invoking service  interface org.apache.servicemix.samples.wsdl_first.Person

      24-Apr-2008 10:11:11 org.apache.cxf.transport.jbi.JBIConduitOutputStream commitOutputMessage

      INFO: create message exchange svc:      PersonService

      24-Apr-2008 10:11:11 org.apache.cxf.transport.jbi.JBIConduitOutputStream commitOutputMessage

      INFO: exchange endpoint:        null

      24-Apr-2008 10:11:11 org.apache.cxf.transport.jbi.JBIConduitOutputStream commitOutputMessage

      INFO: setup message contents on org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@954937}

      24-Apr-2008 10:11:11 org.apache.cxf.transport.jbi.JBIConduitOutputStream commitOutputMessage

      INFO: service for exchange PersonService

      24-Apr-2008 10:11:11 org.apache.cxf.transport.jbi.JBIConduitOutputStream commitOutputMessage

      INFO: sending message

      24-Apr-2008 10:11:11 org.apache.cxf.interceptor.LoggingInInterceptor logging

      INFO: Inbound Message

      -


      Encoding: UTF-8

      Headers: {Content-Length=[283], Server=[Jetty(6.1.6)], content-type=[text/xml; charset=utf-8]}

      Messages:

      Message:

       

      Payload:

      -


      24-Apr-2008 10:11:11 org.apache.cxf.phase.PhaseInterceptorChain doIntercept

      INFO: Interceptor has thrown exception, unwinding now

      org.apache.cxf.interceptor.Fault: no jbi message element

      at org.apache.cxf.binding.jbi.interceptor.JBIWrapperInInterceptor.handleMessage(JBIWrapperInInterceptor.java:96)

      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)

      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:429)

      at org.apache.cxf.transport.jbi.JBIConduitOutputStream.commitOutputMessage(JBIConduitOutputStream.java:144)

      at org.apache.cxf.transport.jbi.JBIConduitOutputStream.doClose(JBIConduitOutputStream.java:74)

      at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:156)

      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)

      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderIntercept

      or.java:62)

      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)

      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)

      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)

      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)

      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:170)

      at $Proxy87.getPerson(Unknown Source)

      at com.capita.test.CXFProxyBean.onMessageExchange(CXFProxyBean.java:111)

      at org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:235)

      at org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:211)

      at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)

      at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)

      at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)

      at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)

      at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)

      at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)

      at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)

      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)

      at java.lang.Thread.run(Thread.java:595)

       

        • 1. Re: CXF proxy inside ESB to CXF bc provider
          deleted user Newbie

          Hi Torstein,

           

          At the line of code it fails at in the JBIWrapperInInterceptor - it is throwing an error because it expects the message to be wrapped within a jbi element.

           

          I see you have the useJBIWrapper=false set in the cxf-bc provider config. have you tried setting this to true.

           

          Also I need to check if the servicemix-bean component supports useJBIWrapper. I dont think it does.

           

          can you log the output of the message sent

           

          Edell.

          • 2. Re: CXF proxy inside ESB to CXF bc provider
            Torsten Mielke Apprentice

            You rock Edell,

             

            That configuration change did the required trick and my system is working fine now. Surprisingly the logging interceptor that got invoked earlier was unable to log the message. I would not have thought of changing the useJbiWrapper config. Perhaps we need better error handling or even logging output in these interceptors.

             

            Many thanks.

            Torsten