You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by David Bosschaert <da...@gmail.com> on 2009/05/01 10:09:25 UTC

Re: dosgi - Problems with Client binding to more then one remote service

Hi Todd,

To islote the problem I tried to reproduce it without spring, for this
I modified the DOSGi Greeter demo. On the server side I simply
register two the same object twice under two contexts:
    public void start(BundleContext bc) throws Exception {
        Dictionary<String, Object> props = new Hashtable<String, Object>();

        props.put("osgi.remote.interfaces", "*");
        props.put("osgi.remote.configuration.type", "pojo");
        props.put("osgi.remote.configuration.pojo.address",
                "http://localhost:9090/greeterA");

        registration = bc.registerService(GreeterService.class.getName(),
                                          new GreeterServiceImpl(), props);

        Dictionary<String, Object> props2 = new Hashtable<String, Object>();

        props2.put("osgi.remote.interfaces", "*");
        props2.put("osgi.remote.configuration.type", "pojo");
        props2.put("osgi.remote.configuration.pojo.address",
                "http://localhost:9090/greeterB");

        registration2 = bc.registerService(GreeterService.class.getName(),
                                          new GreeterServiceImpl(), props2);


While on the client side I register both in my remote-services.xml file:
<service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0">
  <service-description>
    <provide interface="org.apache.cxf.dosgi.samples.greeter.GreeterService" />
    <property name="osgi.remote.interfaces">*</property>
    <property name="osgi.remote.configuration.type">pojo</property>
    <property name="osgi.remote.configuration.pojo.address">http://localhost:9090/greeterB</property>
  </service-description>
  <service-description>
    <provide interface="org.apache.cxf.dosgi.samples.greeter.GreeterService" />
    <property name="osgi.remote.interfaces">*</property>
    <property name="osgi.remote.configuration.type">pojo</property>
    <property name="osgi.remote.configuration.pojo.address">http://localhost:9090/greeterA</property>
  </service-description>
</service-descriptions>

This works well for me, the consumer gets a reference to both remote
services and can invoke on them.

See if it works for you if you go back to a more basic scenario. If it
doesn't could you maybe provide a test case (with code)?

Thanks,

David

2009/4/30 Nist, Todd (IHG) <To...@ihg.com>:
>
> Hi,
>
> I am encountering the following problem with a client, written in spring osgi / dm
> that is attempting to bind to 2 osgi services using distributed osgi provided by
> CXF.  If I only define 1 <service-description> and reference one of the services
> the client works fine.  If I define 2 <service-description> tags within
> <service-descriptions> as below I get the error shown below.
>
> When the client is started I see the following errors:
>
> Apr 30, 2009 12:14:55 PM org.springframework.osgi.extender.support.DefaultOsgiAp
> plicationContextCreator createApplicationContext
> INFO: Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [C
> ampaign Service Consumer Bundle (com.ihg.crm.service.client)]
> -> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryS
> ervice bundleChanged
> INFO: bundle changed: com.ihg.crm.service.client
> Apr 30, 2009 12:14:55 PM org.springframework.context.support.AbstractApplication
> Context prepareRefresh
> INFO: Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicati
> onContext@1d32a62: display name [OsgiBundleXmlApplicationContext(bundle=com.ihg.
> crm.service.client, config=osgibundle:/META-INF/spring/*.xml)]; startup date [Th
> u Apr 30 12:14:55 EDT 2009]; root of context hierarchy
> Apr 30, 2009 12:14:55 PM org.springframework.osgi.context.support.AbstractOsgiBu
> ndleApplicationContext unpublishContextAsOsgiService
> INFO: Unpublishing application context OSGi service for bundle Campaign Service
> Consumer Bundle (com.ihg.crm.service.client)
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
> om.ihg.crm.service.campaign.CampaignService]
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
> om.ihg.crm.service.campaign.CampaignService]
> Apr 30, 2009 12:14:55 PM org.springframework.beans.factory.xml.XmlBeanDefinition
> Reader loadBeanDefinitions
> INFO: Loading XML bean definitions from URL [bundle://37.0:0/META-INF/spring/bun
> dle-context-osgi.xml]
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: (|(service.interface=com.ihg.crm.service.campaign.Campaig
> nService)(service.interface=com.ihg.crm.service.campaign.OfferService)) matches
> [com.ihg.crm.service.campaign.CampaignService]
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
> om.ihg.crm.service.campaign.OfferService]
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Disco
> veryCallback serviceChanged
> INFO: Notified - AVAILABLE: [com.ihg.crm.service.campaign.OfferService] endpoint
>  id: null
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook unkno
> wnEndpointId
> WARNING: registering proxy with unknown duplicate status as endpoint ID unset
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook cache
> EndpointId
> WARNING: cannot cache proxy registration as endpoint ID unset
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
> om.ihg.crm.service.campaign.OfferService]
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Disco
> veryCallback serviceChanged
> INFO: Notified - AVAILABLE: [com.ihg.crm.service.campaign.OfferService] endpoint
>  id: null
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook unkno
> wnEndpointId
> WARNING: registering proxy with unknown duplicate status as endpoint ID unset
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook cache
> EndpointId
> WARNING: cannot cache proxy registration as endpoint ID unset
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: (|(service.interface=com.ihg.crm.service.campaign.Campaig
> nService)(service.interface=com.ihg.crm.service.campaign.OfferService)) matches
> [com.ihg.crm.service.campaign.OfferService]
> Apr 30, 2009 12:14:56 PM org.springframework.context.support.AbstractApplication
> Context obtainFreshBeanFactory
> INFO: Bean factory for application context [org.springframework.osgi.context.sup
> port.OsgiBundleXmlApplicationContext@1d32a62]: org.springframework.beans.factory
> .support.DefaultListableBeanFactory@eb6e29
> Apr 30, 2009 12:14:56 PM org.springframework.osgi.extender.internal.dependencies
> .startup.DependencyServiceManager doFindDependencies
> INFO: Adding OSGi service dependency for importer [&campaignServiceRef] matching
>  OSGi filter [(objectClass=com.ihg.crm.service.campaign.CampaignService)]
> Apr 30, 2009 12:14:56 PM org.springframework.osgi.extender.internal.dependencies
> .startup.DependencyServiceManager findServiceDependencies
> INFO: OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=
> osgibundle:/META-INF/spring/*.xml) is waiting for unsatisfied dependencies [[&ca
> mpaignServiceRef]]
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook looku
> pDiscoveryService
> INFO: lookup discovery service: interface: com.ihg.crm.service.campaign.Campaign
> Service filter: null
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice updateTracker
> INFO: updating tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discov
> eryCallback@3e926
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice addTracker
> INFO: adding tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discover
> yCallback@3e926 collection: [com.ihg.crm.service.campaign.OfferService, com.ihg.
> crm.service.campaign.OfferService, com.ihg.crm.service.campaign.CampaignService]
>  registered against prop: osgi.discovery.interest.interfaces
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice addTracker
> INFO: adding tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discover
> yCallback@3e926 collection: [(|(service.interface=com.ihg.crm.service.campaign.C
> ampaignService)(service.interface=com.ihg.crm.service.campaign.OfferService))] r
> egistered against prop: osgi.discovery.interest.filters
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: search for matches to trigger callbacks with delta: []
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: search for matches to trigger callbacks with delta: []
>
>
> The 2 services and client code are written using spring osgi / dm and running
> within equinox for the server and felix for the client.  The services
> bundle-context-osgi.xml files look as follows:
>
>
> CampaignService - bundle-context-osgi.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>
>    <osgi:reference id="dataSourceRef" interface="javax.sql.DataSource"/>
>    <osgi:service interface="com.ihg.crm.service.campaign.CampaignService">
>          <osgi:service-properties>
>            <entry key="osgi.remote.interfaces" value="*" />
>            <!-- entry key="osgi.remote.configuration.type" value="pojo" / -->
>            <!-- entry key="osgi.remote.configuration.pojo.httpservice.context" value="/offer" / -->
>          </osgi:service-properties>
>          <bean class="com.ihg.crm.service.campaign.impl.CampaignServiceImpl"
>              init-method="start">
>              <property name="dataSource" ref="dataSourceRef" />
>          </bean>
>        </osgi:service>
> </beans>
>
> OfferService - bundle-context-osgi.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>
>        <osgi:reference id="dataSourceRef" interface="javax.sql.DataSource"/>
>        <osgi:service interface="com.ihg.crm.service.campaign.OfferService">
>          <osgi:service-properties>
>            <entry key="osgi.remote.interfaces" value="*" />
>          </osgi:service-properties>
>          <bean class="com.ihg.crm.service.offer.impl.OfferServiceImpl"
>              init-method="start">
>              <property name="dataSource" ref="dataSourceRef" />
>          </bean>
>        </osgi:service>
> </beans>
>
> A ss on the equinox instance shows all bundles deployed and active:
>
> osgi> ss
>
> Framework is launched.
>
> id      State       Bundle
> 0       ACTIVE      org.eclipse.osgi_3.5.0.v20090311-1300
> 1       ACTIVE      org.eclipse.osgi.services_3.2.0.v20090306-1900
> 2       ACTIVE      javax.servlet_2.5.0.v200806031605
> 3       ACTIVE      com.springsource.org.apache.commons.pool_1.3.0
> 4       ACTIVE      com.springsource.org.apache.commons.dbcp_1.2.2.osgi
> 5       ACTIVE      com.springsource.javax.resource_1.5.0
> 6       ACTIVE      com.springsource.oracle.jdbc_10.2.0.2
> 7       ACTIVE      org.apache.geronimo.specs.geronimo-annotation_1.0_spec_1.1.1
> 8       ACTIVE      org.apache.geronimo.specs.geronimo-activation_1.1_spec_1.0.2
> 9       ACTIVE      org.apache.geronimo.specs.geronimo-javamail_1.4_spec_1.2.0
> 10      ACTIVE      org.apache.geronimo.specs.geronimo-ws-metadata_2.0_spec_1.1.2
> 11      ACTIVE      com.springsource.slf4j.org.apache.commons.logging_1.5.0
> 12      ACTIVE      com.springsource.slf4j.api_1.5.0
>                    Fragments=13
> 13      RESOLVED    com.springsource.slf4j.log4j_1.5.0
>                    Master=12
> 14      ACTIVE      org.springframework.osgi.log4j.osgi_1.2.15.SNAPSHOT
> 15      ACTIVE      com.springsource.org.jdom_1.0.0
> 16      ACTIVE      org.springframework.core_2.5.6
> 17      ACTIVE      org.springframework.beans_2.5.6
> 18      ACTIVE      org.springframework.context_2.5.6
> 19      ACTIVE      org.springframework.transaction_2.5.6
> 20      ACTIVE      org.springframework.jdbc_2.5.6
> 21      ACTIVE      com.springsource.org.aopalliance_1.0.0
> 22      ACTIVE      org.springframework.aop_2.5.6
> 23      ACTIVE      org.springframework.osgi.io_1.2.0
> 24      ACTIVE      org.springframework.osgi.core_1.2.0
> 25      ACTIVE      org.springframework.osgi.extender_1.2.0
> 26      ACTIVE      org.ops4j.pax.web.service_0.5.1
> 27      ACTIVE      org.apache.servicemix.bundles.jaxb-impl_2.1.6.1
> 28      ACTIVE      org.apache.servicemix.bundles.wsdl4j_1.6.1.1
> 29      ACTIVE      org.apache.servicemix.bundles.xmlsec_1.3.0.1
> 30      ACTIVE      org.apache.servicemix.bundles.xmlschema_1.4.3.1
> 31      ACTIVE      org.apache.servicemix.bundles.asm_2.2.3.1
> 32      ACTIVE      org.apache.servicemix.bundles.xmlresolver_1.2.0.1
> 33      ACTIVE      org.apache.servicemix.bundles.neethi_2.0.4.1
> 34      ACTIVE      org.apache.servicemix.bundles.woodstox_3.2.7.1
> 35      ACTIVE      org.apache.cxf.bundle-minimal_2.2.1.SNAPSHOT
> 36      ACTIVE      org.apache.servicemix.specs.saaj-api-1.3_1.1.1
> 37      ACTIVE      org.apache.servicemix.specs.stax-api-1.0_1.1.1
> 38      ACTIVE      org.apache.servicemix.specs.jaxb-api-2.1_1.1.1
> 39      ACTIVE      org.apache.servicemix.specs.jaxws-api-2.1_1.1.1
> 40      ACTIVE      cxf-dosgi-ri-discovery-local_1.0.0.SNAPSHOT
> 41      ACTIVE      cxf-dosgi-ri-dsw-cxf_1.0.0.SNAPSHOT
> 42      ACTIVE      datasource_0.0.1
> 43      ACTIVE      com.ihg.crm.model.campaign_0.0.1.SNAPSHOT
> 44      ACTIVE      com.ihg.crm.service.campaign.interface_0.0.1.SNAPSHOT
> 45      ACTIVE      com.ihg.crm.service.offer.impl_0.0.1.SNAPSHOT
> 46      ACTIVE      CampaignServiceImpl_0.0.1
> 47      ACTIVE      com.unicacorp.interact.api_0.0.0
>
>
> I am able to access both services via the browser by pointing to the url which they are exposed on and receive the wsdl back (http://10.163.163.64:9000/com/ihg/crm/service/campaign/CampaignService?wsdl and
> http://10.163.163.64:9000/com/ihg/crm/service/campaign/OfferService?wsdl) so I can see that both services are up and running.
>
>
> The client bundle-osgi-context.xml looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>
>  <osgi:reference id="campaignServiceRef" interface="com.ihg.crm.service.campaign.CampaignService"/>
>  <osgi:reference id="offerServiceRef" interface="com.ihg.crm.service.campaign.OfferService"/>
>
>  <bean class="com.ihg.crm.service.campaign.client.CampaignServiceConsumer"
>        init-method="start">
>    <property name="campaignService" ref="campaignServiceRef"/>
>    <property name="offerService" ref = "offerServiceRef"/>
>  </bean>
>
> </beans>
>
> My Client has the following definition for discovering the services within the remote-services.xml
>
> <service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0">
>  <service-description>
>    <provide interface="com.ihg.crm.service.campaign.CampaignService" />
>    <property name="osgi.remote.interfaces">*</property>
>    <property name="service.intents">SOAP HTTP</property>
>    <property name="osgi.remote.configuration.type">pojo</property>
>    <!-- property name="osgi.remote.configuration.pojo.address">http://localhost:8080/offer</property -->
>    <property name="osgi.remote.configuration.pojo.address">
>        http://10.163.163.64:9000/com/ihg/crm/service/campaign/CampaignService
>    </property>
>  </service-description>
>  <service-description>
>    <provide interface="com.ihg.crm.service.campaign.OfferService" />
>    <property name="osgi.remote.interfaces">*</property>
>    <property name="service.intents">SOAP HTTP</property>
>    <property name="osgi.remote.configuration.type">pojo</property>
>    <!-- property name="osgi.remote.configuration.pojo.address">http://localhost:8080/offer</property -->
>    <property name="osgi.remote.configuration.pojo.address">
>        http://10.163.163.64:9000/com/ihg/crm/service/campaign/OfferService
>    </property>
>  </service-description>
> </service-descriptions>
>
>
> Client Bundles (Campaign Service Consumer Bundle) - Felix:
>
> -> ps
> START LEVEL 1
>   ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (1.4.1)
> [   1] [Active     ] [    1] Apache Felix Shell Service (1.0.2)
> [   2] [Active     ] [    1] Apache Felix Shell TUI (1.0.2)
> [   3] [Active     ] [    1] Apache Felix Bundle Repository (1.2.1)
> [   4] [Active     ] [    1] OSGi R4 Compendium Bundle (4.1.0)
> [   5] [Active     ] [    1] geronimo-annotation_1.0_spec (1.1.1)
> [   6] [Active     ] [    1] geronimo-activation_1.1_spec (1.0.2)
> [   7] [Active     ] [    1] geronimo-javamail_1.4_spec (1.2)
> [   8] [Active     ] [    1] geronimo-ws-metadata_2.0_spec (1.1.2)
> [   9] [Active     ] [    1] Apache Commons Logging (1.1.1)
> [  10] [Active     ] [    1] JDOM DOM Processor (1.0.0)
> [  11] [Active     ] [    1] Spring Core (2.5.6)
> [  12] [Active     ] [    1] Spring Beans (2.5.6)
> [  13] [Active     ] [    1] Spring Context (2.5.6)
> [  14] [Active     ] [    1] AOP Alliance API (1.0.0)
> [  15] [Active     ] [    1] Spring AOP (2.5.6)
> [  16] [Active     ] [    1] spring-osgi-io (1.2.0)
> [  17] [Active     ] [    1] spring-osgi-core (1.2.0)
> [  18] [Active     ] [    1] spring-osgi-extender (1.2.0)
> [  19] [Active     ] [    1] OPS4J Pax Web - Service (0.5.1)
> [  20] [Active     ] [    1] Apache ServiceMix Bundles: jaxb-impl-2.1.6 (2.1.6.1)
> [  21] [Active     ] [    1] Apache ServiceMix Bundles: wsdl4j-1.6.1 (1.6.1.1)
> [  22] [Active     ] [    1] Apache ServiceMix Bundles: xmlsec-1.3.0 (1.3.0.1)
> [  23] [Active     ] [    1] Apache ServiceMix Bundles: xmlschema-1.4.3 (1.4.3.1)
> [  24] [Active     ] [    1] Apache ServiceMix Bundles: asm-2.2.3 (2.2.3.1)
> [  25] [Active     ] [    1] Apache ServiceMix Bundles: xmlresolver-1.2 (1.2.0.1)
> [  26] [Active     ] [    1] Apache ServiceMix Bundles: neethi-2.0.4 (2.0.4.1)
> [  27] [Active     ] [    1] Apache ServiceMix Bundles: woodstox-3.2.7 (3.2.7.1)
> [  28] [Active     ] [    1] Apache CXF Minimal Bundle Jar (2.2.1.SNAPSHOT)
> [  29] [Active     ] [    1] Apache ServiceMix Specs :: SAAJ API 1.3 (1.1.1)
> [  30] [Active     ] [    1] Apache ServiceMix Specs :: STAX API 1.0 (1.1.1)
> [  31] [Active     ] [    1] Apache ServiceMix Specs :: JAXB API 2.1 (1.1.1)
> [  32] [Active     ] [    1] Apache ServiceMix Specs :: JAXWS API 2.1 (1.1.1)
> [  33] [Active     ] [    1] CXF Local Discovery Service Bundle (1.0.0.SNAPSHOT)
> [  34] [Active     ] [    1] CXF Distributed Software Bundle (1.0.0.SNAPSHOT)
> [  35] [Active     ] [    1] Campaign Model Bundle (0.0.1.SNAPSHOT)
> [  36] [Active     ] [    1] Campaign Service Interfaces (0.0.1.SNAPSHOT)
> [  37] [Active     ] [    1] Campaign Service Consumer Bundle (0.0.1.SNAPSHOT)
>
>
> I am not sure what I am missing but feel sure it is something within the configuration of
> the bundle-context-osgi.xml of the server or client or the remote-services.xml entries, but
> am at a loss as to what it is.  Any guidance in this would be much appreciated.
>
> Thanks in advance for the assistance.
>
> Regards,
> Todd
>

RE: dosgi - Problems with Client binding to more then one remote service

Posted by "Nist, Todd (IHG)" <To...@ihg.com>.
Hi David,

Pulled the code and tested it this weekend and it all works great.  Thanks for the update and getting this addressed so quickly.

Regards,
Todd

-----Original Message-----
From: David Bosschaert [mailto:david.bosschaert@gmail.com] 
Sent: Wednesday, May 27, 2009 8:50 AM
To: users@cxf.apache.org
Subject: Re: dosgi - Problems with Client binding to more then one remote service

Hi Todd,

Just to let you know, the original problem that started this thread
off (CXF-2200 - consuming multiple remote services with Spring-DM) has
now been fixed on the CXF/DOSGi trunk.

Cheers,

David

2009/5/7 Nist, Todd (IHG) <To...@ihg.com>:
> Hi David,
>
> Just did some testing and the fix you committed is working great; it resolved several of the team's problems with consuming multiple remote services.  Thanks for the note on this.
>
> Regards,
> Todd
>
> -----Original Message-----
> From: Nist, Todd (IHG)
> Sent: Wednesday, May 06, 2009 10:26 AM
> To: users@cxf.apache.org
> Subject: RE: dosgi - Problems with Client binding to more then one remote service
>
> Hi David,
>
> Thanks for the heads up.  One of the developers on the team was encountering this issues when the bundle first became active.  If he stopped the bundle and the started it again, it would discover all of the services, so it sounds like this will address the issue.  I just pulled the latest code from SVN and rebuilt it.  We are in the process of doing some testing right now and do not want to introduce a new variable until we finish this.  Once completed, we will deploy the new bundles and see if does address the issue we are encountering as well.  Will let you know.
>
> Thanks again.
>
> Regards,
> Todd
>
> -----Original Message-----
> From: David Bosschaert [mailto:david.bosschaert@gmail.com]
> Sent: Wednesday, May 06, 2009 7:01 AM
> To: users@cxf.apache.org
> Subject: Re: dosgi - Problems with Client binding to more then one remote service
>
> Hi Todd,
>
> Just to let you know that I stumbled across some additional issues
> regarding consuming multiple remote services even in the non-spring DM
> case (sometimes it was only finding one). I've committed a fix for
> this just now, which should be in the 1.0 release when it's out or you
> can pick it up from the nightly snapshots from tomorrow...
>
> Cheers,
>
> David
>
> 2009/5/4 Nist, Todd (IHG) <To...@ihg.com>:
>>
>> Hi David,
>>
>> Thanks a lot for taking the time to look into this and providing a interim solution.  I applied the recommended changes to my class for now and it is working like a charm; this is a huge load of my mind.
>>
>> Again, thanks for the recommended solution and I will let you know if I find out anything else on how to get it to work with pure Spring DM and the osgi.reference tag.
>>
>> Regards,
>> Todd
>>
>

Re: dosgi - Problems with Client binding to more then one remote service

Posted by David Bosschaert <da...@gmail.com>.
Hi Todd,

Just to let you know, the original problem that started this thread
off (CXF-2200 - consuming multiple remote services with Spring-DM) has
now been fixed on the CXF/DOSGi trunk.

Cheers,

David

2009/5/7 Nist, Todd (IHG) <To...@ihg.com>:
> Hi David,
>
> Just did some testing and the fix you committed is working great; it resolved several of the team's problems with consuming multiple remote services.  Thanks for the note on this.
>
> Regards,
> Todd
>
> -----Original Message-----
> From: Nist, Todd (IHG)
> Sent: Wednesday, May 06, 2009 10:26 AM
> To: users@cxf.apache.org
> Subject: RE: dosgi - Problems with Client binding to more then one remote service
>
> Hi David,
>
> Thanks for the heads up.  One of the developers on the team was encountering this issues when the bundle first became active.  If he stopped the bundle and the started it again, it would discover all of the services, so it sounds like this will address the issue.  I just pulled the latest code from SVN and rebuilt it.  We are in the process of doing some testing right now and do not want to introduce a new variable until we finish this.  Once completed, we will deploy the new bundles and see if does address the issue we are encountering as well.  Will let you know.
>
> Thanks again.
>
> Regards,
> Todd
>
> -----Original Message-----
> From: David Bosschaert [mailto:david.bosschaert@gmail.com]
> Sent: Wednesday, May 06, 2009 7:01 AM
> To: users@cxf.apache.org
> Subject: Re: dosgi - Problems with Client binding to more then one remote service
>
> Hi Todd,
>
> Just to let you know that I stumbled across some additional issues
> regarding consuming multiple remote services even in the non-spring DM
> case (sometimes it was only finding one). I've committed a fix for
> this just now, which should be in the 1.0 release when it's out or you
> can pick it up from the nightly snapshots from tomorrow...
>
> Cheers,
>
> David
>
> 2009/5/4 Nist, Todd (IHG) <To...@ihg.com>:
>>
>> Hi David,
>>
>> Thanks a lot for taking the time to look into this and providing a interim solution.  I applied the recommended changes to my class for now and it is working like a charm; this is a huge load of my mind.
>>
>> Again, thanks for the recommended solution and I will let you know if I find out anything else on how to get it to work with pure Spring DM and the osgi.reference tag.
>>
>> Regards,
>> Todd
>>
>

RE: dosgi - Problems with Client binding to more then one remote service

Posted by "Nist, Todd (IHG)" <To...@ihg.com>.
Hi David,

Just did some testing and the fix you committed is working great; it resolved several of the team's problems with consuming multiple remote services.  Thanks for the note on this.

Regards,
Todd

-----Original Message-----
From: Nist, Todd (IHG) 
Sent: Wednesday, May 06, 2009 10:26 AM
To: users@cxf.apache.org
Subject: RE: dosgi - Problems with Client binding to more then one remote service

Hi David,

Thanks for the heads up.  One of the developers on the team was encountering this issues when the bundle first became active.  If he stopped the bundle and the started it again, it would discover all of the services, so it sounds like this will address the issue.  I just pulled the latest code from SVN and rebuilt it.  We are in the process of doing some testing right now and do not want to introduce a new variable until we finish this.  Once completed, we will deploy the new bundles and see if does address the issue we are encountering as well.  Will let you know.

Thanks again.

Regards,
Todd

-----Original Message-----
From: David Bosschaert [mailto:david.bosschaert@gmail.com] 
Sent: Wednesday, May 06, 2009 7:01 AM
To: users@cxf.apache.org
Subject: Re: dosgi - Problems with Client binding to more then one remote service

Hi Todd,

Just to let you know that I stumbled across some additional issues
regarding consuming multiple remote services even in the non-spring DM
case (sometimes it was only finding one). I've committed a fix for
this just now, which should be in the 1.0 release when it's out or you
can pick it up from the nightly snapshots from tomorrow...

Cheers,

David

2009/5/4 Nist, Todd (IHG) <To...@ihg.com>:
>
> Hi David,
>
> Thanks a lot for taking the time to look into this and providing a interim solution.  I applied the recommended changes to my class for now and it is working like a charm; this is a huge load of my mind.
>
> Again, thanks for the recommended solution and I will let you know if I find out anything else on how to get it to work with pure Spring DM and the osgi.reference tag.
>
> Regards,
> Todd
>

RE: dosgi - Problems with Client binding to more then one remote service

Posted by "Nist, Todd (IHG)" <To...@ihg.com>.
Hi David,

Thanks for the heads up.  One of the developers on the team was encountering this issues when the bundle first became active.  If he stopped the bundle and the started it again, it would discover all of the services, so it sounds like this will address the issue.  I just pulled the latest code from SVN and rebuilt it.  We are in the process of doing some testing right now and do not want to introduce a new variable until we finish this.  Once completed, we will deploy the new bundles and see if does address the issue we are encountering as well.  Will let you know.

Thanks again.

Regards,
Todd

-----Original Message-----
From: David Bosschaert [mailto:david.bosschaert@gmail.com] 
Sent: Wednesday, May 06, 2009 7:01 AM
To: users@cxf.apache.org
Subject: Re: dosgi - Problems with Client binding to more then one remote service

Hi Todd,

Just to let you know that I stumbled across some additional issues
regarding consuming multiple remote services even in the non-spring DM
case (sometimes it was only finding one). I've committed a fix for
this just now, which should be in the 1.0 release when it's out or you
can pick it up from the nightly snapshots from tomorrow...

Cheers,

David

2009/5/4 Nist, Todd (IHG) <To...@ihg.com>:
>
> Hi David,
>
> Thanks a lot for taking the time to look into this and providing a interim solution.  I applied the recommended changes to my class for now and it is working like a charm; this is a huge load of my mind.
>
> Again, thanks for the recommended solution and I will let you know if I find out anything else on how to get it to work with pure Spring DM and the osgi.reference tag.
>
> Regards,
> Todd
>

Re: dosgi - Problems with Client binding to more then one remote service

Posted by David Bosschaert <da...@gmail.com>.
Hi Todd,

Just to let you know that I stumbled across some additional issues
regarding consuming multiple remote services even in the non-spring DM
case (sometimes it was only finding one). I've committed a fix for
this just now, which should be in the 1.0 release when it's out or you
can pick it up from the nightly snapshots from tomorrow...

Cheers,

David

2009/5/4 Nist, Todd (IHG) <To...@ihg.com>:
>
> Hi David,
>
> Thanks a lot for taking the time to look into this and providing a interim solution.  I applied the recommended changes to my class for now and it is working like a charm; this is a huge load of my mind.
>
> Again, thanks for the recommended solution and I will let you know if I find out anything else on how to get it to work with pure Spring DM and the osgi.reference tag.
>
> Regards,
> Todd
>

RE: dosgi - Problems with Client binding to more then one remote service

Posted by "Nist, Todd (IHG)" <To...@ihg.com>.
Hi David,

Thanks a lot for taking the time to look into this and providing a interim solution.  I applied the recommended changes to my class for now and it is working like a charm; this is a huge load of my mind.

Again, thanks for the recommended solution and I will let you know if I find out anything else on how to get it to work with pure Spring DM and the osgi.reference tag.

Regards,
Todd 

-----Original Message-----
From: David Bosschaert [mailto:david.bosschaert@gmail.com]
Sent: Sat 5/2/2009 5:54 PM
To: users@cxf.apache.org
Subject: Re: dosgi - Problems with Client binding to more then one remote service
 
Hi Todd,

I think I've been able to reproduce your problem. It has something to
do with how Spring interacts with the service registry, I've added
https://issues.apache.org/jira/browse/CXF-2200 for this, as this
should obviously work.

I managed to get a workaround that would hopefully keep you going for
the moment. I used the spring-dm demo that's part of the CXF-DOSGi
codebase as a basis for this (it's here in SVN
http://svn.apache.org/repos/asf/cxf/dosgi/trunk/samples/spring_dm).
Instead of using Spring-DM for depending on OSGi services (with
<osgi:reference /> tags), I'm using an ordinary OSGi Service Tracker
instead. I can still do this from a consuming Spring-DM Bean, which I
made to implement the BundleContextAware interface, which means it
gets hold of the BundleContext. It also implements the
InitializingBean interface, which means that after Spring has called
all the setters, I can start my OSGi ServiceTracker and start looking
for the service. When it finds one, you're getting the addingService()
callback.

I've attached the source code for my Spring consumer bean that
consumes two different services using this technique. It's obvious not
as elegant as it should be and is really meant as a temporary
workaround, hopefully it will be enough to keep you going. I'll make
sure to see if I can fix CXF-2200 as soon as I can.

Hope this helps,

David

2009/5/2 Nist, Todd (IHG) <To...@ihg.com>:
> Hi David,
>
> I have followed your advice, and can expose the services using spring-dm I just can to seem to be able to consume more then one service at a time.  When I attempt too I see the following which will eventually timeout:
>
> [2009-05-01 07:07:23,  2938]DEBUG[startWatchDog](DependencyWaiterApplicationContextExecutor:485) - Asynch wait-for-dependencies started...
> [2009-05-01 07:12:23,302951]DEBUG[deregister](DependencyServiceManager:339) - Deregistering service dependency dependencyDetector for OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
> [2009-05-01 07:12:23,302951] WARN[timeout](DependencyWaiterApplicationContextExecutor:453) - Timeout occurred before finding service dependencies for [OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)]
> [2009-05-01 07:12:23,302951]DEBUG[close](DependencyWaiterApplicationContextExecutor:331) - Closing appCtx for OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
> [2009-05-01 07:12:23,302967]DEBUG[close](DependencyWaiterApplicationContextExecutor:343) - Cleaning up appCtx OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
> [2009-05-01 07:12:23,302967] INFO[destroySingletons](DefaultSingletonBeanRegistry:421) - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12dd76: defining beans [helloServiceRef,goodByServiceRef,com.ihg.crm.service.client.MultiServiceTestClient#0]; root of factory hierarchy
> [2009-05-01 07:12:23,302967]DEBUG[destroy](DisposableBeanAdapter:148) - Invoking destroy() on bean with name 'goodByServiceRef'
> [2009-05-01 07:12:23,302967]DEBUG[destroy](DisposableBeanAdapter:148) - Invoking destroy() on bean with name 'helloServiceRef'
> [2009-05-01 07:12:23,302967]DEBUG[deregister](DependencyServiceManager:339) - Deregistering service dependency dependencyDetector for OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
> [2009-05-01 07:12:23,302967]ERROR[fail](DependencyWaiterApplicationContextExecutor:432) - Unable to create application context for [com.ihg.crm.service.client], unsatisfied dependencies: Dependency on [(objectClass=com.ihg.crm.service.campaign.hello.HelloService)] (from bean [&helloServiceRef]), Dependency on [(objectClass=com.ihg.crm.service.campaign.goodby.GoodByService)] (from bean [&goodByServiceRef])
> org.springframework.context.ApplicationContextException: Application context initialization for 'com.ihg.crm.service.client' has timed out
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:462)
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:51)
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$WatchDogTask.run(DependencyWaiterApplicationContextExecutor.java:108)
>        at java.util.TimerThread.mainLoop(Timer.java:512)
>        at java.util.TimerThread.run(Timer.java:462)
> [2009-05-01 07:12:23,302967]ERROR[onOsgiApplicationEvent](DefaultOsgiBundleApplicationContextListener:50) - Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml))
> org.springframework.context.ApplicationContextException: Application context initialization for 'com.ihg.crm.service.client' has timed out
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:462)
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:51)
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$WatchDogTask.run(DependencyWaiterApplicationContextExecutor.java:108)
>        at java.util.TimerThread.mainLoop(Timer.java:512)
>        at java.util.TimerThread.run(Timer.java:462)
> [2009-05-01 07:17:39,619153]DEBUG[handleEvent](ContextLoaderListener$ContextBundleListener:237) - System bundle stopping
> [2009-05-01 07:17:39,619153] INFO[shutdown](ContextLoaderListener:449) - Stopping [org.springframework.osgi.extender] bundle v.[1.2.0]
> [2009-05-01 07:17:39,619153]DEBUG[stopTimer](ContextLoaderListener:581) - Canceling timer tasks
> [2009-05-01 07:17:39,619169]DEBUG[shutdown](ContextLoaderListener:500) - Shutdown order is: {
> Bundle [com.ihg.crm.service.client]
> Bundle [com.ihg.crm.service.interface.hello]
> Bundle [com.ihg.crm.service.interfaces.goodby]
> }
>
> I have created a couple of really simple service, HelloService and GoodByService.  There are a total of four bundles for the server, 1 for each of the interfaces and 1 for each of the services (HelloService, GoodByService, HelloServiceImpl, GoodByServiceImpl).
>
> I have also created two clients the first is called multi-service-test-client and is using the Activator much like the Greater demo. The other is called spring-multi-service-test-client and trys to us Spring-dm and DOSGi; this one fails.
>
> I have also included tow config.ini files for the client.  The one called spring-config.ini is for use with the bundles to start the spring-multi-service-test-client.  The other, standard-config.ini just load the appropriate bundle for the multi-service-test-client.
>
> I am very perplexed by the error as binding to one seems to be just fine.  I am in the middle of a POC and if I can not bind to more then one service it will be a problem.  If I have to go the activator route, is there a clean way to make the services available to Spring from the Activator.  I seemed to have some problems using a ServiceTracker.getService(), always was returning null yet within the addingService method all was good?
>
> TIA for any assistance.
>
> Regards,
> Todd
>
> -----Original Message-----
> From: David Bosschaert [mailto:david.bosschaert@gmail.com]
> Sent: Friday, May 01, 2009 4:09 AM
> To: users@cxf.apache.org
> Subject: Re: dosgi - Problems with Client binding to more then one remote service
>
> Hi Todd,
>
> To islote the problem I tried to reproduce it without spring, for this
> I modified the DOSGi Greeter demo. On the server side I simply
> register two the same object twice under two contexts:
>    public void start(BundleContext bc) throws Exception {
>        Dictionary<String, Object> props = new Hashtable<String, Object>();
>
>        props.put("osgi.remote.interfaces", "*");
>        props.put("osgi.remote.configuration.type", "pojo");
>        props.put("osgi.remote.configuration.pojo.address",
>                "http://localhost:9090/greeterA");
>
>        registration = bc.registerService(GreeterService.class.getName(),
>                                          new GreeterServiceImpl(), props);
>
>        Dictionary<String, Object> props2 = new Hashtable<String, Object>();
>
>        props2.put("osgi.remote.interfaces", "*");
>        props2.put("osgi.remote.configuration.type", "pojo");
>        props2.put("osgi.remote.configuration.pojo.address",
>                "http://localhost:9090/greeterB");
>
>        registration2 = bc.registerService(GreeterService.class.getName(),
>                                          new GreeterServiceImpl(), props2);
>
>
> While on the client side I register both in my remote-services.xml file:
> <service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0">
>  <service-description>
>    <provide interface="org.apache.cxf.dosgi.samples.greeter.GreeterService" />
>    <property name="osgi.remote.interfaces">*</property>
>    <property name="osgi.remote.configuration.type">pojo</property>
>    <property name="osgi.remote.configuration.pojo.address">http://localhost:9090/greeterB</property>
>  </service-description>
>  <service-description>
>    <provide interface="org.apache.cxf.dosgi.samples.greeter.GreeterService" />
>    <property name="osgi.remote.interfaces">*</property>
>    <property name="osgi.remote.configuration.type">pojo</property>
>    <property name="osgi.remote.configuration.pojo.address">http://localhost:9090/greeterA</property>
>  </service-description>
> </service-descriptions>
>
> This works well for me, the consumer gets a reference to both remote
> services and can invoke on them.
>
> See if it works for you if you go back to a more basic scenario. If it
> doesn't could you maybe provide a test case (with code)?
>
> Thanks,
>
> David
>
> 2009/4/30 Nist, Todd (IHG) <To...@ihg.com>:
>>
>> Hi,
>>
>> I am encountering the following problem with a client, written in spring osgi / dm
>> that is attempting to bind to 2 osgi services using distributed osgi provided by
>> CXF.  If I only define 1 <service-description> and reference one of the services
>> the client works fine.  If I define 2 <service-description> tags within
>> <service-descriptions> as below I get the error shown below.
>>
>> When the client is started I see the following errors:
>>
>> Apr 30, 2009 12:14:55 PM org.springframework.osgi.extender.support.DefaultOsgiAp
>> plicationContextCreator createApplicationContext
>> INFO: Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [C
>> ampaign Service Consumer Bundle (com.ihg.crm.service.client)]
>> -> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryS
>> ervice bundleChanged
>> INFO: bundle changed: com.ihg.crm.service.client
>> Apr 30, 2009 12:14:55 PM org.springframework.context.support.AbstractApplication
>> Context prepareRefresh
>> INFO: Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicati
>> onContext@1d32a62: display name [OsgiBundleXmlApplicationContext(bundle=com.ihg.
>> crm.service.client, config=osgibundle:/META-INF/spring/*.xml)]; startup date [Th
>> u Apr 30 12:14:55 EDT 2009]; root of context hierarchy
>> Apr 30, 2009 12:14:55 PM org.springframework.osgi.context.support.AbstractOsgiBu
>> ndleApplicationContext unpublishContextAsOsgiService
>> INFO: Unpublishing application context OSGi service for bundle Campaign Service
>> Consumer Bundle (com.ihg.crm.service.client)
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
>> om.ihg.crm.service.campaign.CampaignService]
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
>> om.ihg.crm.service.campaign.CampaignService]
>> Apr 30, 2009 12:14:55 PM org.springframework.beans.factory.xml.XmlBeanDefinition
>> Reader loadBeanDefinitions
>> INFO: Loading XML bean definitions from URL [bundle://37.0:0/META-INF/spring/bun
>> dle-context-osgi.xml]
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: (|(service.interface=com.ihg.crm.service.campaign.Campaig
>> nService)(service.interface=com.ihg.crm.service.campaign.OfferService)) matches
>> [com.ihg.crm.service.campaign.CampaignService]
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
>> om.ihg.crm.service.campaign.OfferService]
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Disco
>> veryCallback serviceChanged
>> INFO: Notified - AVAILABLE: [com.ihg.crm.service.campaign.OfferService] endpoint
>>  id: null
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook unkno
>> wnEndpointId
>> WARNING: registering proxy with unknown duplicate status as endpoint ID unset
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook cache
>> EndpointId
>> WARNING: cannot cache proxy registration as endpoint ID unset
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
>> om.ihg.crm.service.campaign.OfferService]
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Disco
>> veryCallback serviceChanged
>> INFO: Notified - AVAILABLE: [com.ihg.crm.service.campaign.OfferService] endpoint
>>  id: null
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook unkno
>> wnEndpointId
>> WARNING: registering proxy with unknown duplicate status as endpoint ID unset
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook cache
>> EndpointId
>> WARNING: cannot cache proxy registration as endpoint ID unset
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: (|(service.interface=com.ihg.crm.service.campaign.Campaig
>> nService)(service.interface=com.ihg.crm.service.campaign.OfferService)) matches
>> [com.ihg.crm.service.campaign.OfferService]
>> Apr 30, 2009 12:14:56 PM org.springframework.context.support.AbstractApplication
>> Context obtainFreshBeanFactory
>> INFO: Bean factory for application context [org.springframework.osgi.context.sup
>> port.OsgiBundleXmlApplicationContext@1d32a62]: org.springframework.beans.factory
>> .support.DefaultListableBeanFactory@eb6e29
>> Apr 30, 2009 12:14:56 PM org.springframework.osgi.extender.internal.dependencies
>> .startup.DependencyServiceManager doFindDependencies
>> INFO: Adding OSGi service dependency for importer [&campaignServiceRef] matching
>>  OSGi filter [(objectClass=com.ihg.crm.service.campaign.CampaignService)]
>> Apr 30, 2009 12:14:56 PM org.springframework.osgi.extender.internal.dependencies
>> .startup.DependencyServiceManager findServiceDependencies
>> INFO: OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=
>> osgibundle:/META-INF/spring/*.xml) is waiting for unsatisfied dependencies [[&ca
>> mpaignServiceRef]]
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook looku
>> pDiscoveryService
>> INFO: lookup discovery service: interface: com.ihg.crm.service.campaign.Campaign
>> Service filter: null
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice updateTracker
>> INFO: updating tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discov
>> eryCallback@3e926
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice addTracker
>> INFO: adding tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discover
>> yCallback@3e926 collection: [com.ihg.crm.service.campaign.OfferService, com.ihg.
>> crm.service.campaign.OfferService, com.ihg.crm.service.campaign.CampaignService]
>>  registered against prop: osgi.discovery.interest.interfaces
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice addTracker
>> INFO: adding tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discover
>> yCallback@3e926 collection: [(|(service.interface=com.ihg.crm.service.campaign.C
>> ampaignService)(service.interface=com.ihg.crm.service.campaign.OfferService))] r
>> egistered against prop: osgi.discovery.interest.filters
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: search for matches to trigger callbacks with delta: []
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: search for matches to trigger callbacks with delta: []
>>
>>
>> The 2 services and client code are written using spring osgi / dm and running
>> within equinox for the server and felix for the client.  The services
>> bundle-context-osgi.xml files look as follows:
>>
>>
>> CampaignService - bundle-context-osgi.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>>
>>    <osgi:reference id="dataSourceRef" interface="javax.sql.DataSource"/>
>>    <osgi:service interface="com.ihg.crm.service.campaign.CampaignService">
>>          <osgi:service-properties>
>>            <entry key="osgi.remote.interfaces" value="*" />
>>            <!-- entry key="osgi.remote.configuration.type" value="pojo" / -->
>>            <!-- entry key="osgi.remote.configuration.pojo.httpservice.context" value="/offer" / -->
>>          </osgi:service-properties>
>>          <bean class="com.ihg.crm.service.campaign.impl.CampaignServiceImpl"
>>              init-method="start">
>>              <property name="dataSource" ref="dataSourceRef" />
>>          </bean>
>>        </osgi:service>
>> </beans>
>>
>> OfferService - bundle-context-osgi.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>>
>>        <osgi:reference id="dataSourceRef" interface="javax.sql.DataSource"/>
>>        <osgi:service interface="com.ihg.crm.service.campaign.OfferService">
>>          <osgi:service-properties>
>>            <entry key="osgi.remote.interfaces" value="*" />
>>          </osgi:service-properties>
>>          <bean class="com.ihg.crm.service.offer.impl.OfferServiceImpl"
>>              init-method="start">
>>              <property name="dataSource" ref="dataSourceRef" />
>>          </bean>
>>        </osgi:service>
>> </beans>
>>
>> A ss on the equinox instance shows all bundles deployed and active:
>>
>> osgi> ss
>>
>> Framework is launched.
>>
>> id      State       Bundle
>> 0       ACTIVE      org.eclipse.osgi_3.5.0.v20090311-1300
>> 1       ACTIVE      org.eclipse.osgi.services_3.2.0.v20090306-1900
>> 2       ACTIVE      javax.servlet_2.5.0.v200806031605
>> 3       ACTIVE      com.springsource.org.apache.commons.pool_1.3.0
>> 4       ACTIVE      com.springsource.org.apache.commons.dbcp_1.2.2.osgi
>> 5       ACTIVE      com.springsource.javax.resource_1.5.0
>> 6       ACTIVE      com.springsource.oracle.jdbc_10.2.0.2
>> 7       ACTIVE      org.apache.geronimo.specs.geronimo-annotation_1.0_spec_1.1.1
>> 8       ACTIVE      org.apache.geronimo.specs.geronimo-activation_1.1_spec_1.0.2
>> 9       ACTIVE      org.apache.geronimo.specs.geronimo-javamail_1.4_spec_1.2.0
>> 10      ACTIVE      org.apache.geronimo.specs.geronimo-ws-metadata_2.0_spec_1.1.2
>> 11      ACTIVE      com.springsource.slf4j.org.apache.commons.logging_1.5.0
>> 12      ACTIVE      com.springsource.slf4j.api_1.5.0
>>                    Fragments=13
>> 13      RESOLVED    com.springsource.slf4j.log4j_1.5.0
>>                    Master=12
>> 14      ACTIVE      org.springframework.osgi.log4j.osgi_1.2.15.SNAPSHOT
>> 15      ACTIVE      com.springsource.org.jdom_1.0.0
>> 16      ACTIVE      org.springframework.core_2.5.6
>> 17      ACTIVE      org.springframework.beans_2.5.6
>> 18      ACTIVE      org.springframework.context_2.5.6
>> 19      ACTIVE      org.springframework.transaction_2.5.6
>> 20      ACTIVE      org.springframework.jdbc_2.5.6
>> 21      ACTIVE      com.springsource.org.aopalliance_1.0.0
>> 22      ACTIVE      org.springframework.aop_2.5.6
>> 23      ACTIVE      org.springframework.osgi.io_1.2.0
>> 24      ACTIVE      org.springframework.osgi.core_1.2.0
>> 25      ACTIVE      org.springframework.osgi.extender_1.2.0
>> 26      ACTIVE      org.ops4j.pax.web.service_0.5.1
>> 27      ACTIVE      org.apache.servicemix.bundles.jaxb-impl_2.1.6.1
>> 28      ACTIVE      org.apache.servicemix.bundles.wsdl4j_1.6.1.1
>> 29      ACTIVE      org.apache.servicemix.bundles.xmlsec_1.3.0.1
>> 30      ACTIVE      org.apache.servicemix.bundles.xmlschema_1.4.3.1
>> 31      ACTIVE      org.apache.servicemix.bundles.asm_2.2.3.1
>> 32      ACTIVE      org.apache.servicemix.bundles.xmlresolver_1.2.0.1
>> 33      ACTIVE      org.apache.servicemix.bundles.neethi_2.0.4.1
>> 34      ACTIVE      org.apache.servicemix.bundles.woodstox_3.2.7.1
>> 35      ACTIVE      org.apache.cxf.bundle-minimal_2.2.1.SNAPSHOT
>> 36      ACTIVE      org.apache.servicemix.specs.saaj-api-1.3_1.1.1
>> 37      ACTIVE      org.apache.servicemix.specs.stax-api-1.0_1.1.1
>> 38      ACTIVE      org.apache.servicemix.specs.jaxb-api-2.1_1.1.1
>> 39      ACTIVE      org.apache.servicemix.specs.jaxws-api-2.1_1.1.1
>> 40      ACTIVE      cxf-dosgi-ri-discovery-local_1.0.0.SNAPSHOT
>> 41      ACTIVE      cxf-dosgi-ri-dsw-cxf_1.0.0.SNAPSHOT
>> 42      ACTIVE      datasource_0.0.1
>> 43      ACTIVE      com.ihg.crm.model.campaign_0.0.1.SNAPSHOT
>> 44      ACTIVE      com.ihg.crm.service.campaign.interface_0.0.1.SNAPSHOT
>> 45      ACTIVE      com.ihg.crm.service.offer.impl_0.0.1.SNAPSHOT
>> 46      ACTIVE      CampaignServiceImpl_0.0.1
>> 47      ACTIVE      com.unicacorp.interact.api_0.0.0
>>
>>
>> I am able to access both services via the browser by pointing to the url which they are exposed on and receive the wsdl back (http://10.163.163.64:9000/com/ihg/crm/service/campaign/CampaignService?wsdl and
>> http://10.163.163.64:9000/com/ihg/crm/service/campaign/OfferService?wsdl) so I can see that both services are up and running.
>>
>>
>> The client bundle-osgi-context.xml looks like this:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>>
>>  <osgi:reference id="campaignServiceRef" interface="com.ihg.crm.service.campaign.CampaignService"/>
>>  <osgi:reference id="offerServiceRef" interface="com.ihg.crm.service.campaign.OfferService"/>
>>
>>  <bean class="com.ihg.crm.service.campaign.client.CampaignServiceConsumer"
>>        init-method="start">
>>    <property name="campaignService" ref="campaignServiceRef"/>
>>    <property name="offerService" ref = "offerServiceRef"/>
>>  </bean>
>>
>> </beans>
>>
>> My Client has the following definition for discovering the services within the remote-services.xml
>>
>> <service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0">
>>  <service-description>
>>    <provide interface="com.ihg.crm.service.campaign.CampaignService" />
>>    <property name="osgi.remote.interfaces">*</property>
>>    <property name="service.intents">SOAP HTTP</property>
>>    <property name="osgi.remote.configuration.type">pojo</property>
>>    <!-- property name="osgi.remote.configuration.pojo.address">http://localhost:8080/offer</property -->
>>    <property name="osgi.remote.configuration.pojo.address">
>>        http://10.163.163.64:9000/com/ihg/crm/service/campaign/CampaignService
>>    </property>
>>  </service-description>
>>  <service-description>
>>    <provide interface="com.ihg.crm.service.campaign.OfferService" />
>>    <property name="osgi.remote.interfaces">*</property>
>>    <property name="service.intents">SOAP HTTP</property>
>>    <property name="osgi.remote.configuration.type">pojo</property>
>>    <!-- property name="osgi.remote.configuration.pojo.address">http://localhost:8080/offer</property -->
>>    <property name="osgi.remote.configuration.pojo.address">
>>        http://10.163.163.64:9000/com/ihg/crm/service/campaign/OfferService
>>    </property>
>>  </service-description>
>> </service-descriptions>
>>
>>
>> Client Bundles (Campaign Service Consumer Bundle) - Felix:
>>
>> -> ps
>> START LEVEL 1
>>   ID   State         Level  Name
>> [   0] [Active     ] [    0] System Bundle (1.4.1)
>> [   1] [Active     ] [    1] Apache Felix Shell Service (1.0.2)
>> [   2] [Active     ] [    1] Apache Felix Shell TUI (1.0.2)
>> [   3] [Active     ] [    1] Apache Felix Bundle Repository (1.2.1)
>> [   4] [Active     ] [    1] OSGi R4 Compendium Bundle (4.1.0)
>> [   5] [Active     ] [    1] geronimo-annotation_1.0_spec (1.1.1)
>> [   6] [Active     ] [    1] geronimo-activation_1.1_spec (1.0.2)
>> [   7] [Active     ] [    1] geronimo-javamail_1.4_spec (1.2)
>> [   8] [Active     ] [    1] geronimo-ws-metadata_2.0_spec (1.1.2)
>> [   9] [Active     ] [    1] Apache Commons Logging (1.1.1)
>> [  10] [Active     ] [    1] JDOM DOM Processor (1.0.0)
>> [  11] [Active     ] [    1] Spring Core (2.5.6)
>> [  12] [Active     ] [    1] Spring Beans (2.5.6)
>> [  13] [Active     ] [    1] Spring Context (2.5.6)
>> [  14] [Active     ] [    1] AOP Alliance API (1.0.0)
>> [  15] [Active     ] [    1] Spring AOP (2.5.6)
>> [  16] [Active     ] [    1] spring-osgi-io (1.2.0)
>> [  17] [Active     ] [    1] spring-osgi-core (1.2.0)
>> [  18] [Active     ] [    1] spring-osgi-extender (1.2.0)
>> [  19] [Active     ] [    1] OPS4J Pax Web - Service (0.5.1)
>> [  20] [Active     ] [    1] Apache ServiceMix Bundles: jaxb-impl-2.1.6 (2.1.6.1)
>> [  21] [Active     ] [    1] Apache ServiceMix Bundles: wsdl4j-1.6.1 (1.6.1.1)
>> [  22] [Active     ] [    1] Apache ServiceMix Bundles: xmlsec-1.3.0 (1.3.0.1)
>> [  23] [Active     ] [    1] Apache ServiceMix Bundles: xmlschema-1.4.3 (1.4.3.1)
>> [  24] [Active     ] [    1] Apache ServiceMix Bundles: asm-2.2.3 (2.2.3.1)
>> [  25] [Active     ] [    1] Apache ServiceMix Bundles: xmlresolver-1.2 (1.2.0.1)
>> [  26] [Active     ] [    1] Apache ServiceMix Bundles: neethi-2.0.4 (2.0.4.1)
>> [  27] [Active     ] [    1] Apache ServiceMix Bundles: woodstox-3.2.7 (3.2.7.1)
>> [  28] [Active     ] [    1] Apache CXF Minimal Bundle Jar (2.2.1.SNAPSHOT)
>> [  29] [Active     ] [    1] Apache ServiceMix Specs :: SAAJ API 1.3 (1.1.1)
>> [  30] [Active     ] [    1] Apache ServiceMix Specs :: STAX API 1.0 (1.1.1)
>> [  31] [Active     ] [    1] Apache ServiceMix Specs :: JAXB API 2.1 (1.1.1)
>> [  32] [Active     ] [    1] Apache ServiceMix Specs :: JAXWS API 2.1 (1.1.1)
>> [  33] [Active     ] [    1] CXF Local Discovery Service Bundle (1.0.0.SNAPSHOT)
>> [  34] [Active     ] [    1] CXF Distributed Software Bundle (1.0.0.SNAPSHOT)
>> [  35] [Active     ] [    1] Campaign Model Bundle (0.0.1.SNAPSHOT)
>> [  36] [Active     ] [    1] Campaign Service Interfaces (0.0.1.SNAPSHOT)
>> [  37] [Active     ] [    1] Campaign Service Consumer Bundle (0.0.1.SNAPSHOT)
>>
>>
>> I am not sure what I am missing but feel sure it is something within the configuration of
>> the bundle-context-osgi.xml of the server or client or the remote-services.xml entries, but
>> am at a loss as to what it is.  Any guidance in this would be much appreciated.
>>
>> Thanks in advance for the assistance.
>>
>> Regards,
>> Todd
>>
>


Re: dosgi - Problems with Client binding to more then one remote service

Posted by David Bosschaert <da...@gmail.com>.
Hi Todd,

I think I've been able to reproduce your problem. It has something to
do with how Spring interacts with the service registry, I've added
https://issues.apache.org/jira/browse/CXF-2200 for this, as this
should obviously work.

I managed to get a workaround that would hopefully keep you going for
the moment. I used the spring-dm demo that's part of the CXF-DOSGi
codebase as a basis for this (it's here in SVN
http://svn.apache.org/repos/asf/cxf/dosgi/trunk/samples/spring_dm).
Instead of using Spring-DM for depending on OSGi services (with
<osgi:reference /> tags), I'm using an ordinary OSGi Service Tracker
instead. I can still do this from a consuming Spring-DM Bean, which I
made to implement the BundleContextAware interface, which means it
gets hold of the BundleContext. It also implements the
InitializingBean interface, which means that after Spring has called
all the setters, I can start my OSGi ServiceTracker and start looking
for the service. When it finds one, you're getting the addingService()
callback.

I've attached the source code for my Spring consumer bean that
consumes two different services using this technique. It's obvious not
as elegant as it should be and is really meant as a temporary
workaround, hopefully it will be enough to keep you going. I'll make
sure to see if I can fix CXF-2200 as soon as I can.

Hope this helps,

David

2009/5/2 Nist, Todd (IHG) <To...@ihg.com>:
> Hi David,
>
> I have followed your advice, and can expose the services using spring-dm I just can to seem to be able to consume more then one service at a time.  When I attempt too I see the following which will eventually timeout:
>
> [2009-05-01 07:07:23,  2938]DEBUG[startWatchDog](DependencyWaiterApplicationContextExecutor:485) - Asynch wait-for-dependencies started...
> [2009-05-01 07:12:23,302951]DEBUG[deregister](DependencyServiceManager:339) - Deregistering service dependency dependencyDetector for OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
> [2009-05-01 07:12:23,302951] WARN[timeout](DependencyWaiterApplicationContextExecutor:453) - Timeout occurred before finding service dependencies for [OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)]
> [2009-05-01 07:12:23,302951]DEBUG[close](DependencyWaiterApplicationContextExecutor:331) - Closing appCtx for OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
> [2009-05-01 07:12:23,302967]DEBUG[close](DependencyWaiterApplicationContextExecutor:343) - Cleaning up appCtx OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
> [2009-05-01 07:12:23,302967] INFO[destroySingletons](DefaultSingletonBeanRegistry:421) - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12dd76: defining beans [helloServiceRef,goodByServiceRef,com.ihg.crm.service.client.MultiServiceTestClient#0]; root of factory hierarchy
> [2009-05-01 07:12:23,302967]DEBUG[destroy](DisposableBeanAdapter:148) - Invoking destroy() on bean with name 'goodByServiceRef'
> [2009-05-01 07:12:23,302967]DEBUG[destroy](DisposableBeanAdapter:148) - Invoking destroy() on bean with name 'helloServiceRef'
> [2009-05-01 07:12:23,302967]DEBUG[deregister](DependencyServiceManager:339) - Deregistering service dependency dependencyDetector for OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
> [2009-05-01 07:12:23,302967]ERROR[fail](DependencyWaiterApplicationContextExecutor:432) - Unable to create application context for [com.ihg.crm.service.client], unsatisfied dependencies: Dependency on [(objectClass=com.ihg.crm.service.campaign.hello.HelloService)] (from bean [&helloServiceRef]), Dependency on [(objectClass=com.ihg.crm.service.campaign.goodby.GoodByService)] (from bean [&goodByServiceRef])
> org.springframework.context.ApplicationContextException: Application context initialization for 'com.ihg.crm.service.client' has timed out
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:462)
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:51)
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$WatchDogTask.run(DependencyWaiterApplicationContextExecutor.java:108)
>        at java.util.TimerThread.mainLoop(Timer.java:512)
>        at java.util.TimerThread.run(Timer.java:462)
> [2009-05-01 07:12:23,302967]ERROR[onOsgiApplicationEvent](DefaultOsgiBundleApplicationContextListener:50) - Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml))
> org.springframework.context.ApplicationContextException: Application context initialization for 'com.ihg.crm.service.client' has timed out
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:462)
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:51)
>        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$WatchDogTask.run(DependencyWaiterApplicationContextExecutor.java:108)
>        at java.util.TimerThread.mainLoop(Timer.java:512)
>        at java.util.TimerThread.run(Timer.java:462)
> [2009-05-01 07:17:39,619153]DEBUG[handleEvent](ContextLoaderListener$ContextBundleListener:237) - System bundle stopping
> [2009-05-01 07:17:39,619153] INFO[shutdown](ContextLoaderListener:449) - Stopping [org.springframework.osgi.extender] bundle v.[1.2.0]
> [2009-05-01 07:17:39,619153]DEBUG[stopTimer](ContextLoaderListener:581) - Canceling timer tasks
> [2009-05-01 07:17:39,619169]DEBUG[shutdown](ContextLoaderListener:500) - Shutdown order is: {
> Bundle [com.ihg.crm.service.client]
> Bundle [com.ihg.crm.service.interface.hello]
> Bundle [com.ihg.crm.service.interfaces.goodby]
> }
>
> I have created a couple of really simple service, HelloService and GoodByService.  There are a total of four bundles for the server, 1 for each of the interfaces and 1 for each of the services (HelloService, GoodByService, HelloServiceImpl, GoodByServiceImpl).
>
> I have also created two clients the first is called multi-service-test-client and is using the Activator much like the Greater demo. The other is called spring-multi-service-test-client and trys to us Spring-dm and DOSGi; this one fails.
>
> I have also included tow config.ini files for the client.  The one called spring-config.ini is for use with the bundles to start the spring-multi-service-test-client.  The other, standard-config.ini just load the appropriate bundle for the multi-service-test-client.
>
> I am very perplexed by the error as binding to one seems to be just fine.  I am in the middle of a POC and if I can not bind to more then one service it will be a problem.  If I have to go the activator route, is there a clean way to make the services available to Spring from the Activator.  I seemed to have some problems using a ServiceTracker.getService(), always was returning null yet within the addingService method all was good?
>
> TIA for any assistance.
>
> Regards,
> Todd
>
> -----Original Message-----
> From: David Bosschaert [mailto:david.bosschaert@gmail.com]
> Sent: Friday, May 01, 2009 4:09 AM
> To: users@cxf.apache.org
> Subject: Re: dosgi - Problems with Client binding to more then one remote service
>
> Hi Todd,
>
> To islote the problem I tried to reproduce it without spring, for this
> I modified the DOSGi Greeter demo. On the server side I simply
> register two the same object twice under two contexts:
>    public void start(BundleContext bc) throws Exception {
>        Dictionary<String, Object> props = new Hashtable<String, Object>();
>
>        props.put("osgi.remote.interfaces", "*");
>        props.put("osgi.remote.configuration.type", "pojo");
>        props.put("osgi.remote.configuration.pojo.address",
>                "http://localhost:9090/greeterA");
>
>        registration = bc.registerService(GreeterService.class.getName(),
>                                          new GreeterServiceImpl(), props);
>
>        Dictionary<String, Object> props2 = new Hashtable<String, Object>();
>
>        props2.put("osgi.remote.interfaces", "*");
>        props2.put("osgi.remote.configuration.type", "pojo");
>        props2.put("osgi.remote.configuration.pojo.address",
>                "http://localhost:9090/greeterB");
>
>        registration2 = bc.registerService(GreeterService.class.getName(),
>                                          new GreeterServiceImpl(), props2);
>
>
> While on the client side I register both in my remote-services.xml file:
> <service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0">
>  <service-description>
>    <provide interface="org.apache.cxf.dosgi.samples.greeter.GreeterService" />
>    <property name="osgi.remote.interfaces">*</property>
>    <property name="osgi.remote.configuration.type">pojo</property>
>    <property name="osgi.remote.configuration.pojo.address">http://localhost:9090/greeterB</property>
>  </service-description>
>  <service-description>
>    <provide interface="org.apache.cxf.dosgi.samples.greeter.GreeterService" />
>    <property name="osgi.remote.interfaces">*</property>
>    <property name="osgi.remote.configuration.type">pojo</property>
>    <property name="osgi.remote.configuration.pojo.address">http://localhost:9090/greeterA</property>
>  </service-description>
> </service-descriptions>
>
> This works well for me, the consumer gets a reference to both remote
> services and can invoke on them.
>
> See if it works for you if you go back to a more basic scenario. If it
> doesn't could you maybe provide a test case (with code)?
>
> Thanks,
>
> David
>
> 2009/4/30 Nist, Todd (IHG) <To...@ihg.com>:
>>
>> Hi,
>>
>> I am encountering the following problem with a client, written in spring osgi / dm
>> that is attempting to bind to 2 osgi services using distributed osgi provided by
>> CXF.  If I only define 1 <service-description> and reference one of the services
>> the client works fine.  If I define 2 <service-description> tags within
>> <service-descriptions> as below I get the error shown below.
>>
>> When the client is started I see the following errors:
>>
>> Apr 30, 2009 12:14:55 PM org.springframework.osgi.extender.support.DefaultOsgiAp
>> plicationContextCreator createApplicationContext
>> INFO: Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [C
>> ampaign Service Consumer Bundle (com.ihg.crm.service.client)]
>> -> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryS
>> ervice bundleChanged
>> INFO: bundle changed: com.ihg.crm.service.client
>> Apr 30, 2009 12:14:55 PM org.springframework.context.support.AbstractApplication
>> Context prepareRefresh
>> INFO: Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicati
>> onContext@1d32a62: display name [OsgiBundleXmlApplicationContext(bundle=com.ihg.
>> crm.service.client, config=osgibundle:/META-INF/spring/*.xml)]; startup date [Th
>> u Apr 30 12:14:55 EDT 2009]; root of context hierarchy
>> Apr 30, 2009 12:14:55 PM org.springframework.osgi.context.support.AbstractOsgiBu
>> ndleApplicationContext unpublishContextAsOsgiService
>> INFO: Unpublishing application context OSGi service for bundle Campaign Service
>> Consumer Bundle (com.ihg.crm.service.client)
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
>> om.ihg.crm.service.campaign.CampaignService]
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
>> om.ihg.crm.service.campaign.CampaignService]
>> Apr 30, 2009 12:14:55 PM org.springframework.beans.factory.xml.XmlBeanDefinition
>> Reader loadBeanDefinitions
>> INFO: Loading XML bean definitions from URL [bundle://37.0:0/META-INF/spring/bun
>> dle-context-osgi.xml]
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: (|(service.interface=com.ihg.crm.service.campaign.Campaig
>> nService)(service.interface=com.ihg.crm.service.campaign.OfferService)) matches
>> [com.ihg.crm.service.campaign.CampaignService]
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
>> om.ihg.crm.service.campaign.OfferService]
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Disco
>> veryCallback serviceChanged
>> INFO: Notified - AVAILABLE: [com.ihg.crm.service.campaign.OfferService] endpoint
>>  id: null
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook unkno
>> wnEndpointId
>> WARNING: registering proxy with unknown duplicate status as endpoint ID unset
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook cache
>> EndpointId
>> WARNING: cannot cache proxy registration as endpoint ID unset
>> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
>> om.ihg.crm.service.campaign.OfferService]
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Disco
>> veryCallback serviceChanged
>> INFO: Notified - AVAILABLE: [com.ihg.crm.service.campaign.OfferService] endpoint
>>  id: null
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook unkno
>> wnEndpointId
>> WARNING: registering proxy with unknown duplicate status as endpoint ID unset
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook cache
>> EndpointId
>> WARNING: cannot cache proxy registration as endpoint ID unset
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: check if string: (|(service.interface=com.ihg.crm.service.campaign.Campaig
>> nService)(service.interface=com.ihg.crm.service.campaign.OfferService)) matches
>> [com.ihg.crm.service.campaign.OfferService]
>> Apr 30, 2009 12:14:56 PM org.springframework.context.support.AbstractApplication
>> Context obtainFreshBeanFactory
>> INFO: Bean factory for application context [org.springframework.osgi.context.sup
>> port.OsgiBundleXmlApplicationContext@1d32a62]: org.springframework.beans.factory
>> .support.DefaultListableBeanFactory@eb6e29
>> Apr 30, 2009 12:14:56 PM org.springframework.osgi.extender.internal.dependencies
>> .startup.DependencyServiceManager doFindDependencies
>> INFO: Adding OSGi service dependency for importer [&campaignServiceRef] matching
>>  OSGi filter [(objectClass=com.ihg.crm.service.campaign.CampaignService)]
>> Apr 30, 2009 12:14:56 PM org.springframework.osgi.extender.internal.dependencies
>> .startup.DependencyServiceManager findServiceDependencies
>> INFO: OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=
>> osgibundle:/META-INF/spring/*.xml) is waiting for unsatisfied dependencies [[&ca
>> mpaignServiceRef]]
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook looku
>> pDiscoveryService
>> INFO: lookup discovery service: interface: com.ihg.crm.service.campaign.Campaign
>> Service filter: null
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice updateTracker
>> INFO: updating tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discov
>> eryCallback@3e926
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice addTracker
>> INFO: adding tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discover
>> yCallback@3e926 collection: [com.ihg.crm.service.campaign.OfferService, com.ihg.
>> crm.service.campaign.OfferService, com.ihg.crm.service.campaign.CampaignService]
>>  registered against prop: osgi.discovery.interest.interfaces
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice addTracker
>> INFO: adding tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discover
>> yCallback@3e926 collection: [(|(service.interface=com.ihg.crm.service.campaign.C
>> ampaignService)(service.interface=com.ihg.crm.service.campaign.OfferService))] r
>> egistered against prop: osgi.discovery.interest.filters
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: search for matches to trigger callbacks with delta: []
>> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
>> ice triggerCallbacks
>> INFO: search for matches to trigger callbacks with delta: []
>>
>>
>> The 2 services and client code are written using spring osgi / dm and running
>> within equinox for the server and felix for the client.  The services
>> bundle-context-osgi.xml files look as follows:
>>
>>
>> CampaignService - bundle-context-osgi.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>>
>>    <osgi:reference id="dataSourceRef" interface="javax.sql.DataSource"/>
>>    <osgi:service interface="com.ihg.crm.service.campaign.CampaignService">
>>          <osgi:service-properties>
>>            <entry key="osgi.remote.interfaces" value="*" />
>>            <!-- entry key="osgi.remote.configuration.type" value="pojo" / -->
>>            <!-- entry key="osgi.remote.configuration.pojo.httpservice.context" value="/offer" / -->
>>          </osgi:service-properties>
>>          <bean class="com.ihg.crm.service.campaign.impl.CampaignServiceImpl"
>>              init-method="start">
>>              <property name="dataSource" ref="dataSourceRef" />
>>          </bean>
>>        </osgi:service>
>> </beans>
>>
>> OfferService - bundle-context-osgi.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>>
>>        <osgi:reference id="dataSourceRef" interface="javax.sql.DataSource"/>
>>        <osgi:service interface="com.ihg.crm.service.campaign.OfferService">
>>          <osgi:service-properties>
>>            <entry key="osgi.remote.interfaces" value="*" />
>>          </osgi:service-properties>
>>          <bean class="com.ihg.crm.service.offer.impl.OfferServiceImpl"
>>              init-method="start">
>>              <property name="dataSource" ref="dataSourceRef" />
>>          </bean>
>>        </osgi:service>
>> </beans>
>>
>> A ss on the equinox instance shows all bundles deployed and active:
>>
>> osgi> ss
>>
>> Framework is launched.
>>
>> id      State       Bundle
>> 0       ACTIVE      org.eclipse.osgi_3.5.0.v20090311-1300
>> 1       ACTIVE      org.eclipse.osgi.services_3.2.0.v20090306-1900
>> 2       ACTIVE      javax.servlet_2.5.0.v200806031605
>> 3       ACTIVE      com.springsource.org.apache.commons.pool_1.3.0
>> 4       ACTIVE      com.springsource.org.apache.commons.dbcp_1.2.2.osgi
>> 5       ACTIVE      com.springsource.javax.resource_1.5.0
>> 6       ACTIVE      com.springsource.oracle.jdbc_10.2.0.2
>> 7       ACTIVE      org.apache.geronimo.specs.geronimo-annotation_1.0_spec_1.1.1
>> 8       ACTIVE      org.apache.geronimo.specs.geronimo-activation_1.1_spec_1.0.2
>> 9       ACTIVE      org.apache.geronimo.specs.geronimo-javamail_1.4_spec_1.2.0
>> 10      ACTIVE      org.apache.geronimo.specs.geronimo-ws-metadata_2.0_spec_1.1.2
>> 11      ACTIVE      com.springsource.slf4j.org.apache.commons.logging_1.5.0
>> 12      ACTIVE      com.springsource.slf4j.api_1.5.0
>>                    Fragments=13
>> 13      RESOLVED    com.springsource.slf4j.log4j_1.5.0
>>                    Master=12
>> 14      ACTIVE      org.springframework.osgi.log4j.osgi_1.2.15.SNAPSHOT
>> 15      ACTIVE      com.springsource.org.jdom_1.0.0
>> 16      ACTIVE      org.springframework.core_2.5.6
>> 17      ACTIVE      org.springframework.beans_2.5.6
>> 18      ACTIVE      org.springframework.context_2.5.6
>> 19      ACTIVE      org.springframework.transaction_2.5.6
>> 20      ACTIVE      org.springframework.jdbc_2.5.6
>> 21      ACTIVE      com.springsource.org.aopalliance_1.0.0
>> 22      ACTIVE      org.springframework.aop_2.5.6
>> 23      ACTIVE      org.springframework.osgi.io_1.2.0
>> 24      ACTIVE      org.springframework.osgi.core_1.2.0
>> 25      ACTIVE      org.springframework.osgi.extender_1.2.0
>> 26      ACTIVE      org.ops4j.pax.web.service_0.5.1
>> 27      ACTIVE      org.apache.servicemix.bundles.jaxb-impl_2.1.6.1
>> 28      ACTIVE      org.apache.servicemix.bundles.wsdl4j_1.6.1.1
>> 29      ACTIVE      org.apache.servicemix.bundles.xmlsec_1.3.0.1
>> 30      ACTIVE      org.apache.servicemix.bundles.xmlschema_1.4.3.1
>> 31      ACTIVE      org.apache.servicemix.bundles.asm_2.2.3.1
>> 32      ACTIVE      org.apache.servicemix.bundles.xmlresolver_1.2.0.1
>> 33      ACTIVE      org.apache.servicemix.bundles.neethi_2.0.4.1
>> 34      ACTIVE      org.apache.servicemix.bundles.woodstox_3.2.7.1
>> 35      ACTIVE      org.apache.cxf.bundle-minimal_2.2.1.SNAPSHOT
>> 36      ACTIVE      org.apache.servicemix.specs.saaj-api-1.3_1.1.1
>> 37      ACTIVE      org.apache.servicemix.specs.stax-api-1.0_1.1.1
>> 38      ACTIVE      org.apache.servicemix.specs.jaxb-api-2.1_1.1.1
>> 39      ACTIVE      org.apache.servicemix.specs.jaxws-api-2.1_1.1.1
>> 40      ACTIVE      cxf-dosgi-ri-discovery-local_1.0.0.SNAPSHOT
>> 41      ACTIVE      cxf-dosgi-ri-dsw-cxf_1.0.0.SNAPSHOT
>> 42      ACTIVE      datasource_0.0.1
>> 43      ACTIVE      com.ihg.crm.model.campaign_0.0.1.SNAPSHOT
>> 44      ACTIVE      com.ihg.crm.service.campaign.interface_0.0.1.SNAPSHOT
>> 45      ACTIVE      com.ihg.crm.service.offer.impl_0.0.1.SNAPSHOT
>> 46      ACTIVE      CampaignServiceImpl_0.0.1
>> 47      ACTIVE      com.unicacorp.interact.api_0.0.0
>>
>>
>> I am able to access both services via the browser by pointing to the url which they are exposed on and receive the wsdl back (http://10.163.163.64:9000/com/ihg/crm/service/campaign/CampaignService?wsdl and
>> http://10.163.163.64:9000/com/ihg/crm/service/campaign/OfferService?wsdl) so I can see that both services are up and running.
>>
>>
>> The client bundle-osgi-context.xml looks like this:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>>
>>  <osgi:reference id="campaignServiceRef" interface="com.ihg.crm.service.campaign.CampaignService"/>
>>  <osgi:reference id="offerServiceRef" interface="com.ihg.crm.service.campaign.OfferService"/>
>>
>>  <bean class="com.ihg.crm.service.campaign.client.CampaignServiceConsumer"
>>        init-method="start">
>>    <property name="campaignService" ref="campaignServiceRef"/>
>>    <property name="offerService" ref = "offerServiceRef"/>
>>  </bean>
>>
>> </beans>
>>
>> My Client has the following definition for discovering the services within the remote-services.xml
>>
>> <service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0">
>>  <service-description>
>>    <provide interface="com.ihg.crm.service.campaign.CampaignService" />
>>    <property name="osgi.remote.interfaces">*</property>
>>    <property name="service.intents">SOAP HTTP</property>
>>    <property name="osgi.remote.configuration.type">pojo</property>
>>    <!-- property name="osgi.remote.configuration.pojo.address">http://localhost:8080/offer</property -->
>>    <property name="osgi.remote.configuration.pojo.address">
>>        http://10.163.163.64:9000/com/ihg/crm/service/campaign/CampaignService
>>    </property>
>>  </service-description>
>>  <service-description>
>>    <provide interface="com.ihg.crm.service.campaign.OfferService" />
>>    <property name="osgi.remote.interfaces">*</property>
>>    <property name="service.intents">SOAP HTTP</property>
>>    <property name="osgi.remote.configuration.type">pojo</property>
>>    <!-- property name="osgi.remote.configuration.pojo.address">http://localhost:8080/offer</property -->
>>    <property name="osgi.remote.configuration.pojo.address">
>>        http://10.163.163.64:9000/com/ihg/crm/service/campaign/OfferService
>>    </property>
>>  </service-description>
>> </service-descriptions>
>>
>>
>> Client Bundles (Campaign Service Consumer Bundle) - Felix:
>>
>> -> ps
>> START LEVEL 1
>>   ID   State         Level  Name
>> [   0] [Active     ] [    0] System Bundle (1.4.1)
>> [   1] [Active     ] [    1] Apache Felix Shell Service (1.0.2)
>> [   2] [Active     ] [    1] Apache Felix Shell TUI (1.0.2)
>> [   3] [Active     ] [    1] Apache Felix Bundle Repository (1.2.1)
>> [   4] [Active     ] [    1] OSGi R4 Compendium Bundle (4.1.0)
>> [   5] [Active     ] [    1] geronimo-annotation_1.0_spec (1.1.1)
>> [   6] [Active     ] [    1] geronimo-activation_1.1_spec (1.0.2)
>> [   7] [Active     ] [    1] geronimo-javamail_1.4_spec (1.2)
>> [   8] [Active     ] [    1] geronimo-ws-metadata_2.0_spec (1.1.2)
>> [   9] [Active     ] [    1] Apache Commons Logging (1.1.1)
>> [  10] [Active     ] [    1] JDOM DOM Processor (1.0.0)
>> [  11] [Active     ] [    1] Spring Core (2.5.6)
>> [  12] [Active     ] [    1] Spring Beans (2.5.6)
>> [  13] [Active     ] [    1] Spring Context (2.5.6)
>> [  14] [Active     ] [    1] AOP Alliance API (1.0.0)
>> [  15] [Active     ] [    1] Spring AOP (2.5.6)
>> [  16] [Active     ] [    1] spring-osgi-io (1.2.0)
>> [  17] [Active     ] [    1] spring-osgi-core (1.2.0)
>> [  18] [Active     ] [    1] spring-osgi-extender (1.2.0)
>> [  19] [Active     ] [    1] OPS4J Pax Web - Service (0.5.1)
>> [  20] [Active     ] [    1] Apache ServiceMix Bundles: jaxb-impl-2.1.6 (2.1.6.1)
>> [  21] [Active     ] [    1] Apache ServiceMix Bundles: wsdl4j-1.6.1 (1.6.1.1)
>> [  22] [Active     ] [    1] Apache ServiceMix Bundles: xmlsec-1.3.0 (1.3.0.1)
>> [  23] [Active     ] [    1] Apache ServiceMix Bundles: xmlschema-1.4.3 (1.4.3.1)
>> [  24] [Active     ] [    1] Apache ServiceMix Bundles: asm-2.2.3 (2.2.3.1)
>> [  25] [Active     ] [    1] Apache ServiceMix Bundles: xmlresolver-1.2 (1.2.0.1)
>> [  26] [Active     ] [    1] Apache ServiceMix Bundles: neethi-2.0.4 (2.0.4.1)
>> [  27] [Active     ] [    1] Apache ServiceMix Bundles: woodstox-3.2.7 (3.2.7.1)
>> [  28] [Active     ] [    1] Apache CXF Minimal Bundle Jar (2.2.1.SNAPSHOT)
>> [  29] [Active     ] [    1] Apache ServiceMix Specs :: SAAJ API 1.3 (1.1.1)
>> [  30] [Active     ] [    1] Apache ServiceMix Specs :: STAX API 1.0 (1.1.1)
>> [  31] [Active     ] [    1] Apache ServiceMix Specs :: JAXB API 2.1 (1.1.1)
>> [  32] [Active     ] [    1] Apache ServiceMix Specs :: JAXWS API 2.1 (1.1.1)
>> [  33] [Active     ] [    1] CXF Local Discovery Service Bundle (1.0.0.SNAPSHOT)
>> [  34] [Active     ] [    1] CXF Distributed Software Bundle (1.0.0.SNAPSHOT)
>> [  35] [Active     ] [    1] Campaign Model Bundle (0.0.1.SNAPSHOT)
>> [  36] [Active     ] [    1] Campaign Service Interfaces (0.0.1.SNAPSHOT)
>> [  37] [Active     ] [    1] Campaign Service Consumer Bundle (0.0.1.SNAPSHOT)
>>
>>
>> I am not sure what I am missing but feel sure it is something within the configuration of
>> the bundle-context-osgi.xml of the server or client or the remote-services.xml entries, but
>> am at a loss as to what it is.  Any guidance in this would be much appreciated.
>>
>> Thanks in advance for the assistance.
>>
>> Regards,
>> Todd
>>
>

RE: dosgi - Problems with Client binding to more then one remote service

Posted by "Nist, Todd (IHG)" <To...@ihg.com>.
Hi David,

I have followed your advice, and can expose the services using spring-dm I just can to seem to be able to consume more then one service at a time.  When I attempt too I see the following which will eventually timeout:

[2009-05-01 07:07:23,  2938]DEBUG[startWatchDog](DependencyWaiterApplicationContextExecutor:485) - Asynch wait-for-dependencies started...
[2009-05-01 07:12:23,302951]DEBUG[deregister](DependencyServiceManager:339) - Deregistering service dependency dependencyDetector for OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
[2009-05-01 07:12:23,302951] WARN[timeout](DependencyWaiterApplicationContextExecutor:453) - Timeout occurred before finding service dependencies for [OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)]
[2009-05-01 07:12:23,302951]DEBUG[close](DependencyWaiterApplicationContextExecutor:331) - Closing appCtx for OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
[2009-05-01 07:12:23,302967]DEBUG[close](DependencyWaiterApplicationContextExecutor:343) - Cleaning up appCtx OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
[2009-05-01 07:12:23,302967] INFO[destroySingletons](DefaultSingletonBeanRegistry:421) - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@12dd76: defining beans [helloServiceRef,goodByServiceRef,com.ihg.crm.service.client.MultiServiceTestClient#0]; root of factory hierarchy
[2009-05-01 07:12:23,302967]DEBUG[destroy](DisposableBeanAdapter:148) - Invoking destroy() on bean with name 'goodByServiceRef'
[2009-05-01 07:12:23,302967]DEBUG[destroy](DisposableBeanAdapter:148) - Invoking destroy() on bean with name 'helloServiceRef'
[2009-05-01 07:12:23,302967]DEBUG[deregister](DependencyServiceManager:339) - Deregistering service dependency dependencyDetector for OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml)
[2009-05-01 07:12:23,302967]ERROR[fail](DependencyWaiterApplicationContextExecutor:432) - Unable to create application context for [com.ihg.crm.service.client], unsatisfied dependencies: Dependency on [(objectClass=com.ihg.crm.service.campaign.hello.HelloService)] (from bean [&helloServiceRef]), Dependency on [(objectClass=com.ihg.crm.service.campaign.goodby.GoodByService)] (from bean [&goodByServiceRef])
org.springframework.context.ApplicationContextException: Application context initialization for 'com.ihg.crm.service.client' has timed out
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:462)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:51)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$WatchDogTask.run(DependencyWaiterApplicationContextExecutor.java:108)
	at java.util.TimerThread.mainLoop(Timer.java:512)
	at java.util.TimerThread.run(Timer.java:462)
[2009-05-01 07:12:23,302967]ERROR[onOsgiApplicationEvent](DefaultOsgiBundleApplicationContextListener:50) - Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.context.ApplicationContextException: Application context initialization for 'com.ihg.crm.service.client' has timed out
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:462)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:51)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$WatchDogTask.run(DependencyWaiterApplicationContextExecutor.java:108)
	at java.util.TimerThread.mainLoop(Timer.java:512)
	at java.util.TimerThread.run(Timer.java:462)
[2009-05-01 07:17:39,619153]DEBUG[handleEvent](ContextLoaderListener$ContextBundleListener:237) - System bundle stopping
[2009-05-01 07:17:39,619153] INFO[shutdown](ContextLoaderListener:449) - Stopping [org.springframework.osgi.extender] bundle v.[1.2.0]
[2009-05-01 07:17:39,619153]DEBUG[stopTimer](ContextLoaderListener:581) - Canceling timer tasks
[2009-05-01 07:17:39,619169]DEBUG[shutdown](ContextLoaderListener:500) - Shutdown order is: {
Bundle [com.ihg.crm.service.client]
Bundle [com.ihg.crm.service.interface.hello]
Bundle [com.ihg.crm.service.interfaces.goodby]
}

I have created a couple of really simple service, HelloService and GoodByService.  There are a total of four bundles for the server, 1 for each of the interfaces and 1 for each of the services (HelloService, GoodByService, HelloServiceImpl, GoodByServiceImpl).

I have also created two clients the first is called multi-service-test-client and is using the Activator much like the Greater demo. The other is called spring-multi-service-test-client and trys to us Spring-dm and DOSGi; this one fails.

I have also included tow config.ini files for the client.  The one called spring-config.ini is for use with the bundles to start the spring-multi-service-test-client.  The other, standard-config.ini just load the appropriate bundle for the multi-service-test-client.

I am very perplexed by the error as binding to one seems to be just fine.  I am in the middle of a POC and if I can not bind to more then one service it will be a problem.  If I have to go the activator route, is there a clean way to make the services available to Spring from the Activator.  I seemed to have some problems using a ServiceTracker.getService(), always was returning null yet within the addingService method all was good?

TIA for any assistance.

Regards,
Todd

-----Original Message-----
From: David Bosschaert [mailto:david.bosschaert@gmail.com] 
Sent: Friday, May 01, 2009 4:09 AM
To: users@cxf.apache.org
Subject: Re: dosgi - Problems with Client binding to more then one remote service

Hi Todd,

To islote the problem I tried to reproduce it without spring, for this
I modified the DOSGi Greeter demo. On the server side I simply
register two the same object twice under two contexts:
    public void start(BundleContext bc) throws Exception {
        Dictionary<String, Object> props = new Hashtable<String, Object>();

        props.put("osgi.remote.interfaces", "*");
        props.put("osgi.remote.configuration.type", "pojo");
        props.put("osgi.remote.configuration.pojo.address",
                "http://localhost:9090/greeterA");

        registration = bc.registerService(GreeterService.class.getName(),
                                          new GreeterServiceImpl(), props);

        Dictionary<String, Object> props2 = new Hashtable<String, Object>();

        props2.put("osgi.remote.interfaces", "*");
        props2.put("osgi.remote.configuration.type", "pojo");
        props2.put("osgi.remote.configuration.pojo.address",
                "http://localhost:9090/greeterB");

        registration2 = bc.registerService(GreeterService.class.getName(),
                                          new GreeterServiceImpl(), props2);


While on the client side I register both in my remote-services.xml file:
<service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0">
  <service-description>
    <provide interface="org.apache.cxf.dosgi.samples.greeter.GreeterService" />
    <property name="osgi.remote.interfaces">*</property>
    <property name="osgi.remote.configuration.type">pojo</property>
    <property name="osgi.remote.configuration.pojo.address">http://localhost:9090/greeterB</property>
  </service-description>
  <service-description>
    <provide interface="org.apache.cxf.dosgi.samples.greeter.GreeterService" />
    <property name="osgi.remote.interfaces">*</property>
    <property name="osgi.remote.configuration.type">pojo</property>
    <property name="osgi.remote.configuration.pojo.address">http://localhost:9090/greeterA</property>
  </service-description>
</service-descriptions>

This works well for me, the consumer gets a reference to both remote
services and can invoke on them.

See if it works for you if you go back to a more basic scenario. If it
doesn't could you maybe provide a test case (with code)?

Thanks,

David

2009/4/30 Nist, Todd (IHG) <To...@ihg.com>:
>
> Hi,
>
> I am encountering the following problem with a client, written in spring osgi / dm
> that is attempting to bind to 2 osgi services using distributed osgi provided by
> CXF.  If I only define 1 <service-description> and reference one of the services
> the client works fine.  If I define 2 <service-description> tags within
> <service-descriptions> as below I get the error shown below.
>
> When the client is started I see the following errors:
>
> Apr 30, 2009 12:14:55 PM org.springframework.osgi.extender.support.DefaultOsgiAp
> plicationContextCreator createApplicationContext
> INFO: Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [C
> ampaign Service Consumer Bundle (com.ihg.crm.service.client)]
> -> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryS
> ervice bundleChanged
> INFO: bundle changed: com.ihg.crm.service.client
> Apr 30, 2009 12:14:55 PM org.springframework.context.support.AbstractApplication
> Context prepareRefresh
> INFO: Refreshing org.springframework.osgi.context.support.OsgiBundleXmlApplicati
> onContext@1d32a62: display name [OsgiBundleXmlApplicationContext(bundle=com.ihg.
> crm.service.client, config=osgibundle:/META-INF/spring/*.xml)]; startup date [Th
> u Apr 30 12:14:55 EDT 2009]; root of context hierarchy
> Apr 30, 2009 12:14:55 PM org.springframework.osgi.context.support.AbstractOsgiBu
> ndleApplicationContext unpublishContextAsOsgiService
> INFO: Unpublishing application context OSGi service for bundle Campaign Service
> Consumer Bundle (com.ihg.crm.service.client)
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
> om.ihg.crm.service.campaign.CampaignService]
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
> om.ihg.crm.service.campaign.CampaignService]
> Apr 30, 2009 12:14:55 PM org.springframework.beans.factory.xml.XmlBeanDefinition
> Reader loadBeanDefinitions
> INFO: Loading XML bean definitions from URL [bundle://37.0:0/META-INF/spring/bun
> dle-context-osgi.xml]
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: (|(service.interface=com.ihg.crm.service.campaign.Campaig
> nService)(service.interface=com.ihg.crm.service.campaign.OfferService)) matches
> [com.ihg.crm.service.campaign.CampaignService]
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
> om.ihg.crm.service.campaign.OfferService]
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Disco
> veryCallback serviceChanged
> INFO: Notified - AVAILABLE: [com.ihg.crm.service.campaign.OfferService] endpoint
>  id: null
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook unkno
> wnEndpointId
> WARNING: registering proxy with unknown duplicate status as endpoint ID unset
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook cache
> EndpointId
> WARNING: cannot cache proxy registration as endpoint ID unset
> Apr 30, 2009 12:14:55 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: com.ihg.crm.service.campaign.OfferService contained by [c
> om.ihg.crm.service.campaign.OfferService]
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Disco
> veryCallback serviceChanged
> INFO: Notified - AVAILABLE: [com.ihg.crm.service.campaign.OfferService] endpoint
>  id: null
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook unkno
> wnEndpointId
> WARNING: registering proxy with unknown duplicate status as endpoint ID unset
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook cache
> EndpointId
> WARNING: cannot cache proxy registration as endpoint ID unset
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: check if string: (|(service.interface=com.ihg.crm.service.campaign.Campaig
> nService)(service.interface=com.ihg.crm.service.campaign.OfferService)) matches
> [com.ihg.crm.service.campaign.OfferService]
> Apr 30, 2009 12:14:56 PM org.springframework.context.support.AbstractApplication
> Context obtainFreshBeanFactory
> INFO: Bean factory for application context [org.springframework.osgi.context.sup
> port.OsgiBundleXmlApplicationContext@1d32a62]: org.springframework.beans.factory
> .support.DefaultListableBeanFactory@eb6e29
> Apr 30, 2009 12:14:56 PM org.springframework.osgi.extender.internal.dependencies
> .startup.DependencyServiceManager doFindDependencies
> INFO: Adding OSGi service dependency for importer [&campaignServiceRef] matching
>  OSGi filter [(objectClass=com.ihg.crm.service.campaign.CampaignService)]
> Apr 30, 2009 12:14:56 PM org.springframework.osgi.extender.internal.dependencies
> .startup.DependencyServiceManager findServiceDependencies
> INFO: OsgiBundleXmlApplicationContext(bundle=com.ihg.crm.service.client, config=
> osgibundle:/META-INF/spring/*.xml) is waiting for unsatisfied dependencies [[&ca
> mpaignServiceRef]]
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook looku
> pDiscoveryService
> INFO: lookup discovery service: interface: com.ihg.crm.service.campaign.Campaign
> Service filter: null
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice updateTracker
> INFO: updating tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discov
> eryCallback@3e926
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice addTracker
> INFO: adding tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discover
> yCallback@3e926 collection: [com.ihg.crm.service.campaign.OfferService, com.ihg.
> crm.service.campaign.OfferService, com.ihg.crm.service.campaign.CampaignService]
>  registered against prop: osgi.discovery.interest.interfaces
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice addTracker
> INFO: adding tracker: org.apache.cxf.dosgi.dsw.hooks.AbstractClientHook$Discover
> yCallback@3e926 collection: [(|(service.interface=com.ihg.crm.service.campaign.C
> ampaignService)(service.interface=com.ihg.crm.service.campaign.OfferService))] r
> egistered against prop: osgi.discovery.interest.filters
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: search for matches to trigger callbacks with delta: []
> Apr 30, 2009 12:14:56 PM org.apache.cxf.dosgi.discovery.local.LocalDiscoveryServ
> ice triggerCallbacks
> INFO: search for matches to trigger callbacks with delta: []
>
>
> The 2 services and client code are written using spring osgi / dm and running
> within equinox for the server and felix for the client.  The services
> bundle-context-osgi.xml files look as follows:
>
>
> CampaignService - bundle-context-osgi.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>
>    <osgi:reference id="dataSourceRef" interface="javax.sql.DataSource"/>
>    <osgi:service interface="com.ihg.crm.service.campaign.CampaignService">
>          <osgi:service-properties>
>            <entry key="osgi.remote.interfaces" value="*" />
>            <!-- entry key="osgi.remote.configuration.type" value="pojo" / -->
>            <!-- entry key="osgi.remote.configuration.pojo.httpservice.context" value="/offer" / -->
>          </osgi:service-properties>
>          <bean class="com.ihg.crm.service.campaign.impl.CampaignServiceImpl"
>              init-method="start">
>              <property name="dataSource" ref="dataSourceRef" />
>          </bean>
>        </osgi:service>
> </beans>
>
> OfferService - bundle-context-osgi.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>
>        <osgi:reference id="dataSourceRef" interface="javax.sql.DataSource"/>
>        <osgi:service interface="com.ihg.crm.service.campaign.OfferService">
>          <osgi:service-properties>
>            <entry key="osgi.remote.interfaces" value="*" />
>          </osgi:service-properties>
>          <bean class="com.ihg.crm.service.offer.impl.OfferServiceImpl"
>              init-method="start">
>              <property name="dataSource" ref="dataSourceRef" />
>          </bean>
>        </osgi:service>
> </beans>
>
> A ss on the equinox instance shows all bundles deployed and active:
>
> osgi> ss
>
> Framework is launched.
>
> id      State       Bundle
> 0       ACTIVE      org.eclipse.osgi_3.5.0.v20090311-1300
> 1       ACTIVE      org.eclipse.osgi.services_3.2.0.v20090306-1900
> 2       ACTIVE      javax.servlet_2.5.0.v200806031605
> 3       ACTIVE      com.springsource.org.apache.commons.pool_1.3.0
> 4       ACTIVE      com.springsource.org.apache.commons.dbcp_1.2.2.osgi
> 5       ACTIVE      com.springsource.javax.resource_1.5.0
> 6       ACTIVE      com.springsource.oracle.jdbc_10.2.0.2
> 7       ACTIVE      org.apache.geronimo.specs.geronimo-annotation_1.0_spec_1.1.1
> 8       ACTIVE      org.apache.geronimo.specs.geronimo-activation_1.1_spec_1.0.2
> 9       ACTIVE      org.apache.geronimo.specs.geronimo-javamail_1.4_spec_1.2.0
> 10      ACTIVE      org.apache.geronimo.specs.geronimo-ws-metadata_2.0_spec_1.1.2
> 11      ACTIVE      com.springsource.slf4j.org.apache.commons.logging_1.5.0
> 12      ACTIVE      com.springsource.slf4j.api_1.5.0
>                    Fragments=13
> 13      RESOLVED    com.springsource.slf4j.log4j_1.5.0
>                    Master=12
> 14      ACTIVE      org.springframework.osgi.log4j.osgi_1.2.15.SNAPSHOT
> 15      ACTIVE      com.springsource.org.jdom_1.0.0
> 16      ACTIVE      org.springframework.core_2.5.6
> 17      ACTIVE      org.springframework.beans_2.5.6
> 18      ACTIVE      org.springframework.context_2.5.6
> 19      ACTIVE      org.springframework.transaction_2.5.6
> 20      ACTIVE      org.springframework.jdbc_2.5.6
> 21      ACTIVE      com.springsource.org.aopalliance_1.0.0
> 22      ACTIVE      org.springframework.aop_2.5.6
> 23      ACTIVE      org.springframework.osgi.io_1.2.0
> 24      ACTIVE      org.springframework.osgi.core_1.2.0
> 25      ACTIVE      org.springframework.osgi.extender_1.2.0
> 26      ACTIVE      org.ops4j.pax.web.service_0.5.1
> 27      ACTIVE      org.apache.servicemix.bundles.jaxb-impl_2.1.6.1
> 28      ACTIVE      org.apache.servicemix.bundles.wsdl4j_1.6.1.1
> 29      ACTIVE      org.apache.servicemix.bundles.xmlsec_1.3.0.1
> 30      ACTIVE      org.apache.servicemix.bundles.xmlschema_1.4.3.1
> 31      ACTIVE      org.apache.servicemix.bundles.asm_2.2.3.1
> 32      ACTIVE      org.apache.servicemix.bundles.xmlresolver_1.2.0.1
> 33      ACTIVE      org.apache.servicemix.bundles.neethi_2.0.4.1
> 34      ACTIVE      org.apache.servicemix.bundles.woodstox_3.2.7.1
> 35      ACTIVE      org.apache.cxf.bundle-minimal_2.2.1.SNAPSHOT
> 36      ACTIVE      org.apache.servicemix.specs.saaj-api-1.3_1.1.1
> 37      ACTIVE      org.apache.servicemix.specs.stax-api-1.0_1.1.1
> 38      ACTIVE      org.apache.servicemix.specs.jaxb-api-2.1_1.1.1
> 39      ACTIVE      org.apache.servicemix.specs.jaxws-api-2.1_1.1.1
> 40      ACTIVE      cxf-dosgi-ri-discovery-local_1.0.0.SNAPSHOT
> 41      ACTIVE      cxf-dosgi-ri-dsw-cxf_1.0.0.SNAPSHOT
> 42      ACTIVE      datasource_0.0.1
> 43      ACTIVE      com.ihg.crm.model.campaign_0.0.1.SNAPSHOT
> 44      ACTIVE      com.ihg.crm.service.campaign.interface_0.0.1.SNAPSHOT
> 45      ACTIVE      com.ihg.crm.service.offer.impl_0.0.1.SNAPSHOT
> 46      ACTIVE      CampaignServiceImpl_0.0.1
> 47      ACTIVE      com.unicacorp.interact.api_0.0.0
>
>
> I am able to access both services via the browser by pointing to the url which they are exposed on and receive the wsdl back (http://10.163.163.64:9000/com/ihg/crm/service/campaign/CampaignService?wsdl and
> http://10.163.163.64:9000/com/ihg/crm/service/campaign/OfferService?wsdl) so I can see that both services are up and running.
>
>
> The client bundle-osgi-context.xml looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xmlns:osgi="http://www.springframework.org/schema/osgi"
>  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
>  http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
>
>  <osgi:reference id="campaignServiceRef" interface="com.ihg.crm.service.campaign.CampaignService"/>
>  <osgi:reference id="offerServiceRef" interface="com.ihg.crm.service.campaign.OfferService"/>
>
>  <bean class="com.ihg.crm.service.campaign.client.CampaignServiceConsumer"
>        init-method="start">
>    <property name="campaignService" ref="campaignServiceRef"/>
>    <property name="offerService" ref = "offerServiceRef"/>
>  </bean>
>
> </beans>
>
> My Client has the following definition for discovering the services within the remote-services.xml
>
> <service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0">
>  <service-description>
>    <provide interface="com.ihg.crm.service.campaign.CampaignService" />
>    <property name="osgi.remote.interfaces">*</property>
>    <property name="service.intents">SOAP HTTP</property>
>    <property name="osgi.remote.configuration.type">pojo</property>
>    <!-- property name="osgi.remote.configuration.pojo.address">http://localhost:8080/offer</property -->
>    <property name="osgi.remote.configuration.pojo.address">
>        http://10.163.163.64:9000/com/ihg/crm/service/campaign/CampaignService
>    </property>
>  </service-description>
>  <service-description>
>    <provide interface="com.ihg.crm.service.campaign.OfferService" />
>    <property name="osgi.remote.interfaces">*</property>
>    <property name="service.intents">SOAP HTTP</property>
>    <property name="osgi.remote.configuration.type">pojo</property>
>    <!-- property name="osgi.remote.configuration.pojo.address">http://localhost:8080/offer</property -->
>    <property name="osgi.remote.configuration.pojo.address">
>        http://10.163.163.64:9000/com/ihg/crm/service/campaign/OfferService
>    </property>
>  </service-description>
> </service-descriptions>
>
>
> Client Bundles (Campaign Service Consumer Bundle) - Felix:
>
> -> ps
> START LEVEL 1
>   ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (1.4.1)
> [   1] [Active     ] [    1] Apache Felix Shell Service (1.0.2)
> [   2] [Active     ] [    1] Apache Felix Shell TUI (1.0.2)
> [   3] [Active     ] [    1] Apache Felix Bundle Repository (1.2.1)
> [   4] [Active     ] [    1] OSGi R4 Compendium Bundle (4.1.0)
> [   5] [Active     ] [    1] geronimo-annotation_1.0_spec (1.1.1)
> [   6] [Active     ] [    1] geronimo-activation_1.1_spec (1.0.2)
> [   7] [Active     ] [    1] geronimo-javamail_1.4_spec (1.2)
> [   8] [Active     ] [    1] geronimo-ws-metadata_2.0_spec (1.1.2)
> [   9] [Active     ] [    1] Apache Commons Logging (1.1.1)
> [  10] [Active     ] [    1] JDOM DOM Processor (1.0.0)
> [  11] [Active     ] [    1] Spring Core (2.5.6)
> [  12] [Active     ] [    1] Spring Beans (2.5.6)
> [  13] [Active     ] [    1] Spring Context (2.5.6)
> [  14] [Active     ] [    1] AOP Alliance API (1.0.0)
> [  15] [Active     ] [    1] Spring AOP (2.5.6)
> [  16] [Active     ] [    1] spring-osgi-io (1.2.0)
> [  17] [Active     ] [    1] spring-osgi-core (1.2.0)
> [  18] [Active     ] [    1] spring-osgi-extender (1.2.0)
> [  19] [Active     ] [    1] OPS4J Pax Web - Service (0.5.1)
> [  20] [Active     ] [    1] Apache ServiceMix Bundles: jaxb-impl-2.1.6 (2.1.6.1)
> [  21] [Active     ] [    1] Apache ServiceMix Bundles: wsdl4j-1.6.1 (1.6.1.1)
> [  22] [Active     ] [    1] Apache ServiceMix Bundles: xmlsec-1.3.0 (1.3.0.1)
> [  23] [Active     ] [    1] Apache ServiceMix Bundles: xmlschema-1.4.3 (1.4.3.1)
> [  24] [Active     ] [    1] Apache ServiceMix Bundles: asm-2.2.3 (2.2.3.1)
> [  25] [Active     ] [    1] Apache ServiceMix Bundles: xmlresolver-1.2 (1.2.0.1)
> [  26] [Active     ] [    1] Apache ServiceMix Bundles: neethi-2.0.4 (2.0.4.1)
> [  27] [Active     ] [    1] Apache ServiceMix Bundles: woodstox-3.2.7 (3.2.7.1)
> [  28] [Active     ] [    1] Apache CXF Minimal Bundle Jar (2.2.1.SNAPSHOT)
> [  29] [Active     ] [    1] Apache ServiceMix Specs :: SAAJ API 1.3 (1.1.1)
> [  30] [Active     ] [    1] Apache ServiceMix Specs :: STAX API 1.0 (1.1.1)
> [  31] [Active     ] [    1] Apache ServiceMix Specs :: JAXB API 2.1 (1.1.1)
> [  32] [Active     ] [    1] Apache ServiceMix Specs :: JAXWS API 2.1 (1.1.1)
> [  33] [Active     ] [    1] CXF Local Discovery Service Bundle (1.0.0.SNAPSHOT)
> [  34] [Active     ] [    1] CXF Distributed Software Bundle (1.0.0.SNAPSHOT)
> [  35] [Active     ] [    1] Campaign Model Bundle (0.0.1.SNAPSHOT)
> [  36] [Active     ] [    1] Campaign Service Interfaces (0.0.1.SNAPSHOT)
> [  37] [Active     ] [    1] Campaign Service Consumer Bundle (0.0.1.SNAPSHOT)
>
>
> I am not sure what I am missing but feel sure it is something within the configuration of
> the bundle-context-osgi.xml of the server or client or the remote-services.xml entries, but
> am at a loss as to what it is.  Any guidance in this would be much appreciated.
>
> Thanks in advance for the assistance.
>
> Regards,
> Todd
>