Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Dynamically extendable Equinox application(How to develop a dynamically extendable Equinox application)
Dynamically extendable Equinox application [message #785710] Sun, 29 January 2012 10:39 Go to next message
Csaba Missing name is currently offline Csaba Missing nameFriend
Messages: 16
Registered: July 2009
Junior Member
Hello Guys,

One of the requirements against our application is to be dynamically (at runtime) extendable.

I decided to use one of the OSGi runtimes (Equinox) because these runtimes support dynamics.

I want to have a simple, proof-of-concept Equinox application using declarative services to prove that requirement:
a service interface will be the facility for the extensions, and service implementations will be the extensions themselves.

So I have 3 plugins:
plugin Service is for the service interface (the extension point of the application)
plugin ServiceConsumer is for consuming/using services (being notified of the new services in order to see that dynamic extendability works)
plugin ServiceImpl is for implementing the service (one of the extensions)

First I launch the application including only the plugins Service and ServiceConsumer.
Then I install plugin ServiceImpl (install <service location>), then try to start it (start <bundle id>). ServiceConsumer should be now notified about the new extension.

Unfortunately I get here an Exception thrown by the declarative services saying it cannot find the service implementation class:

What do I do wrong here, would you please help me?

Many thanks!
Csaba
Re: Dynamically extendable Equinox application [message #792299 is a reply to message #785710] Mon, 06 February 2012 21:22 Go to previous messageGo to next message
Csaba Missing name is currently offline Csaba Missing nameFriend
Messages: 16
Registered: July 2009
Junior Member
Hello Guys,

Trying again...

I have an Equinox OSGi application using Declarative Services with 3 plugins:
-a service interface plugin
-a service provider component
-a service consumer component (cardinality: 0..n, policy: dynamic)

Framework is launched.
id State Bundle
0 ACTIVE org.eclipse.osgi_3.8.0.v20110908-1857
3 ACTIVE osgi.example.service.consumer_1.0.0.qualifier
4 ACTIVE org.eclipse.osgi.services_3.3.0.v20110711-1243
5 ACTIVE org.eclipse.equinox.util_1.0.300.v20110502
6 ACTIVE org.eclipse.equinox.ds_1.3.100.v20110705
10 ACTIVE osgi.example.service_interface_1.0.0.qualifier
11 ACTIVE osgi.example.service.implementation_1.0.0.qualifier

In case the application is launched, the service consumer is triggered.

But in case the service provider is installed and started only after the application has launched, SCR fails to load service implementation class. See exception stack below!

What is the problem with this runtime/post-application deployment of the service component?

Many thanks, Csaba.

Framework is launched.
id State Bundle
0 ACTIVE org.eclipse.osgi_3.8.0.v20110908-1857
3 ACTIVE osgi.example.service.consumer_1.0.0.qualifier
4 ACTIVE org.eclipse.osgi.services_3.3.0.v20110711-1243
5 ACTIVE org.eclipse.equinox.util_1.0.300.v20110502
6 ACTIVE org.eclipse.equinox.ds_1.3.100.v20110705
10 ACTIVE osgi.example.service_interface_1.0.0.qualifier

osgi> install file:/home/csaba/eclipse_distros/Indigo/workspace/osgi.example.service.implementation
Bundle id is 11.

id State Bundle
11 INSTALLED osgi.example.service.implementation_1.0.0.qualifier

osgi> start 11

Here SCR throws an exception:


!SESSION 2012-02-06 21:01:12.378 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments: -dev file:/home/csaba/eclipse_distros/Indigo/workspace/.metadata/.plugins/org.eclipse.pde.core/New_configuration (1)/dev.properties -os linux -ws gtk -arch x86 -consoleLog -console -consolelog

!ENTRY org.eclipse.equinox.ds 4 0 2012-02-06 21:03:11.214
!MESSAGE Exception occurred while creating new instance of component Component[
name = osgi.example.service.implementation
activate = activate
deactivate = deactivate
modified =
configuration-policy = optional
factory = null
autoenable = true
immediate = false
implementation = osgi.example.service.implementation.ServiceImpl
state = Unsatisfied
properties =
serviceFactory = false
serviceInterface = [osgi.example.service_interface.Service]
references = null
located in bundle = osgi.example.service.implementation_1.0.0.qualifier [13]
]
!STACK 0
java.lang.ClassNotFoundException: osgi.example.service.implementation.ServiceImpl
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1208)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:480)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.createInstance(ServiceComponentProp.java:271)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:332)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
at org.eclipse.equinox.internal.ds.ServiceReg.getService(ServiceReg.java:53)
at org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(ServiceUse.java:141)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:139)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:468)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:467)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:594)
at org.eclipse.equinox.internal.ds.InstanceProcess.getService(InstanceProcess.java:686)
at org.eclipse.equinox.internal.ds.model.ComponentReference.getMethod(ComponentReference.java:111)
at org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:322)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:441)
at org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:415)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:319)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:221)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:504)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:259)
at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:441)
at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)

