|
|
CXF DOSGi (RFC-119) and Spring-DM problem discovering multiple remote services
Hi, I have posted and entry to the CXF forums, but since I am using Spring-DM 1.2.0 I thought I would ask here as well. The CXF forum entry can be found here: dosgi---Proble...d23325046.html There is an example attached to the thread that reproduces the below problem.
Core Problem when I bind to more then one osgi service exposed via CXF DOSGi, I encounter the following error:
Code: [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..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 [amp;helloServiceRef]), Dependency on [(objectClass=com.ihg.crm.service.campaign.goodby.GoodByService)] (from bean [amp;goodByServiceRef])
org..context.ApplicationContextException: Application context initialization for 'com.ihg.crm.service.client' has timed out at org..osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:462) at org..osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:51) at org..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..context.ApplicationContextException: Application context initialization for 'com.ihg.crm.service.client' has timed out at org..osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.timeout(DependencyWaiterApplicationContextExecutor.java:462) at org..osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.access$000(DependencyWaiterApplicationContextExecutor.java:51) at org..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..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]
} The services are active and available within the server. It is running on equinox with spring-dm 1.2.0 and the latest of CXF DOSGi.
Continuted
Any guidance or thoughts on what may be going on here would be greatly appreciated. Regards, Todd
[Continued...]
The problem, when I try to discover and bind to 2 remote OSGi services exposed via the CXF DOSGi, I encounter an error. If I only reference 1 remote service all works fine. For example if I have the following in the remote-service.xml then all is well:
Code: lt;service-descriptions xmlns=quot;xmlns/sd/v1.0.0quot;gt; lt;service-descriptiongt; lt;provide interface=quot;com.ihg.crm.service.campaign.hello.HelloServicequot; /gt; lt;property name=quot;osgi.remote.interfacesquot;gt;*lt;/propertygt; lt;property name=quot;service.intentsquot;gt;SOAP fromlt;/propertygt; lt;property name=quot;osgi.remote.configuration.typequot;gt;pojolt;/propertygt; lt;property name=quot;osgi.remote.configuration.pojo.addressquot;gt; com/ihg/crm/service/campaign/hello/HelloService lt;/propertygt; lt;/service-descriptiongt; lt;/service-descriptionsgt; If I attempt to reference 2 services, remote-service.xml:
Code: lt;service-descriptions xmlns=quot;xmlns/sd/v1.0.0quot;gt; lt;service-descriptiongt; lt;provide interface=quot;com.ihg.crm.service.campaign.hello.HelloServicequot; /gt; lt;property name=quot;osgi.remote.interfacesquot;gt;*lt;/propertygt; lt;property name=quot;service.intentsquot;gt;SOAP fromlt;/propertygt; lt;property name=quot;osgi.remote.configuration.typequot;gt;pojolt;/propertygt; lt;property name=quot;osgi.remote.configuration.pojo.addressquot;gt; com/ihg/crm/service/campaign/hello/HelloService lt;/propertygt; lt;/service-descriptiongt; lt;service-descriptiongt; lt;provide interface=quot;com.ihg.crm.service.campaign.goodby.GoodByServicequot; /gt; lt;property name=quot;osgi.remote.interfacesquot;gt;*lt;/propertygt; lt;property name=quot;service.intentsquot;gt;SOAP fromlt;/propertygt; lt;property name=quot;osgi.remote.configuration.typequot;gt;pojolt;/propertygt; lt;property name=quot;osgi.remote.configuration.pojo.addressquot;gt; com/ihg/crm/service/campaign/goodby/GoodByService lt;/propertygt; lt;/service-descriptiongt; lt;/service-descriptionsgt;
Then I encounter the error shown in the above post. The actual META-INF/spring/bundle-context-osgi.xml file looks like this:
Code: lt;osgi:reference id=quot;helloServiceRefquot; interface=quot;com.ihg.crm.service.campaign.hello.HelloServicequot;/gt; lt;osgi:reference id=quot;goodByServiceRefquot; interface=quot;com.ihg.crm.service.campaign.goodby.GoodByServicequot;/gt; lt;bean class=quot;com.ihg.crm.service.client.MultiServiceTestClientquot;init-method=quot;startquot;gt; lt;property name=quot;helloServicequot; ref=quot;helloServiceRefquot;/gt; lt;property name=quot;goodByServicequot; ref = quot;goodByServiceRefquot;/gt; lt;/beangt; lt;/beansgt;If I don't use Spring-DM and I define a simple bundle activator, I am able to access both services without any problems, but then I am not able to inject the remote service into the spring client, or at least I am not quite sure how. I would much rather use Spring-DM and not have to go the route of a bundle activator with a service tracker,...
Again, any guidance or assistance on resolving this is greatly appreciated.
Regards,
Todd
I'm not familiar with the DOSGi part so I'll only comment on the Spring DM side of things.
The error indicates that two mandatory dependencies haven't been found and thus the application context cannot start.
In your case these are helloServiceRef and goodByServiceRef (shouldn't it be goodbyE?).
There are multiple reasons why the services are not found:
1. there are no services
2. the services are present but they are not type compatible (i.e. the version of GoodByeService used by the importer is different then the one of the existing service)
I have looked at the thread but I'm not clear if there is a scenario that works and one that doesn't. Try to use only one remote service first and see whether that makes a difference. Additionally, if you discover that things are working w/o Spring DM, do an interogation of the existing services and see which ones are present.
Another guess would be that DOSGi expects users to look for services in a certain way and maybe due to some filter mismatch, is unaware Spring DM looks for a remote service. This might be the case especially when more then one services are used since then the filter is less predictable.
First, yes it should be GoodbyeService , at least I was consistently incorrect If I only reference one of the remote services all works fine, NOT very clear in first post. I understand that the error is indicating that it can not resolve the dependencies, but am perplexed as to why as it works if I implement BundleContextAware and a ServiceTracker (See below / attached).
In the client, pure spring-dm, if I have the following in my META-INF/spring/bundle-context-osgi.xml file:
Code: lt;osgi:reference id=quot;helloServiceRefquot; interface=quot;com.ihg.crm.service.campaign.hello.HelloServicequot;/gt; lt;bean class=quot;com.ihg.crm.service.client.MultiServiceTestClientquot; init-method=quot;startquot;gt; lt;property name=quot;helloServicequot; ref=quot;helloServiceRefquot;/gt; lt;/beangt; And the OSGI-INF/remote-service/remote-services.xml only discovers 1 remote service:
Code: lt;service-descriptiongt; lt;provide interface=quot;com.ihg.crm.service.campaign.hello.HelloServicequot; /gt; lt;property name=quot;osgi.remote.interfacesquot;gt;*lt;/propertygt; lt;property name=quot;service.intentsquot;gt;SOAP fromlt;/propertygt; lt;property name=quot;osgi.remote.configuration.typequot;gt;pojolt;/propertygt; lt;property name=quot;osgi.remote.configuration.pojo.addressquot;gt; com/ihg/crm/service/campaign/hello/HelloService lt;/propertygt; lt;/service-descriptiongt; Then it wires up just find. If I change the bundle-context-osgi.xml file to reference 2 remote services:
Code: lt;osgi:reference id=quot;helloServiceRefquot; interface=quot;com.ihg.crm.service.campaign.hello.HelloServicequot;/gt; lt;osgi:reference id=quot;goodbyeServiceRefquot; --gt; interface=quot;com.ihg.crm.service.campaign.goodbye.GoodbyeServicequot;/gt; And modify OSGI-INF/remote-service/remote-services.xml to discovery the 2 services:
Code: lt;service-descriptiongt; lt;provide interface=quot;com.ihg.crm.service.campaign.hello.HelloServicequot; /gt; lt;property name=quot;osgi.remote.interfacesquot;gt;*lt;/propertygt; lt;property name=quot;service.intentsquot;gt;SOAP fromlt;/propertygt; lt;property name=quot;osgi.remote.configuration.typequot;gt;pojolt;/propertygt; lt;property name=quot;osgi.remote.configuration.pojo.addressquot;gt; com/ihg/crm/service/campaign/hello/HelloService lt;/propertygt; lt;/service-descriptiongt; lt;service-descriptiongt; lt;provide interface=quot;com.ihg.crm.service.campaign.goodby.GoodbyeServicequot; /gt; lt;property name=quot;osgi.remote.interfacesquot;gt;*lt;/propertygt; lt;property name=quot;service.intentsquot;gt;SOAP fromlt;/propertygt; lt;property name=quot;osgi.remote.configuration.typequot;gt;pojolt;/propertygt; lt;property name=quot;osgi.remote.configuration.pojo.addressquot;gt; com/ihg/crm/service/campaign/goodbye/GoodbyeService lt;/propertygt; lt;/service-descriptiongt; I get the exception explained above. All bundles are the same version in all running instances. I can discover and wire up to either remote service individually, but both cause failure.
If I implement BundleContextAware as suggested on the CXF thread, and use a ServiceTracker for the services, I can wire up to both; any thoughts on why that would be?
New Client code is attached, it removes the osgi.reference tags and the injection of the services.
TIA for any assistance, it is much appreciated.l
Regards, Todd
Hi Costin, So I have interrogated the bundles for each of the run times and this is what I see (this is not using the osgi:reference on the client side, but is using osgi:service on the server side, hello and goodbye). I have split the client-runtime bundles onto the next post as I ran out of room. Goodbye-Server-Runtime:
Code: 42 ACTIVE com.ihg.crm.service.goodbye.impl_0.0.1.SNAPSHOT 43 ACTIVE com.ihg.crm.service.interfaces.goodbye_0.0.1.SNAPSHOT osgigt; bundle 42 com.ihg.crm.service.goodbye.impl_0.0.1.SNAPSHOT [42] Id=42, Status=ACTIVE Data Root=D:\development\offer_poc\osgi_runtime\equi nox\server-goodbye-runtime\configuration\org.eclipse.osgi\bundles\42\data Registered Services {com.ihg.crm.service.campaign.goodbye.GoodbyeService}={org..o sgi.bean.name=c713d2, Bundle-SymbolicName=com.ihg.crm.service.goodbye.impl, Bund le-Version=0.0.1.SNAPSHOT, osgi.remote.interfaces=com.ihg.crm.service.campaign.g oodbye.GoodbyeService, osgi.remote.configuration.type=pojo, osgi.remote.configur ation.pojo.address=com/ihg/crm/service/campaign/goodbye/Go odbyeService, service.id=36} {org..osgi.context.DelegatedExecutionOsgiBundleApplicationCon text, org..osgi.context.ConfigurableOsgiBundleApplicationContext, org..context.ConfigurableApplicationContext, org. .context.ApplicationContext, org..context.Lifecycle, org.springfr amework.beans.factory.ListableBeanFactory, org..beans.factory.Hie rarchicalBeanFactory, org..context.MessageSource, org.springframe work.context.ApplicationEventPublisher, org..core.io.support.Reso urcePatternResolver, org..beans.factory.BeanFactory, org.springfr amework.core.io.ResourceLoader, org..beans.factory.DisposableBean }={org..context.service.name=com.ihg.crm.service.goodbye.impl, Bu ndle-SymbolicName=com.ihg.crm.service.goodbye.impl, Bundle-Version=0.0.1.SNAPSHO T, service.id=37} Services in use: {org..beans.factory.xml.NamespaceHandlerResolver}={service.id =26} {org.xml.sax.EntityResolver}={service.id=27} Exported packages com.ihg.crm.service.goodbye.impl; version=quot;0.0.1.SNAPSHOTquot;[exported] Imported packages com.ihg.crm.service.campaign.goodbye; version=quot;0.0.1.SNAPSHOTquot;lt;com.ihg.crm.s ervice.interfaces.goodbye_0.0.1.SNAPSHOT [43]gt; org.osgi.framework; version=quot;1.5.0quot;lt;org.eclipse.osgi_3.5.0.v20090311-1300 [0 ]gt; org.slf4j; version=quot;1.5.0quot;lt;com..slf4j.api_1.5.0 [12]gt; No fragment bundles Named class space com.ihg.crm.service.goodbye.impl; bundle-version=quot;0.0.1.SNAPSHOTquot;[provided] No required bundles osgigt; bundle 43 com.ihg.crm.service.interfaces.goodbye_0.0.1.SNAPSHOT [43] Id=43, Status=ACTIVE Data Root=D:\development\offer_poc\osgi_runtime\equi nox\server-goodbye-runtime\configuration\org.eclipse.osgi\bundles\43\data Registered Services {org..osgi.context.DelegatedExecutionOsgiBundleApplicationCon text, org..osgi.context.ConfigurableOsgiBundleApplicationContext, org..context.ConfigurableApplicationContext, org. .context.ApplicationContext, org..context.Lifecycle, org.springfr amework.beans.factory.ListableBeanFactory, org..beans.factory.Hie rarchicalBeanFactory, org..context.MessageSource, org.springframe work.context.ApplicationEventPublisher, org..core.io.support.Reso urcePatternResolver, org..beans.factory.BeanFactory, org.springfr amework.core.io.ResourceLoader, org..beans.factory.DisposableBean }={org..context.service.name=com.ihg.crm.service.interfaces.goodb ye, Bundle-SymbolicName=com.ihg.crm.service.interfaces.goodbye, Bundle-Version=0 .0.1.SNAPSHOT, service.id=35} Services in use: {org.xml.sax.EntityResolver}={service.id=27} Exported packages com.ihg.crm.service.campaign.goodbye; version=quot;0.0.1.SNAPSHOTquot;[exported] No imported packages No fragment bundles Named class space com.ihg.crm.service.interfaces.goodbye; bundle-version=quot;0.0.1.SNAPSHOTquot;[prov ided] No required bundles osgigt; Hello-Server-Runtime:
Code: 42 ACTIVE com.ihg.crm.service.hello.impl_0.0.1.SNAPSHOT 43 ACTIVE com.ihg.crm.service.interface.hello_0.0.1.SNAPSHOT osgigt; bundle 42 com.ihg.crm.service.hello.impl_0.0.1.SNAPSHOT [42] Id=42, Status=ACTIVE Data Root=D:\development\offer_poc\osgi_runtime\equi nox\server-runtime\configuration\org.eclipse.osgi\bundles\42\data Registered Services {com.ihg.crm.service.campaign.hello.HelloService}={org..osgi. bean.name=e3ffdf, Bundle-SymbolicName=com.ihg.crm.service.hello.impl, Bundle-Ver sion=0.0.1.SNAPSHOT, osgi.remote.interfaces=com.ihg.crm.service.campaign.hello.H elloService, osgi.remote.configuration.type=pojo, osgi.remote.configuration.pojo .address=com/ihg/crm/service/campaign/hello/HelloService, service.id=36} {org..osgi.context.DelegatedExecutionOsgiBundleApplicationCon text, org..osgi.context.ConfigurableOsgiBundleApplicationContext, org..context.ConfigurableApplicationContext, org. .context.ApplicationContext, org..context.Lifecycle, org.springfr amework.beans.factory.ListableBeanFactory, org..beans.factory.Hie rarchicalBeanFactory, org..context.MessageSource, org.springframe work.context.ApplicationEventPublisher, org..core.io.support.Reso urcePatternResolver, org..beans.factory.BeanFactory, org.springfr amework.core.io.ResourceLoader, org..beans.factory.DisposableBean }={org..context.service.name=com.ihg.crm.service.hello.impl, Bund le-SymbolicName=com.ihg.crm.service.hello.impl, Bundle-Version=0.0.1.SNAPSHOT, s ervice.id=37} Services in use: {org..beans.factory.xml.NamespaceHandlerResolver}={service.id =26} {org.xml.sax.EntityResolver}={service.id=27} Exported packages com.ihg.crm.service.hello.impl; version=quot;0.0.1.SNAPSHOTquot;[exported] Imported packages com.ihg.crm.service.campaign.hello; version=quot;0.0.1.SNAPSHOTquot;lt;com.ihg.crm.ser vice.interface.hello_0.0.1.SNAPSHOT [43]gt; org.osgi.framework; version=quot;1.5.0quot;lt;org.eclipse.osgi_3.5.0.v20090311-1300 [0 ]gt; org.slf4j; version=quot;1.5.0quot;lt;com..slf4j.api_1.5.0 [12]gt; No fragment bundles Named class space com.ihg.crm.service.hello.impl; bundle-version=quot;0.0.1.SNAPSHOTquot;[provided] No required bundles osgigt; bundle 43 com.ihg.crm.service.interface.hello_0.0.1.SNAPSHOT [43] Id=43, Status=ACTIVE Data Root=D:\development\offer_poc\osgi_runtime\equi nox\server-runtime\configuration\org.eclipse.osgi\bundles\43\data Registered Services {org..osgi.context.DelegatedExecutionOsgiBundleApplicationCon text, org..osgi.context.ConfigurableOsgiBundleApplicationContext, org..context.ConfigurableApplicationContext, org. .context.ApplicationContext, org..context.Lifecycle, org.springfr amework.beans.factory.ListableBeanFactory, org..beans.factory.Hie rarchicalBeanFactory, org..context.MessageSource, org.springframe work.context.ApplicationEventPublisher, org..core.io.support.Reso urcePatternResolver, org..beans.factory.BeanFactory, org.springfr amework.core.io.ResourceLoader, org..beans.factory.DisposableBean }={org..context.service.name=com.ihg.crm.service.interface.hello, Bundle-SymbolicName=com.ihg.crm.service.interface.hello, Bundle-Version=0.0.1.S NAPSHOT, service.id=35} Services in use: {org.xml.sax.EntityResolver}={service.id=27} Exported packages com.ihg.crm.service.campaign.hello; version=quot;0.0.1.SNAPSHOTquot;[exported] No imported packages No fragment bundles Named class space com.ihg.crm.service.interface.hello; bundle-version=quot;0.0.1.SNAPSHOTquot;[provide d] No required bundles osgigt;
continued on next post
Client-Runtime:
Code: 42 ACTIVE com.ihg.crm.service.client_0.0.1.SNAPSHOT 43 ACTIVE com.ihg.crm.service.interfaces.goodbye_0.0.1.SNAPSHOT 44 ACTIVE com.ihg.crm.service.interface.hello_0.0.1.SNAPSHOT osgigt; bundle 42 com.ihg.crm.service.client_0.0.1.SNAPSHOT [42] Id=42, Status=ACTIVE Data Root=D:\development\offer_poc\osgi_runtime\equi nox\client-runtime\configuration\org.eclipse.osgi\bundles\42\data Registered Services {org..osgi.context.DelegatedExecutionOsgiBundleApplicationCon text, org..osgi.context.ConfigurableOsgiBundleApplicationContext, org..context.ConfigurableApplicationContext, org. .context.ApplicationContext, org..context.Lifecycle, org.springfr amework.beans.factory.ListableBeanFactory, org..beans.factory.Hie rarchicalBeanFactory, org..context.MessageSource, org.springframe work.context.ApplicationEventPublisher, org..core.io.support.Reso urcePatternResolver, org..beans.factory.BeanFactory, org.springfr amework.core.io.ResourceLoader, org..beans.factory.DisposableBean }={org..context.service.name=com.ihg.crm.service.client, Bundle-S ymbolicName=com.ihg.crm.service.client, Bundle-Version=0.0.1.SNAPSHOT, service.i d=39} Services in use: {com.ihg.crm.service.campaign.hello.HelloService}={osgi.remote.interfaces=*, osgi.remote.configuration.pojo.address=com/ihg/crm/servic e/campaign/hello/HelloService, osgi.remote.configuration.type=pojo, service.inte nts=SOAP from, org.apache.cxf.remote.dsw.client=CXF Distributed Software Bundle, version : 1.0.0.SNAPSHOT, osgi.remote=true, service.id=35} {org.xml.sax.EntityResolver}={service.id=27} {com.ihg.crm.service.campaign.goodbye.GoodbyeService}={osgi.remote.interface s=*, osgi.remote.configuration.pojo.address=com/ihg/crm/se rvice/campaign/goodbye/GoodbyeService, osgi.remote.configuration.type=pojo, serv ice.intents=SOAP from, org.apache.cxf.remote.dsw.client=CXF Distributed Software Bundle, version : 1.0.0.SNAPSHOT, osgi.remote=true, service.id=38} Exported packages com.ihg.crm.service.client; version=quot;0.0.0quot;[exported] Imported packages com.ihg.crm.service.campaign.goodbye; version=quot;0.0.1.SNAPSHOTquot;lt;com.ihg.crm.s ervice.interfaces.goodbye_0.0.1.SNAPSHOT [43]gt; com.ihg.crm.service.campaign.hello; version=quot;0.0.1.SNAPSHOTquot;lt;com.ihg.crm.ser vice.interface.hello_0.0.1.SNAPSHOT [44]gt; org.osgi.framework; version=quot;1.5.0quot;lt;org.eclipse.osgi_3.5.0.v20090311-1300 [0 ]gt; org.osgi.util.tracker; version=quot;1.4.2quot;lt;org.eclipse.osgi_3.5.0.v20090311-1300 [0]gt; org.slf4j; version=quot;1.5.0quot;lt;com..slf4j.api_1.5.0 [12]gt; org..beans.factory; version=quot;2.5.6quot;lt;org..beans _2.5.6 [17]gt; org..osgi.context; version=quot;1.2.0quot;lt;org..osgi.c ore_1.2.0 [24]gt; No fragment bundles Named class space com.ihg.crm.service.client; bundle-version=quot;0.0.1.SNAPSHOTquot;[provided] No required bundles osgigt; bundle 43 com.ihg.crm.service.interfaces.goodbye_0.0.1.SNAPSHOT [43] Id=43, Status=ACTIVE Data Root=D:\development\offer_poc\osgi_runtime\equi nox\client-runtime\configuration\org.eclipse.osgi\bundles\43\data Registered Services {org..osgi.context.DelegatedExecutionOsgiBundleApplicationCon text, org..osgi.context.ConfigurableOsgiBundleApplicationContext, org..context.ConfigurableApplicationContext, org. .context.ApplicationContext, org..context.Lifecycle, org.springfr amework.beans.factory.ListableBeanFactory, org..beans.factory.Hie rarchicalBeanFactory, org..context.MessageSource, org.springframe work.context.ApplicationEventPublisher, org..core.io.support.Reso urcePatternResolver, org..beans.factory.BeanFactory, org.springfr amework.core.io.ResourceLoader, org..beans.factory.DisposableBean }={org..context.service.name=com.ihg.crm.service.interfaces.goodb ye, Bundle-SymbolicName=com.ihg.crm.service.interfaces.goodbye, Bundle-Version=0 .0.1.SNAPSHOT, service.id=37} Services in use: {org.xml.sax.EntityResolver}={service.id=27} Exported packages com.ihg.crm.service.campaign.goodbye; version=quot;0.0.1.SNAPSHOTquot;[exported] No imported packages No fragment bundles Named class space com.ihg.crm.service.interfaces.goodbye; bundle-version=quot;0.0.1.SNAPSHOTquot;[prov ided] No required bundles osgigt; bundle 44 com.ihg.crm.service.interface.hello_0.0.1.SNAPSHOT [44] Id=44, Status=ACTIVE Data Root=D:\development\offer_poc\osgi_runtime\equi nox\client-runtime\configuration\org.eclipse.osgi\bundles\44\data Registered Services {org..osgi.context.DelegatedExecutionOsgiBundleApplicationCon text, org..osgi.context.ConfigurableOsgiBundleApplicationContext, org..context.ConfigurableApplicationContext, org. .context.ApplicationContext, org..context.Lifecycle, org.springfr amework.beans.factory.ListableBeanFactory, org..beans.factory.Hie rarchicalBeanFactory, org..context.MessageSource, org.springframe work.context.ApplicationEventPublisher, org..core.io.support.Reso urcePatternResolver, org..beans.factory.BeanFactory, org.springfr amework.core.io.ResourceLoader, org..beans.factory.DisposableBean }={org..context.service.name=com.ihg.crm.service.interface.hello, Bundle-SymbolicName=com.ihg.crm.service.interface.hello, Bundle-Version=0.0.1.S NAPSHOT, service.id=36} Services in use: {org.xml.sax.EntityResolver}={service.id=27} Exported packages com.ihg.crm.service.campaign.hello; version=quot;0.0.1.SNAPSHOTquot;[exported] No imported packages No fragment bundles Named class space com.ihg.crm.service.interface.hello; bundle-version=quot;0.0.1.SNAPSHOTquot;[provide d] No required bundles osgigt;
So it appears correct to me, but I am clearly missing something. Dose anything standout that would need to be added to the filter in the osgi:reference ?Regards,
Todd
Nothing stands out - as far as I can tell it's the usual export/import of services. Turn on logging to TRACE level on org..osgi.service.importer and org..osgi.service.importer.support packages and get more insight on why the importers doesn't pick up the services.
You could try with just one service and then move to two services.
I guess the easiest way to get to the bottom of this, you could just download the sources, setup a break point in ServiceDynamicInterceptor listener class and see what's going on.
I'll try to look into it as well - if you can provide a basic test that exhibits the problem, it would be swell however, it will take some time until I'll get to it.
Any feedback from DavidB - my guess is that the problem has something to do with the ServiceListeners added in 4.2 (and used by the DOSGi implementations).
I think this is a bug in the CXF DOSGi code. I've filed jira/browse/CXF-2200
Thanks for looking into this David - if there is anything I can do to help, just let me know.
Regarding the service listeners, the initial dependency waiter simply aggregates all the filters using an OR clause (|) so for example, if there are two importers, one for Map and one for Set, you would end up with something like this:
Code:
(|(objectClass=java.util.Map)(objectClass=quot;java.util.Setquot;))
Cheers,
Just for the record, this has now been fixed on the CXF/DOSGi trunk. |
|