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) <[email protected]>:
>
> 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
> oncont...@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.osgibundlexmlapplicationcont...@1d32a62]: 
> org.springframework.beans.factory
> .support.defaultlistablebeanfact...@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
> erycallb...@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
> ycallb...@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
> ycallb...@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
>

Reply via email to