AEM 6.4.3 | Osgi R7 | Bundle in Installed status | Community
Skip to main content
Radha_Krishna_N
Level 3
March 27, 2019
Solved

AEM 6.4.3 | Osgi R7 | Bundle in Installed status

  • March 27, 2019
  • 9 replies
  • 5938 views

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.
Best answer by Radha_Krishna_N

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

Hemant_arora
Level 8
March 27, 2019

I am not able to reproduce the issue.

created project using archetype 17 and deploy successfully to 6.4.3

bundles are working fine.

Radha_Krishna_N
Level 3
March 27, 2019

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

arunpatidar
Community Advisor
Community Advisor
March 27, 2019

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

Arun Patidar
smacdonald2008
Level 10
March 27, 2019

For 6.4, why did you jump to 17?

Radha_Krishna_N
Level 3
March 27, 2019

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

arunpatidar
Community Advisor
Community Advisor
March 27, 2019

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.

Arun Patidar
Radha_Krishna_N
Level 3
March 27, 2019

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

arunpatidar
Community Advisor
Community Advisor
March 27, 2019

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> 

Arun Patidar
Radha_Krishna_N
Radha_Krishna_NAuthorAccepted solution
Level 3
March 27, 2019

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>