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: ?xml version=1.0

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 ?xml version=1.0 encoding=UTF-8?components xmlns:scr=http://www.osgi.org/xmlns/scr/v1.0.0; scr:component immediate=“true” name=ru.multicabinet.gateway.ExampleDS implementation

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 milendyan...@gmail.com wrote: Also make sure that apart from generating the descriptor(s) it adds the

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

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:

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