!ENTRY org.eclipse.equinox.ds 4 0 2012-02-06 21:03:11.216
!MESSAGE Exception occurred while creating new instance of component Component[
name = osgi.example.service.implementation
activate = activate
deactivate = deactivate
modified =
configuration-policy = optional
factory = null
autoenable = true
immediate = false
implementation = osgi.example.service.implementation.ServiceImpl
state = Unsatisfied
properties =
serviceFactory = false
serviceInterface = [osgi.example.service_interface.Service]
references = null
located in bundle = osgi.example.service.implementation_1.0.0.qualifier [13]
]
!STACK 0
java.lang.ClassNotFoundException: osgi.example.service.implementation.ServiceImpl
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1208)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:480)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.createInstance(ServiceComponentProp.java:271)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:332)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
at org.eclipse.equinox.internal.ds.ServiceReg.getService(ServiceReg.java:53)
at org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(ServiceUse.java:141)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:139)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:468)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:467)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:594)
at org.eclipse.equinox.internal.ds.InstanceProcess.getService(InstanceProcess.java:686)
at org.eclipse.equinox.internal.ds.model.ComponentReference.getMethod(ComponentReference.java:111)
at org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:322)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:441)
at org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:415)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:319)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:221)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:504)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:259)
at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:441)
at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)

!ENTRY org.eclipse.osgi 4 0 2012-02-06 21:03:11.220
!MESSAGE An unexpected runtime error has occurred.
!STACK 0
org.osgi.service.component.ComponentException: Exception occurred while creating new instance of component Component[
name = osgi.example.service.implementation
activate = activate
deactivate = deactivate
modified =
configuration-policy = optional
factory = null
autoenable = true
immediate = false
implementation = osgi.example.service.implementation.ServiceImpl
state = Unsatisfied
properties =
serviceFactory = false
serviceInterface = [osgi.example.service_interface.Service]
references = null
located in bundle = osgi.example.service.implementation_1.0.0.qualifier [13]
]
at org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:482)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.createInstance(ServiceComponentProp.java:271)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:332)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
at org.eclipse.equinox.internal.ds.ServiceReg.getService(ServiceReg.java:53)
at org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(ServiceUse.java:141)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:139)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:468)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:467)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:594)
at org.eclipse.equinox.internal.ds.InstanceProcess.getService(InstanceProcess.java:686)
at org.eclipse.equinox.internal.ds.model.ComponentReference.getMethod(ComponentReference.java:111)
at org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:322)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:441)
at org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:415)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:319)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:221)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:504)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:259)
at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:441)
at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
Caused by: java.lang.ClassNotFoundException: osgi.example.service.implementation.ServiceImpl
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1208)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:480)
... 34 more

!ENTRY osgi.example.service.implementation 4 0 2012-02-06 21:03:11.223
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.ServiceException: Exception in org.eclipse.equinox.internal.ds.ServiceReg.getService()
at org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:151)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:468)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:467)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:594)
at org.eclipse.equinox.internal.ds.InstanceProcess.getService(InstanceProcess.java:686)
at org.eclipse.equinox.internal.ds.model.ComponentReference.getMethod(ComponentReference.java:111)
at org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:322)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:441)
at org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:415)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:319)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:221)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:504)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:259)
at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:441)
at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
Caused by: org.osgi.service.component.ComponentException: Exception occurred while creating new instance of component Component[
name = osgi.example.service.implementation
activate = activate
deactivate = deactivate
modified =
configuration-policy = optional
factory = null
autoenable = true
immediate = false
implementation = osgi.example.service.implementation.ServiceImpl
state = Unsatisfied
properties =
serviceFactory = false
serviceInterface = [osgi.example.service_interface.Service]
references = null
located in bundle = osgi.example.service.implementation_1.0.0.qualifier [13]
]
at org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:482)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.createInstance(ServiceComponentProp.java:271)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:332)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
at org.eclipse.equinox.internal.ds.ServiceReg.getService(ServiceReg.java:53)
at org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(ServiceUse.java:141)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:139)
... 27 more
Caused by: java.lang.ClassNotFoundException: osgi.example.service.implementation.ServiceImpl
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1208)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:480)
... 34 more

