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
Solved! Go to Solution.
Thanks Arun for the clarification.
Below dependency order worked for me.
I am not able to reproduce the issue.
created project using archetype 17 and deploy successfully to 6.4.3
bundles are working fine.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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?
Views
Replies
Total Likes
For 6.4, why did you jump to 17?
Views
Replies
Total Likes
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
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,
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
Views
Replies
Total Likes
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>
Thanks Arun for the clarification.
Below dependency order worked for me.