Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Cannot start bundle, missing requirement [479.0] osgi.wiring.package; (osgi.wiring.package=com.day.cq.commons.mail)

Avatar

Level 3

Hi,

I have created a bundle to send email using CQ Mailer, but my bundle cannot start, the error message I have found on the log:

05.05.2016 11:18:43.875 *ERROR* [FelixStartLevel] ERROR: Error starting inputstream:nypbundle-bundle-1.0-SNAPSHOT.jar
(org.osgi.framework.BundleException: Unresolved constraint in bundle com.dsa.nyp.nypbundle-bundle [479]: Unable to resolve 479.0:
missing requirement [479.0] osgi.wiring.package; (osgi.wiring.package=com.day.cq.commons.mail))
org.osgi.framework.BundleException: Unresolved constraint in bundle com.dsa.nyp.
nypbundle-bundle [479]: Unable to resolve 479.0: missing requirement [479.0] osg
i.wiring.package; (osgi.wiring.package=com.day.cq.commons.mail)
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4095)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2114)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1368)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.lang.Thread.run(Thread.java:745)

I have checked this CQ common bundle, it is started and activate. May I know what could be the cause of this error? 

I am using AEM 6.1 Service Pack 1.

Thanks.

0 Replies

Avatar

Level 10

I have created a bundle to send email using CQ Mailer

Send me source files for the OSGi bundle at scottm@adobe.com. I need to look at this code to identify what is wrong - you are missing something - either a wrong depedencies or outdates API call.

Avatar

Community Advisor

what is the version you have mentioned in you pom.xml ?

Avatar

Level 3
Here are the dependencies I have used in the pom file. <dependencies> <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.compendium</artifactId> </dependency> <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.core</artifactId> </dependency> <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.scr.annotations</artifactId> </dependency> <dependency> <groupId>biz.aQute</groupId> <artifactId>bndlib</artifactId> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> </dependency> <dependency> <groupId>javax.jcr</groupId> <artifactId>jcr</artifactId> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.api</artifactId> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.jcr.api</artifactId> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>com.day.cq</groupId> <artifactId>cq-mailer</artifactId> <version>5.6.4</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4.1</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-email</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>com.day.cq</groupId> <artifactId>cq-commons</artifactId> <version>5.6.4</version> <scope>provided</scope> </dependency> </dependencies>

Avatar

Level 10

I got your bundle into Active State - I sent you the code via email:

Hope this helps

Avatar

Level 3
Hi Scott,
 
I think there are still have problem on this bundle. Here is the scenario I have tried on my AEM 6.1 Service Pack 1.
 
1) Install a clean AEM 6.1
2) Install Service Pack 1
3) Upload the the bundle to install and start the bundle, it works fine now.
4) Upload the same bundle again, then start the bundle, still ok.
5) Shutdown the server, and restart it. I will see the error on the console:

06.05.2016 13:41:36.960 *ERROR* [FelixStartLevel] ERROR: Error starting inputstr
eam:fcibasics-bundle-1.0-SNAPSHOT.jar (org.osgi.framework.BundleException: Unres
olved constraint in bundle com.fci.amphenol.fcibasics-bundle [470]: Unable to re
solve 470.1: missing requirement [470.1] osgi.wiring.package; (&(osgi.wiring.pac
kage=com.day.cq.commons.mail)(version>=5.6.0)(!(version>=6.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle com.fci.amph
enol.fcibasics-bundle [470]: Unable to resolve 470.1: missing requirement [470.1
] osgi.wiring.package; (&(osgi.wiring.package=com.day.cq.commons.mail)(version>=
5.6.0)(!(version>=6.0.0)))
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:409
5)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2114)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1368)

        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart
LevelImpl.java:308)
        at java.lang.Thread.run(Thread.java:745)
 

6) There will be no way to start that bundle anymore...

Avatar

Community Advisor

Just remove the version and just say <scope>provided</scope>. See if this helps !

  1. <dependency>
  2. <groupId>com.day.cq</groupId>
  3. <artifactId>cq-commons</artifactId>
  4. <scope>provided</scope>
  5. </dependency>

Avatar

Level 3

bsloki wrote...

Just remove the version and just say <scope>provided</scope>. See if this helps !

  1. <dependency>
  2. <groupId>com.day.cq</groupId>
  3. <artifactId>cq-commons</artifactId>
  4. <scope>provided</scope>
  5. </dependency>

 

Sorry, the version cannot be removed, the maven build will fail if I remove it.