You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Dan Powell <da...@abakas.com> on 2010/10/29 17:54:41 UTC
Combine cxfbc:consumer and cxfse:endpoint In OSGi Bundle
Is it possible to combine the cxfbc:consumer and cxfse:endpoint into a single bundle? t seems the second endpoint to start replaces the first. When I list both in the Spring beans.xml with the cxfbc:consumer first, I see the publish address for both endpoints (one as http://0.0.0.0:9090/foo and the other as jbi://ID-10-122-125-215-12bf890562c-2-0) logged to data/servicemix.log, but the HTTP port is not listening. Also if I reverse the order and declare the cxfbc:consumer after the cxfse:endpoint, the HTTP port is listening and serves the ?wsdl request but invocations of the service result in "Could not dispatch exchange. No matching endpoints."
Thanks!
Dan
Re: Combine cxfbc:consumer and cxfse:endpoint In OSGi Bundle
Posted by Dan Powell <da...@abakas.com>.
The issue appears to be related to the portName attribute on the @WebService annotation of the implementation bean (generated by default by CXF's wsdl2java). Without that attribute, everything deploys fine. If I add that attribute, the cxfbc endpoint doesn't redeploy when the SA is registered and restarted. I've attached a test case built by combining the wsdl_first example into a single bundle.
As separate OSGi bundles, the portName's presence doesn't prevent deployment. Also, combined into a single bundle, the endpoint deploys at first but doesn't redeploy when the service assembly is registered.
My suspicion is that the portName attribute is used as the endpoint name causing a (silent) name conflict. This would explain why flipping the order of declaration in the beans.xml causes the other endpoint to be deployed successfully and also why packaging as separate OSGi bundles (translated to separate service assemblies) is successful - no name conflict within a given SA.
Dan
Re: Combine cxfbc:consumer and cxfse:endpoint In OSGi Bundle
Posted by Freeman Fang <fr...@gmail.com>.
Could you please append a test case which I can build and deploy?
Freeman
On 2010-10-31, at 下午8:15, Dan Powell wrote:
> In particular you'll see the port endpoint is listed, but not
> the :soap endpoint.
>
> Apache ServiceMix (4.2.0)
>
> karaf@root> nmr:list
> Endpoints
> ---------
> servicemix-vfs
> {http://servicemix.org/wsnotification}Publisher:Anonymous
> servicemix-cxf-se
> servicemix-scripting
> servicemix-smpp
> servicemix-cxf-bc
> servicemix-snmp
> servicemix-jms
> servicemix-file
> servicemix-drools
> {http://servicemix.org/wsnotification}CreatePullPoint:Broker
> {http://servicemix.org/wsnotification}NotificationBroker:Broker
> servicemix-quartz
> servicemix-http
> servicemix-eip
> servicemix-ftp
> servicemix-wsn2005
> servicemix-osworkflow
> servicemix-exec
> {urn:foo}FooService:FooImplPort
> servicemix-bean
> servicemix-validation
> servicemix-camel
> root
> servicemix-mail
> servicemix-saxon
>
> karaf@root> jbi:list
> Components
> ----------
> State Name Description
> [Started ] [servicemix-http ]
> [Started ] [servicemix-snmp ]
> [Started ] [servicemix-file ]
> [Started ] [servicemix-wsn2005 ]
> [Started ] [servicemix-saxon ]
> [Started ] [servicemix-exec ]
> [Started ] [servicemix-bean ]
> [Started ] [servicemix-jms ]
> [Started ] [servicemix-vfs ]
> [Started ] [servicemix-ftp ]
> [Started ] [servicemix-cxf-se ]
> [Started ] [servicemix-eip ]
> [Started ] [servicemix-scripting ]
> [Started ] [servicemix-quartz ]
> [Started ] [servicemix-mail ]
> [Started ] [servicemix-osworkflow ]
> [Started ] [servicemix-smpp ]
> [Started ] [servicemix-camel ]
> [Started ] [servicemix-validation ]
> [Started ] [servicemix-drools ]
> [Started ] [servicemix-cxf-bc ]
>
> Service Assemblies
> ------------------
> State Name Description
> [Started ] [foo-bundle ]
>
> On Oct 31, 2010, at 3:00 AM, Freeman Fang wrote:
>
>> Hi Dan,
>>
>> What's the exact smx4 version you are using?
>> What's the output for both nmr:list and jbi:list after you deploy
>> your bundle?
>>
>> Freeman
>> On 2010-10-30, at 上午5:42, Dan Powell wrote:
>>
>>> Yes, that's what I've done. What I see in the logs is that both
>>> endpoints get deployed, the publish addresses are both logged, but
>>> after "All endpoints have been deployed and components
>>> initialized. Registering service assembly." I see "Changing SA
>>> state to Stopped" followed by a "Registering endpoint" but only
>>> for the one with the ENDPOINT_NAME=FooImplPort not the
>>> ENDPOINT_NAME=soap. The second endpoint never gets restarted.
>>>
>>> Dan
>>>
>>> On Oct 29, 2010, at 3:17 PM, Jean-Baptiste Onofré wrote:
>>>
>>>> Hi Dan,
>>>>
>>>> You can gather cxfbc and cxfse in the same xbean.xml (and so in
>>>> the same bundle).
>>>> In fact, now you can gather all components in the same xbean.xml.
>>>> After you can package this xbean.xml in a bundle or directly drop
>>>> into the deploy folder.
>>>>
>>>> To "expose" the component endpoints as an OSGi service, simply add:
>>>>
>>>> <bean class="org.apache.servicemix.commons.osgi.EndpointExporter"/>
>>>>
>>>> Take a look on:
>>>> http://servicemix.apache.org/SMX4/creating-an-osgi-bundle-for-deploying-jbi-endpoints.html
>>>> http://servicemix.apache.org/SMX4NMR/3-deploying-jbi-components-without-the-jbi-packaging.html
>>>> http://servicemix.apache.org/file-to-xmpp-bridge.html
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 10/29/2010 05:54 PM, Dan Powell wrote:
>>>>> Is it possible to combine the cxfbc:consumer and cxfse:endpoint
>>>>> into a single bundle? t seems the second endpoint to start
>>>>> replaces the first. When I list both in the Spring beans.xml
>>>>> with the cxfbc:consumer first, I see the publish address for
>>>>> both endpoints (one as http://0.0.0.0:9090/foo and the other as
>>>>> jbi://ID-10-122-125-215-12bf890562c-2-0) logged to data/
>>>>> servicemix.log, but the HTTP port is not listening. Also if I
>>>>> reverse the order and declare the cxfbc:consumer after the
>>>>> cxfse:endpoint, the HTTP port is listening and serves the ?wsdl
>>>>> request but invocations of the service result in "Could not
>>>>> dispatch exchange. No matching endpoints."
>>>>>
>>>>> Thanks!
>>>>>
>>>>> Dan
>>>
>>
>>
>> --
>> Freeman Fang
>>
>> ------------------------
>>
>> FuseSource: http://fusesource.com
>> blog: http://freemanfang.blogspot.com
>> twitter: http://twitter.com/freemanfang
>> Apache Servicemix:http://servicemix.apache.org
>> Apache Cxf: http://cxf.apache.org
>> Apache Karaf: http://karaf.apache.org
>> Apache Felix: http://felix.apache.org
>>
>
--
Freeman Fang
------------------------
FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org
Re: Combine cxfbc:consumer and cxfse:endpoint In OSGi Bundle
Posted by Dan Powell <da...@abakas.com>.
In particular you'll see the port endpoint is listed, but not the :soap endpoint.
Apache ServiceMix (4.2.0)
karaf@root> nmr:list
Endpoints
---------
servicemix-vfs
{http://servicemix.org/wsnotification}Publisher:Anonymous
servicemix-cxf-se
servicemix-scripting
servicemix-smpp
servicemix-cxf-bc
servicemix-snmp
servicemix-jms
servicemix-file
servicemix-drools
{http://servicemix.org/wsnotification}CreatePullPoint:Broker
{http://servicemix.org/wsnotification}NotificationBroker:Broker
servicemix-quartz
servicemix-http
servicemix-eip
servicemix-ftp
servicemix-wsn2005
servicemix-osworkflow
servicemix-exec
{urn:foo}FooService:FooImplPort
servicemix-bean
servicemix-validation
servicemix-camel
root
servicemix-mail
servicemix-saxon
karaf@root> jbi:list
Components
----------
State Name Description
[Started ] [servicemix-http ]
[Started ] [servicemix-snmp ]
[Started ] [servicemix-file ]
[Started ] [servicemix-wsn2005 ]
[Started ] [servicemix-saxon ]
[Started ] [servicemix-exec ]
[Started ] [servicemix-bean ]
[Started ] [servicemix-jms ]
[Started ] [servicemix-vfs ]
[Started ] [servicemix-ftp ]
[Started ] [servicemix-cxf-se ]
[Started ] [servicemix-eip ]
[Started ] [servicemix-scripting ]
[Started ] [servicemix-quartz ]
[Started ] [servicemix-mail ]
[Started ] [servicemix-osworkflow ]
[Started ] [servicemix-smpp ]
[Started ] [servicemix-camel ]
[Started ] [servicemix-validation ]
[Started ] [servicemix-drools ]
[Started ] [servicemix-cxf-bc ]
Service Assemblies
------------------
State Name Description
[Started ] [foo-bundle ]
On Oct 31, 2010, at 3:00 AM, Freeman Fang wrote:
> Hi Dan,
>
> What's the exact smx4 version you are using?
> What's the output for both nmr:list and jbi:list after you deploy your bundle?
>
> Freeman
> On 2010-10-30, at 上午5:42, Dan Powell wrote:
>
>> Yes, that's what I've done. What I see in the logs is that both endpoints get deployed, the publish addresses are both logged, but after "All endpoints have been deployed and components initialized. Registering service assembly." I see "Changing SA state to Stopped" followed by a "Registering endpoint" but only for the one with the ENDPOINT_NAME=FooImplPort not the ENDPOINT_NAME=soap. The second endpoint never gets restarted.
>>
>> Dan
>>
>> On Oct 29, 2010, at 3:17 PM, Jean-Baptiste Onofré wrote:
>>
>>> Hi Dan,
>>>
>>> You can gather cxfbc and cxfse in the same xbean.xml (and so in the same bundle).
>>> In fact, now you can gather all components in the same xbean.xml. After you can package this xbean.xml in a bundle or directly drop into the deploy folder.
>>>
>>> To "expose" the component endpoints as an OSGi service, simply add:
>>>
>>> <bean class="org.apache.servicemix.commons.osgi.EndpointExporter"/>
>>>
>>> Take a look on:
>>> http://servicemix.apache.org/SMX4/creating-an-osgi-bundle-for-deploying-jbi-endpoints.html
>>> http://servicemix.apache.org/SMX4NMR/3-deploying-jbi-components-without-the-jbi-packaging.html
>>> http://servicemix.apache.org/file-to-xmpp-bridge.html
>>>
>>> Regards
>>> JB
>>>
>>> On 10/29/2010 05:54 PM, Dan Powell wrote:
>>>> Is it possible to combine the cxfbc:consumer and cxfse:endpoint into a single bundle? t seems the second endpoint to start replaces the first. When I list both in the Spring beans.xml with the cxfbc:consumer first, I see the publish address for both endpoints (one as http://0.0.0.0:9090/foo and the other as jbi://ID-10-122-125-215-12bf890562c-2-0) logged to data/servicemix.log, but the HTTP port is not listening. Also if I reverse the order and declare the cxfbc:consumer after the cxfse:endpoint, the HTTP port is listening and serves the ?wsdl request but invocations of the service result in "Could not dispatch exchange. No matching endpoints."
>>>>
>>>> Thanks!
>>>>
>>>> Dan
>>
>
>
> --
> Freeman Fang
>
> ------------------------
>
> FuseSource: http://fusesource.com
> blog: http://freemanfang.blogspot.com
> twitter: http://twitter.com/freemanfang
> Apache Servicemix:http://servicemix.apache.org
> Apache Cxf: http://cxf.apache.org
> Apache Karaf: http://karaf.apache.org
> Apache Felix: http://felix.apache.org
>
Re: Combine cxfbc:consumer and cxfse:endpoint In OSGi Bundle
Posted by Freeman Fang <fr...@gmail.com>.
Hi Dan,
What's the exact smx4 version you are using?
What's the output for both nmr:list and jbi:list after you deploy your
bundle?
Freeman
On 2010-10-30, at 上午5:42, Dan Powell wrote:
> Yes, that's what I've done. What I see in the logs is that both
> endpoints get deployed, the publish addresses are both logged, but
> after "All endpoints have been deployed and components initialized.
> Registering service assembly." I see "Changing SA state to Stopped"
> followed by a "Registering endpoint" but only for the one with the
> ENDPOINT_NAME=FooImplPort not the ENDPOINT_NAME=soap. The second
> endpoint never gets restarted.
>
> Dan
>
> On Oct 29, 2010, at 3:17 PM, Jean-Baptiste Onofré wrote:
>
>> Hi Dan,
>>
>> You can gather cxfbc and cxfse in the same xbean.xml (and so in the
>> same bundle).
>> In fact, now you can gather all components in the same xbean.xml.
>> After you can package this xbean.xml in a bundle or directly drop
>> into the deploy folder.
>>
>> To "expose" the component endpoints as an OSGi service, simply add:
>>
>> <bean class="org.apache.servicemix.commons.osgi.EndpointExporter"/>
>>
>> Take a look on:
>> http://servicemix.apache.org/SMX4/creating-an-osgi-bundle-for-deploying-jbi-endpoints.html
>> http://servicemix.apache.org/SMX4NMR/3-deploying-jbi-components-without-the-jbi-packaging.html
>> http://servicemix.apache.org/file-to-xmpp-bridge.html
>>
>> Regards
>> JB
>>
>> On 10/29/2010 05:54 PM, Dan Powell wrote:
>>> Is it possible to combine the cxfbc:consumer and cxfse:endpoint
>>> into a single bundle? t seems the second endpoint to start
>>> replaces the first. When I list both in the Spring beans.xml with
>>> the cxfbc:consumer first, I see the publish address for both
>>> endpoints (one as http://0.0.0.0:9090/foo and the other as jbi://
>>> ID-10-122-125-215-12bf890562c-2-0) logged to data/servicemix.log,
>>> but the HTTP port is not listening. Also if I reverse the order
>>> and declare the cxfbc:consumer after the cxfse:endpoint, the HTTP
>>> port is listening and serves the ?wsdl request but invocations of
>>> the service result in "Could not dispatch exchange. No matching
>>> endpoints."
>>>
>>> Thanks!
>>>
>>> Dan
>
--
Freeman Fang
------------------------
FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org
Re: Combine cxfbc:consumer and cxfse:endpoint In OSGi Bundle
Posted by Dan Powell <da...@abakas.com>.
Yes, that's what I've done. What I see in the logs is that both endpoints get deployed, the publish addresses are both logged, but after "All endpoints have been deployed and components initialized. Registering service assembly." I see "Changing SA state to Stopped" followed by a "Registering endpoint" but only for the one with the ENDPOINT_NAME=FooImplPort not the ENDPOINT_NAME=soap. The second endpoint never gets restarted.
Dan
On Oct 29, 2010, at 3:17 PM, Jean-Baptiste Onofré wrote:
> Hi Dan,
>
> You can gather cxfbc and cxfse in the same xbean.xml (and so in the same bundle).
> In fact, now you can gather all components in the same xbean.xml. After you can package this xbean.xml in a bundle or directly drop into the deploy folder.
>
> To "expose" the component endpoints as an OSGi service, simply add:
>
> <bean class="org.apache.servicemix.commons.osgi.EndpointExporter"/>
>
> Take a look on:
> http://servicemix.apache.org/SMX4/creating-an-osgi-bundle-for-deploying-jbi-endpoints.html
> http://servicemix.apache.org/SMX4NMR/3-deploying-jbi-components-without-the-jbi-packaging.html
> http://servicemix.apache.org/file-to-xmpp-bridge.html
>
> Regards
> JB
>
> On 10/29/2010 05:54 PM, Dan Powell wrote:
>> Is it possible to combine the cxfbc:consumer and cxfse:endpoint into a single bundle? t seems the second endpoint to start replaces the first. When I list both in the Spring beans.xml with the cxfbc:consumer first, I see the publish address for both endpoints (one as http://0.0.0.0:9090/foo and the other as jbi://ID-10-122-125-215-12bf890562c-2-0) logged to data/servicemix.log, but the HTTP port is not listening. Also if I reverse the order and declare the cxfbc:consumer after the cxfse:endpoint, the HTTP port is listening and serves the ?wsdl request but invocations of the service result in "Could not dispatch exchange. No matching endpoints."
>>
>> Thanks!
>>
>> Dan
Re: Combine cxfbc:consumer and cxfse:endpoint In OSGi Bundle
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Dan,
You can gather cxfbc and cxfse in the same xbean.xml (and so in the same
bundle).
In fact, now you can gather all components in the same xbean.xml. After
you can package this xbean.xml in a bundle or directly drop into the
deploy folder.
To "expose" the component endpoints as an OSGi service, simply add:
<bean class="org.apache.servicemix.commons.osgi.EndpointExporter"/>
Take a look on:
http://servicemix.apache.org/SMX4/creating-an-osgi-bundle-for-deploying-jbi-endpoints.html
http://servicemix.apache.org/SMX4NMR/3-deploying-jbi-components-without-the-jbi-packaging.html
http://servicemix.apache.org/file-to-xmpp-bridge.html
Regards
JB
On 10/29/2010 05:54 PM, Dan Powell wrote:
> Is it possible to combine the cxfbc:consumer and cxfse:endpoint into a single bundle? t seems the second endpoint to start replaces the first. When I list both in the Spring beans.xml with the cxfbc:consumer first, I see the publish address for both endpoints (one as http://0.0.0.0:9090/foo and the other as jbi://ID-10-122-125-215-12bf890562c-2-0) logged to data/servicemix.log, but the HTTP port is not listening. Also if I reverse the order and declare the cxfbc:consumer after the cxfse:endpoint, the HTTP port is listening and serves the ?wsdl request but invocations of the service result in "Could not dispatch exchange. No matching endpoints."
>
> Thanks!
>
> Dan