AEM 6.4.3 | Osgi R7 | Bundle in Installed status | Community
Skip to main content
Radha_Krishna_N
Level 3
Mar 27, 2019 3:40 AM UTC
Solved

AEM 6.4.3 | Osgi R7 | Bundle in Installed status

Hi,

I created a project using maven archetype 17

mvn archetype:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=17 -P adobe-public

updated the pom to use OSGI R7 dependencies

<dependency>

   <groupId>org.osgi</groupId>

   <artifactId>osgi.core</artifactId>

   <version>7.0.0</version>

   <scope>provided</scope>

</dependency>

<dependency>

   <groupId>org.osgi</groupId>

   <artifactId>osgi.cmpn</artifactId>

   <version>7.0.0</version>

   <scope>provided</scope>

</dependency>

<dependency>

   <groupId>org.osgi</groupId>

   <artifactId>osgi.annotation</artifactId>

   <version>7.0.0</version>

   <scope>provided</scope>

</dependency>

Deployed to AEM 6.4.3 instance. But the bundle is in installed status due to

     org.osgi.service.event,version=[1.4,2.0) -- Cannot be resolved

SimpleResourceListener.java sample class is importing the interface org.osgi.service.event.EventHandler from org.osgi:osgi.cmpn:7.0.0 and this is not available in the felix container.

Could you please help me in resolving this issue?

Thanks,

Radha Krishna N

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Radha_Krishna_N
Radha_Krishna_NAccepted solution
Level 3
Mar 27, 2019 9:08 PM UTC

Thanks Arun for the clarification.

Below dependency order worked for me.

  1. <dependency> 
  2.     <groupId>org.apache.felix</groupId> 
  3.     <artifactId>org.apache.felix.eventadmin</artifactId> 
  4.     <version>1.4.10</version> 
  5.     <scope>provided</scope> 
  6. </dependency> 
  7. <dependency> 
  8.     <groupId>org.osgi</groupId> 
  9.     <artifactId>osgi.core</artifactId> 
  10.     <version>7.0.0</version> 
  11.     <scope>provided</scope> 
  12. </dependency> 
  13. <dependency> 
  14.     <groupId>org.osgi</groupId> 
  15.     <artifactId>osgi.cmpn</artifactId> 
  16.     <version>7.0.0</version> 
  17.     <scope>provided</scope> 
  18. </dependency> 
  19. <dependency> 
  20.     <groupId>org.osgi</groupId> 
  21.     <artifactId>osgi.annotation</artifactId> 
  22.     <version>7.0.0</version> 
  23.     <scope>provided</scope> 
  24. </dependency> 

9 replies

Radha_Krishna_N
Radha_Krishna_NAuthorAccepted solution
Level 3
Mar 27, 2019 9:08 PM UTC

Thanks Arun for the clarification.

Below dependency order worked for me.

  1. <dependency> 
  2.     <groupId>org.apache.felix</groupId> 
  3.     <artifactId>org.apache.felix.eventadmin</artifactId> 
  4.     <version>1.4.10</version> 
  5.     <scope>provided</scope> 
  6. </dependency> 
  7. <dependency> 
  8.     <groupId>org.osgi</groupId> 
  9.     <artifactId>osgi.core</artifactId> 
  10.     <version>7.0.0</version> 
  11.     <scope>provided</scope> 
  12. </dependency> 
  13. <dependency> 
  14.     <groupId>org.osgi</groupId> 
  15.     <artifactId>osgi.cmpn</artifactId> 
  16.     <version>7.0.0</version> 
  17.     <scope>provided</scope> 
  18. </dependency> 
  19. <dependency> 
  20.     <groupId>org.osgi</groupId> 
  21.     <artifactId>osgi.annotation</artifactId> 
  22.     <version>7.0.0</version> 
  23.     <scope>provided</scope> 
  24. </dependency> 
Translate
arunpatidar
New Participant
Mar 27, 2019 8:32 PM UTC

Hi,

1. The org.osgi.compendium imports the lower version of EventAdmin, that's fix the issue but

2. you should use org.apache.felix.eventadmin since other one is already upgraded as new version, so shouldn't use lower version lib.

