You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Davi Baldin Tavares <da...@gmail.com> on 2019/04/04 14:19:12 UTC

List of bundles required for Declarative Services Annotation

Hello,

I’m trying to move to DS Annotation.

My Class:

import org.osgi.service.component.annotations.Component;

@Component(name = "ZPluginProvider Service", immediate = true, service = ZPluginProvider.class)
public class ZPluginProvider { … }

I’ve deployed these bundles:

org.apache.felix.scr-2.1.16
org.apache.felix.scr.annotations-1.12.0
org.apache.felix.scr.ds-annotations-1.2.10
org.osgi.util.function-1.1.0
org.osgi.util.promise-1.1.1

However the deployment is not being successfully on org.osgi.service.component.annotations completed because of:

1) org.osgi.service.component.annotations-1.4.0 is missing osgi.unresolved
or
2) org.osgi.service.component.annotations-1.3.0 is missing osgi.compile.time.only

Do someone happen to know witch bundles must I have to deploy along Felix in order to enable declarative services with annotations?

Thanks,

Davi
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: List of bundles required for Declarative Services Annotation

Posted by Robert Munteanu <ro...@apache.org>.
Hi Davi,

On Thu, 2019-04-04 at 11:19 -0300, Davi Baldin Tavares wrote:
> Hello,
> 
> I’m trying to move to DS Annotation.
> 
> My Class:
> 
> import org.osgi.service.component.annotations.Component;
> 
> @Component(name = "ZPluginProvider Service", immediate = true,
> service = ZPluginProvider.class)
> public class ZPluginProvider { … }
> 
> I’ve deployed these bundles:
> 
> org.apache.felix.scr-2.1.16
> org.apache.felix.scr.annotations-1.12.0
> org.apache.felix.scr.ds-annotations-1.2.10
> org.osgi.util.function-1.1.0
> org.osgi.util.promise-1.1.1

You don't need the annotation bundles deployed, they are only used at
build time. It should be enough to remove the two annotation bundles
and your setup whould work.

Robert


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: List of bundles required for Declarative Services Annotation

Posted by Davi Baldin Tavares <da...@gmail.com>.
Nice Tips!

I’ve found on project properties a Check box to generate XML from Annotation. Adding bundle as optional also will avoid bundle errors at startup.

I’ll keep working on DS with Felix. 

Thank you team!



> On 4 Apr 2019, at 14:50, Bruce Jackson <br...@thingstream.io> wrote:
> 
> Ok - I’ve seen this error before with this setup when exporting dployable plugins & bundles from Eclipse.
> Even though the DS annotations are seen in the IDE (and therefore the annotations are not marked as errors) when you export, you seen these problems.
> One way I’ve found to resolve this is to add the ds annotations as an optional dependency:
> 
> In the dependencies panel, add org.osgi.service.component.annotations 1.3 as a dependency, and then click the button marked optional.
> 
>> On 4 Apr 2019, at 18:11, Davi Baldin Tavares <da...@gmail.com> wrote:
>> 
>> Hi,
>> 
>> Yes, I’m using Eclipse PDE. Target Platform is OSGi Framework: Standard.
>> 
>> I’ve deployed the plugin JAR from Export Plugin option. Should I use a custom ANT build Instead in order to generated the proper XML files?
>> 
>> From this point of view this is not a Felix issue.
>> 
>> 
>>> On 4 Apr 2019, at 11:21, Bruce Jackson <br...@thingstream.io> wrote:
>>> 
>>> Are you developing this in Eclipse with the PDE ?
>>> 
>>> 
>>> 
>>> On Thu, 4 Apr 2019, 15:19 Davi Baldin Tavares, <da...@gmail.com>
>>> wrote:
>>> 
>>>> Hello,
>>>> 
>>>> I’m trying to move to DS Annotation.
>>>> 
>>>> My Class:
>>>> 
>>>> import org.osgi.service.component.annotations.Component;
>>>> 
>>>> @Component(name = "ZPluginProvider Service", immediate = true, service =
>>>> ZPluginProvider.class)
>>>> public class ZPluginProvider { … }
>>>> 
>>>> I’ve deployed these bundles:
>>>> 
>>>> org.apache.felix.scr-2.1.16
>>>> org.apache.felix.scr.annotations-1.12.0
>>>> org.apache.felix.scr.ds-annotations-1.2.10
>>>> org.osgi.util.function-1.1.0
>>>> org.osgi.util.promise-1.1.1
>>>> 
>>>> However the deployment is not being successfully on
>>>> org.osgi.service.component.annotations completed because of:
>>>> 
>>>> 1) org.osgi.service.component.annotations-1.4.0 is missing osgi.unresolved
>>>> or
>>>> 2) org.osgi.service.component.annotations-1.3.0 is missing
>>>> osgi.compile.time.only
>>>> 
>>>> Do someone happen to know witch bundles must I have to deploy along Felix
>>>> in order to enable declarative services with annotations?
>>>> 
>>>> Thanks,
>>>> 
>>>> Davi
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>> 
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
> 
> 
> ----
> Bruce Jackson
> CTO
> bruce.jackson@thingstream.io
> 
> 
> 
> 