!ENTRY osgi.example.service.consumer 2 0 2012-02-06 21:03:11.228
!MESSAGE [SCR] Could not get the service object relevant to the reference. One possible reason is a circularity problem. Another possible reason is that BundleContext.getService() returns null.
Details:
Problematic reference = Reference[name = Service, interface = osgi.example.service_interface.Service, policy = dynamic, cardinality = 0..n, target = null, bind = setService, unbind = unsetService]
of service component = osgi.example.service.consumer
component implementation class = osgi.example.service.consumer.ServiceConsumer
located in bundle with symbolic name = osgi.example.service.consumer
bundle location = initial@reference:file:../../../../osgi.example.service.consumer/

!ENTRY osgi.example.service.consumer 2 0 2012-02-06 21:03:11.229
!MESSAGE [SCR] ComponentReference.bind(): bind method 'setService' is not found or it is not accessible!
Details:
Problematic reference = Reference[name = Service, interface = osgi.example.service_interface.Service, policy = dynamic, cardinality = 0..n, target = null, bind = setService, unbind = unsetService]
of service component = osgi.example.service.consumer
component implementation class = osgi.example.service.consumer.ServiceConsumer
located in bundle with symbolic name = osgi.example.service.consumer
bundle location = initial@reference:file:../../../../osgi.example.service.consumer/
Re: Dynamically extendable Equinox application [message #794411 is a reply to message #792299] Thu, 09 February 2012 08:51 Go to previous message
Ivan Larionov is currently offline Ivan LarionovFriend
Messages: 37
Registered: July 2009
Member
Hi,

As it is just an example that you are evaluating, you could probably
attach the source code of the plug-ins.

On 06.02.2012 23:22, Csaba Mising name wrote:
> Hello Guys,
>
> Trying again...
>
> I have an Equinox OSGi application using Declarative Services with 3
> plugins:
> -a service interface plugin
> -a service provider component
> -a service consumer component (cardinality: 0..n, policy: dynamic)
>
> Framework is launched.
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.8.0.v20110908-1857
> 3 ACTIVE osgi.example.service.consumer_1.0.0.qualifier
> 4 ACTIVE org.eclipse.osgi.services_3.3.0.v20110711-1243
> 5 ACTIVE org.eclipse.equinox.util_1.0.300.v20110502
> 6 ACTIVE org.eclipse.equinox.ds_1.3.100.v20110705
> 10 ACTIVE osgi.example.service_interface_1.0.0.qualifier
> 11 ACTIVE osgi.example.service.implementation_1.0.0.qualifier
>
> In case the application is launched, the service consumer is triggered.
>
> But in case the service provider is installed and started only after the
> application has launched, SCR fails to load service implementation
> class. See exception stack below!
>
> What is the problem with this runtime/post-application deployment of the
> service component?
>
> Many thanks, Csaba.
>
> Framework is launched.
> id State Bundle
> 0 ACTIVE org.eclipse.osgi_3.8.0.v20110908-1857
> 3 ACTIVE osgi.example.service.consumer_1.0.0.qualifier
> 4 ACTIVE org.eclipse.osgi.services_3.3.0.v20110711-1243
> 5 ACTIVE org.eclipse.equinox.util_1.0.300.v20110502
> 6 ACTIVE org.eclipse.equinox.ds_1.3.100.v20110705
> 10 ACTIVE osgi.example.service_interface_1.0.0.qualifier
>
> osgi> install
> file:/home/csaba/eclipse_distros/Indigo/workspace/osgi.example.service.implementation
>
> Bundle id is 11.
>
> id State Bundle
> 11 INSTALLED osgi.example.service.implementation_1.0.0.qualifier
>
> osgi> start 11
>
> Here SCR throws an exception:
>
>
> !SESSION 2012-02-06 21:01:12.378
> -----------------------------------------------
> eclipse.buildId=unknown
> java.version=1.6.0_20
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
> Command-line arguments: -dev
> file:/home/csaba/eclipse_distros/Indigo/workspace/.metadata/.plugins/org.eclipse.pde.core/New_configuration
> (1)/dev.properties -os linux -ws gtk -arch x86 -consoleLog -console
> -consolelog
>
> !ENTRY org.eclipse.equinox.ds 4 0 2012-02-06 21:03:11.214
> !MESSAGE Exception occurred while creating new instance of component
> Component[
> name = osgi.example.service.implementation
> activate = activate
> deactivate = deactivate
> modified = configuration-policy = optional
> factory = null
> autoenable = true
> immediate = false
> implementation = osgi.example.service.implementation.ServiceImpl
> state = Unsatisfied
> properties = serviceFactory = false
> serviceInterface = [osgi.example.service_interface.Service]
> references = null
> located in bundle = osgi.example.service.implementation_1.0.0.qualifier
> [13]
> ] !STACK 0
> java.lang.ClassNotFoundException:
> osgi.example.service.implementation.ServiceImpl
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1208)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:480)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.createInstance(ServiceComponentProp.java:271)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:332)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
>
> at
> org.eclipse.equinox.internal.ds.ServiceReg.getService(ServiceReg.java:53)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(ServiceUse.java:141)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:139)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:468)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:467)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:594)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.getService(InstanceProcess.java:686)
>
> at
> org.eclipse.equinox.internal.ds.model.ComponentReference.getMethod(ComponentReference.java:111)
>
> at
> org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:322)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:441)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:415)
>
> at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:319)
> at
> org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:221)
>
> at
> org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
>
> at
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
>
> at
> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:504)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:259)
>
> at
> org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:441)
>
> at
> org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
>
> at
> org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
> at
> org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
>
> at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
> at
> org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
>
>
> !ENTRY org.eclipse.equinox.ds 4 0 2012-02-06 21:03:11.216
> !MESSAGE Exception occurred while creating new instance of component
> Component[
> name = osgi.example.service.implementation
> activate = activate
> deactivate = deactivate
> modified = configuration-policy = optional
> factory = null
> autoenable = true
> immediate = false
> implementation = osgi.example.service.implementation.ServiceImpl
> state = Unsatisfied
> properties = serviceFactory = false
> serviceInterface = [osgi.example.service_interface.Service]
> references = null
> located in bundle = osgi.example.service.implementation_1.0.0.qualifier
> [13]
> ] !STACK 0
> java.lang.ClassNotFoundException:
> osgi.example.service.implementation.ServiceImpl
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1208)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:480)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.createInstance(ServiceComponentProp.java:271)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:332)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
>
> at
> org.eclipse.equinox.internal.ds.ServiceReg.getService(ServiceReg.java:53)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(ServiceUse.java:141)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:139)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:468)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:467)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:594)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.getService(InstanceProcess.java:686)
>
> at
> org.eclipse.equinox.internal.ds.model.ComponentReference.getMethod(ComponentReference.java:111)
>
> at
> org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:322)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:441)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:415)
>
> at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:319)
> at
> org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:221)
>
> at
> org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
>
> at
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
>
> at
> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:504)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:259)
>
> at
> org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:441)
>
> at
> org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
>
> at
> org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
> at
> org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
>
> at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
> at
> org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
>
>
> !ENTRY org.eclipse.osgi 4 0 2012-02-06 21:03:11.220
> !MESSAGE An unexpected runtime error has occurred.
> !STACK 0
> org.osgi.service.component.ComponentException: Exception occurred while
> creating new instance of component Component[
> name = osgi.example.service.implementation
> activate = activate
> deactivate = deactivate
> modified = configuration-policy = optional
> factory = null
> autoenable = true
> immediate = false
> implementation = osgi.example.service.implementation.ServiceImpl
> state = Unsatisfied
> properties = serviceFactory = false
> serviceInterface = [osgi.example.service_interface.Service]
> references = null
> located in bundle = osgi.example.service.implementation_1.0.0.qualifier
> [13]
> ] at
> org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:482)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.createInstance(ServiceComponentProp.java:271)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:332)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
>
> at
> org.eclipse.equinox.internal.ds.ServiceReg.getService(ServiceReg.java:53)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(ServiceUse.java:141)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:139)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:468)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:467)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:594)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.getService(InstanceProcess.java:686)
>
> at
> org.eclipse.equinox.internal.ds.model.ComponentReference.getMethod(ComponentReference.java:111)
>
> at
> org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:322)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:441)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:415)
>
> at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:319)
> at
> org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:221)
>
> at
> org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
>
> at
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
>
> at
> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:504)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:259)
>
> at
> org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:441)
>
> at
> org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
>
> at
> org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
> at
> org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
>
> at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
> at
> org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
>
> Caused by: java.lang.ClassNotFoundException:
> osgi.example.service.implementation.ServiceImpl
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1208)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:480)
>
> ... 34 more
>
> !ENTRY osgi.example.service.implementation 4 0 2012-02-06 21:03:11.223
> !MESSAGE FrameworkEvent ERROR
> !STACK 0
> org.osgi.framework.ServiceException: Exception in
> org.eclipse.equinox.internal.ds.ServiceReg.getService()
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:151)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:468)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:467)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:594)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.getService(InstanceProcess.java:686)
>
> at
> org.eclipse.equinox.internal.ds.model.ComponentReference.getMethod(ComponentReference.java:111)
>
> at
> org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:322)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:441)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.dynamicBind(InstanceProcess.java:415)
>
> at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:319)
> at
> org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:221)
>
> at
> org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
>
> at
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
>
> at
> org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
>
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.registerService(InstanceProcess.java:504)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:259)
>
> at
> org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:441)
>
> at
> org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:213)
>
> at
> org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:800)
> at
> org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:767)
>
> at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
> at
> org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executor.run(Executor.java:70)
>
> Caused by: org.osgi.service.component.ComponentException: Exception
> occurred while creating new instance of component Component[
> name = osgi.example.service.implementation
> activate = activate
> deactivate = deactivate
> modified = configuration-policy = optional
> factory = null
> autoenable = true
> immediate = false
> implementation = osgi.example.service.implementation.ServiceImpl
> state = Unsatisfied
> properties = serviceFactory = false
> serviceInterface = [osgi.example.service_interface.Service]
> references = null
> located in bundle = osgi.example.service.implementation_1.0.0.qualifier
> [13]
> ] at
> org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:482)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.createInstance(ServiceComponentProp.java:271)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:332)
>
> at
> org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:588)
>
> at
> org.eclipse.equinox.internal.ds.ServiceReg.getService(ServiceReg.java:53)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(ServiceUse.java:141)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceUse.getService(ServiceUse.java:139)
>
> ... 27 more
> Caused by: java.lang.ClassNotFoundException:
> osgi.example.service.implementation.ServiceImpl
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
>
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
>
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1208)
>
> at
> org.eclipse.equinox.internal.ds.model.ServiceComponent.createInstance(ServiceComponent.java:480)
>
> ... 34 more
>
> !ENTRY osgi.example.service.consumer 2 0 2012-02-06 21:03:11.228
> !MESSAGE [SCR] Could not get the service object relevant to the
> reference. One possible reason is a circularity problem. Another
> possible reason is that BundleContext.getService() returns null.
> Details:
> Problematic reference = Reference[name = Service, interface =
> osgi.example.service_interface.Service, policy = dynamic, cardinality =
> 0..n, target = null, bind = setService, unbind = unsetService]
> of service component = osgi.example.service.consumer
> component implementation class =
> osgi.example.service.consumer.ServiceConsumer
> located in bundle with symbolic name = osgi.example.service.consumer
> bundle location =
> initial@reference:file:../../../../osgi.example.service.consumer/
>
> !ENTRY osgi.example.service.consumer 2 0 2012-02-06 21:03:11.229
> !MESSAGE [SCR] ComponentReference.bind(): bind method 'setService' is
> not found or it is not accessible!
> Details:
> Problematic reference = Reference[name = Service, interface =
> osgi.example.service_interface.Service, policy = dynamic, cardinality =
> 0..n, target = null, bind = setService, unbind = unsetService]
> of service component = osgi.example.service.consumer
> component implementation class =
> osgi.example.service.consumer.ServiceConsumer
> located in bundle with symbolic name = osgi.example.service.consumer
> bundle location =
> initial@reference:file:../../../../osgi.example.service.consumer/
>
Previous Topic:Bundle.findEntries doesn't find files when deployed as jar
Next Topic:Problems start own Bundle in Eclipse
Goto Forum:
  


Current Time: Tue Oct 26 06:44:18 GMT 2021

Powered by FUDForum. Page generated in 0.02218 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top