Getting a reference to a declarative service

2015-01-20 Thread Artem Zhirkov
Hello, I want to include more than one service into a bundle, so it seems like I have to make a use of declarative services. I'm building a test bundle with maven + maven-bundle-plugin and generating the ds descriptor with maven-scr-plugin, so it looks like this: xmlns:scr="http://www.osgi.

Re: Getting a reference to a declarative service

2015-01-20 Thread Dirk Rudolph
Try to add immediate=“true” to your component definition. This should result in something like > xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0";> > > > > > > value="ru.multicabinet.gateway.ExampleDS"/> > > and causes the component to be sta

Re: Getting a reference to a declarative service

2015-01-20 Thread Neil Bartlett
Dirk: I don’t think Artem was asking about activation of the component, he has a problem with service registration. So whether the component is immediate or delayed seems to be irrelevant. Artem: there are a few things you need to check. Is your bundle active? Do you have a DS implementation bu

Re: Getting a reference to a declarative service

2015-01-20 Thread Milen Dyankov
Also make sure that apart from generating the descriptor(s) it adds the correct 'Service-Component' header in your manifest. I recall some problems when both 'maven-bundle-plugin' and 'maven-scr-plugin' are used together. I personally try to avoid using 'maven-scr-plugin' and add '<_dsannotations>*

Re: Getting a reference to a declarative service

2015-01-20 Thread Dirk Rudolph
Neil: You are right. The service gets registered also when the Component is not yet active. (See OSGI Enterprise Spec R4 112.2.2/112.2.3) On Tue, Jan 20, 2015 at 1:39 PM, Milen Dyankov wrote: > Also make sure that apart from generating the descriptor(s) it adds the > correct 'Service-Component'

Re: Getting a reference to a declarative service

2015-01-20 Thread Artem Zhirkov
Neil, bundle is active, but I dont have any DS implementation bundle installed...I thought the framework itself contains the implementation. On 01/20/2015 03:19 PM, Neil Bartlett wrote: Dirk: I don’t think Artem was asking about activation of the component, he has a problem with service regis

Re: Getting a reference to a declarative service

2015-01-20 Thread Artem Zhirkov
I installed felix scr bundle into my host osgi application and tried to obtain a list of active services by visiting a controller of my spring application which calls osgi code and it threw the following error: | Error java.lang.NoClassDefFoundError: org/springsource/loaded/ri/ReflectiveInterc

Re: Getting a reference to a declarative service

2015-01-20 Thread Neil Bartlett
Felix SCR does not interfere with Spring loading. SCR has nothing to do with Spring. This error has come from your own class in your bundle… by installing SCR you have now for the first time loaded the class (or rather, attempted to load it), so now you see the problem for the first time. The s

Re: Getting a reference to a declarative service

2015-01-20 Thread Artem Zhirkov
I managed to resolve this by running my grails application (which works as an osgi container) without dynamic code reloading feature, which seems to rely on spring loaded. There are no dependencies on anything remotely related to spring in my bundles. On 20.01.2015 21:43, Neil Bartlett wrote