Re: List of bundles required for Declarative Services Annotation

Posted by Bruce Jackson <br...@thingstream.io>.
Ok - I’ve seen this error before with this setup when exporting dployable plugins & bundles from Eclipse.
Even though the DS annotations are seen in the IDE (and therefore the annotations are not marked as errors) when you export, you seen these problems.
One way I’ve found to resolve this is to add the ds annotations as an optional dependency:

In the dependencies panel, add org.osgi.service.component.annotations 1.3 as a dependency, and then click the button marked optional.

> On 4 Apr 2019, at 18:11, Davi Baldin Tavares <da...@gmail.com> wrote:
> 
> Hi,
> 
> Yes, I’m using Eclipse PDE. Target Platform is OSGi Framework: Standard.
> 
> I’ve deployed the plugin JAR from Export Plugin option. Should I use a custom ANT build Instead in order to generated the proper XML files?
> 
> From this point of view this is not a Felix issue.
> 
> 
>> On 4 Apr 2019, at 11:21, Bruce Jackson <br...@thingstream.io> wrote:
>> 
>> Are you developing this in Eclipse with the PDE ?
>> 
>> 
>> 
>> On Thu, 4 Apr 2019, 15:19 Davi Baldin Tavares, <da...@gmail.com>
>> wrote:
>> 
>>> Hello,
>>> 
>>> I’m trying to move to DS Annotation.
>>> 
>>> My Class:
>>> 
>>> import org.osgi.service.component.annotations.Component;
>>> 
>>> @Component(name = "ZPluginProvider Service", immediate = true, service =
>>> ZPluginProvider.class)
>>> public class ZPluginProvider { … }
>>> 
>>> I’ve deployed these bundles:
>>> 
>>> org.apache.felix.scr-2.1.16
>>> org.apache.felix.scr.annotations-1.12.0
>>> org.apache.felix.scr.ds-annotations-1.2.10
>>> org.osgi.util.function-1.1.0
>>> org.osgi.util.promise-1.1.1
>>> 
>>> However the deployment is not being successfully on
>>> org.osgi.service.component.annotations completed because of:
>>> 
>>> 1) org.osgi.service.component.annotations-1.4.0 is missing osgi.unresolved
>>> or
>>> 2) org.osgi.service.component.annotations-1.3.0 is missing
>>> osgi.compile.time.only
>>> 
>>> Do someone happen to know witch bundles must I have to deploy along Felix
>>> in order to enable declarative services with annotations?
>>> 
>>> Thanks,
>>> 
>>> Davi
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>> 
>>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


----
Bruce Jackson
CTO
bruce.jackson@thingstream.io





Re: List of bundles required for Declarative Services Annotation

Posted by Davi Baldin Tavares <da...@gmail.com>.
Hi,

Yes, I’m using Eclipse PDE. Target Platform is OSGi Framework: Standard.

I’ve deployed the plugin JAR from Export Plugin option. Should I use a custom ANT build Instead in order to generated the proper XML files?

From this point of view this is not a Felix issue.