3. Yes, org.osgi.compendium:5.0.0 and osgi.cmpn:7.0.0 are different versions of OSGi Compendium specification, so should be use osgi.cmpn:7.0.0

It is fine, you can use below dependencies in your project.

<artifactId>org.apache.felix.eventadmin</artifactId> 

<artifactId>osgi.cmpn</artifactId> 

Translate
Arun Patidar
Radha_Krishna_N
Level 3
Mar 27, 2019 7:52 PM UTC

Arun,

1. Placing the org.osgi.compendium dependency below did not work for me.

2. Which dependency should I be using org.osgi.compendium or org.apache.felix.eventadmin

3. org.osgi.compendium:5.0.0 and osgi.cmpn:7.0.0 are different versions of OSGi Compendium specification. Is this correct?

Thanks,

Radhakrishna N

Translate
arunpatidar
New Participant
Mar 27, 2019 6:07 PM UTC

Hi,

1. I have added org.osgi.compendium dependency at the end of Osgi dependency section, works for me.

2. Apache Felix Event Admin Service Specification, part of the OSGi Compendium specification, defines a general inter-bundle communication mechanism. The communication conforms to the popular publish/subscribe paradigm and can be performed in a synchronous or asysnchronous manner.

Translate
Arun Patidar
Radha_Krishna_N
Level 3
Mar 27, 2019 5:46 PM UTC

arunpatidar26​ after making changes to pom as below, bundle became active. I have org.apache.felix.eventadmin dependency before osgi.cmpn

<dependency>

    <groupId>org.apache.felix</groupId>

    <artifactId>org.apache.felix.eventadmin</artifactId>

    <version>1.4.10</version>

    <scope>provided</scope>

</dependency>

<dependency>

    <groupId>org.osgi</groupId>

    <artifactId>osgi.core</artifactId>

    <version>7.0.0</version>

    <scope>provided</scope>

</dependency>

<dependency>

    <groupId>org.osgi</groupId>

    <artifactId>osgi.cmpn</artifactId>

    <version>7.0.0</version>

    <scope>provided</scope>

</dependency>

<dependency>

    <groupId>org.osgi</groupId>

    <artifactId>osgi.annotation</artifactId>

    <version>7.0.0</version>

    <scope>provided</scope>

</dependency>

Also the dependency which you mentioned worked when I placed at the top. But aren't we dependent on 2 versions of the same artifact?

<dependency>

    <groupId>org.osgi</groupId>

    <artifactId>org.osgi.compendium</artifactId>

    <version>5.0.0</version>

    <scope>provided</scope>

</dependency>

<dependency>

    <groupId>org.osgi</groupId>

    <artifactId>osgi.core</artifactId>

    <version>7.0.0</version>

    <scope>provided</scope>

</dependency>

<dependency>

    <groupId>org.osgi</groupId>

    <artifactId>osgi.cmpn</artifactId>

    <version>7.0.0</version>

    <scope>provided</scope>

</dependency>

<dependency>

    <groupId>org.osgi</groupId>

    <artifactId>osgi.annotation</artifactId>

    <version>7.0.0</version>

    <scope>provided</scope>

</dependency>

Thanks,

Radha Krishna N

Translate
smacdonald2008
Level 10
Mar 27, 2019 4:07 PM UTC

For 6.4, why did you jump to 17?

Translate
arunpatidar
New Participant
Mar 27, 2019 3:20 PM UTC

Hi,

Add below dependency as well in parent and core pom

<dependency>

<groupId>org.osgi</groupId>

<artifactId>org.osgi.compendium</artifactId>

<version>5.0.0</version>

<scope>provided</scope>

</dependency>

Please check below?

OSGI R7 annotation

Translate
Arun Patidar
Radha_Krishna_N
Level 3
Mar 27, 2019 2:08 PM UTC

Hi Hemant,

Did you modify the pom to use osgi R7 dependencies as above?

It works for me also with AEM6.4.3+maven archetype 17 (no modification to pom file).

Thanks,

Radha Krishna N

Translate
Hemant_arora
Level 8
Mar 27, 2019 7:29 AM UTC

I am not able to reproduce the issue.

created project using archetype 17 and deploy successfully to 6.4.3

bundles are working fine.

Translate