> On 4 Apr 2019, at 11:21, Bruce Jackson <br...@thingstream.io> wrote:
> 
> Are you developing this in Eclipse with the PDE ?
> 
> 
> 
> On Thu, 4 Apr 2019, 15:19 Davi Baldin Tavares, <da...@gmail.com>
> wrote:
> 
>> Hello,
>> 
>> I’m trying to move to DS Annotation.
>> 
>> My Class:
>> 
>> import org.osgi.service.component.annotations.Component;
>> 
>> @Component(name = "ZPluginProvider Service", immediate = true, service =
>> ZPluginProvider.class)
>> public class ZPluginProvider { … }
>> 
>> I’ve deployed these bundles:
>> 
>> org.apache.felix.scr-2.1.16
>> org.apache.felix.scr.annotations-1.12.0
>> org.apache.felix.scr.ds-annotations-1.2.10
>> org.osgi.util.function-1.1.0
>> org.osgi.util.promise-1.1.1
>> 
>> However the deployment is not being successfully on
>> org.osgi.service.component.annotations completed because of:
>> 
>> 1) org.osgi.service.component.annotations-1.4.0 is missing osgi.unresolved
>> or
>> 2) org.osgi.service.component.annotations-1.3.0 is missing
>> osgi.compile.time.only
>> 
>> Do someone happen to know witch bundles must I have to deploy along Felix
>> in order to enable declarative services with annotations?
>> 
>> Thanks,
>> 
>> Davi
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: List of bundles required for Declarative Services Annotation

Posted by Bruce Jackson <br...@thingstream.io>.
Are you developing this in Eclipse with the PDE ?



On Thu, 4 Apr 2019, 15:19 Davi Baldin Tavares, <da...@gmail.com>
wrote:

> Hello,
>
> I’m trying to move to DS Annotation.
>
> My Class:
>
> import org.osgi.service.component.annotations.Component;
>
> @Component(name = "ZPluginProvider Service", immediate = true, service =
> ZPluginProvider.class)
> public class ZPluginProvider { … }
>
> I’ve deployed these bundles:
>
> org.apache.felix.scr-2.1.16
> org.apache.felix.scr.annotations-1.12.0
> org.apache.felix.scr.ds-annotations-1.2.10
> org.osgi.util.function-1.1.0
> org.osgi.util.promise-1.1.1
>
> However the deployment is not being successfully on
> org.osgi.service.component.annotations completed because of:
>
> 1) org.osgi.service.component.annotations-1.4.0 is missing osgi.unresolved
> or
> 2) org.osgi.service.component.annotations-1.3.0 is missing
> osgi.compile.time.only
>
> Do someone happen to know witch bundles must I have to deploy along Felix
> in order to enable declarative services with annotations?
>
> Thanks,
>
> Davi
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: List of bundles required for Declarative Services Annotation

Posted by Raymond Auge <ra...@liferay.com>.
You need a build plugin that understands how to turn the OSGi annotations
into the XML descriptors inside the resulting jar (bundle).

Which OSGi bundle building plugin are you using?

- Ray

On Thu, Apr 4, 2019 at 10:19 AM Davi Baldin Tavares <da...@gmail.com>
wrote:

> Hello,
>
> I’m trying to move to DS Annotation.
>
> My Class:
>
> import org.osgi.service.component.annotations.Component;
>
> @Component(name = "ZPluginProvider Service", immediate = true, service =
> ZPluginProvider.class)
> public class ZPluginProvider { … }
>
> I’ve deployed these bundles:
>
> org.apache.felix.scr-2.1.16
> org.apache.felix.scr.annotations-1.12.0
> org.apache.felix.scr.ds-annotations-1.2.10
> org.osgi.util.function-1.1.0
> org.osgi.util.promise-1.1.1
>
> However the deployment is not being successfully on
> org.osgi.service.component.annotations completed because of:
>
> 1) org.osgi.service.component.annotations-1.4.0 is missing osgi.unresolved
> or
> 2) org.osgi.service.component.annotations-1.3.0 is missing
> osgi.compile.time.only
>
> Do someone happen to know witch bundles must I have to deploy along Felix
> in order to enable declarative services with annotations?
>
> Thanks,
>
> Davi
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)