Hi All,
After upgrading AEM 6.5 to Service Pack 6.5.23, one of our bundles is showing multiple OSGi import errors under /system/console/bundles.
The affected bundle:
Project – Google Captcha (.......platform. Captcha)
In the bundle status, I see many packages marked in red:
Cannot be resolved but is not required
Imported Packages:
com.google.appengine.api.datastore -- Cannot be resolved but is not required
com.google.appengine.api.memcache -- Cannot be resolved but is not required
com.google.appengine.api.urlfetch -- Cannot be resolved but is not required
com.google.auth from ...platform.captcha (598)
com.google.protobuf.nano -- Cannot be resolved but is not required
com.jcraft.jzlib -- Cannot be resolved but is not required
com.ning.compress -- Cannot be resolved but is not required
com.ning.compress.lzf -- Cannot be resolved but is not required
com.ning.compress.lzf.util -- Cannot be resolved but is not required
com.oracle.svm.core.annotate -- Cannot be resolved but is not required
lzma.sdk -- Cannot be resolved but is not required
lzma.sdk.lzma -- Cannot be resolved but is not required
net.jpountz.lz4 -- Cannot be resolved but is not required
net.jpountz.xxhash -- Cannot be resolved but is not required
org.apache.avalon.framework.logger -- Cannot be resolved but is not required
org.apache.log -- Cannot be resolved but is not required
org.bouncycastle.asn1.x500 -- Cannot be resolved but is not required
org.bouncycastle.cert -- Cannot be resolved but is not required
org.bouncycastle.cert.jcajce -- Cannot be resolved but is not required
org.bouncycastle.jce.provider -- Cannot be resolved but is not required
org.bouncycastle.operator -- Cannot be resolved but is not required
org.bouncycastle.operator.jcajce -- Cannot be resolved but is not required
org.eclipse.jetty.alpn -- Cannot be resolved but is not required
org.eclipse.jetty.npn -- Cannot be resolved but is not required
reactor.blockhound -- Cannot be resolved but is not required
reactor.blockhound.integration -- Cannot be resolved but is not required
sun.misc -- Cannot be resolved but is not required and overwritten by Boot Delegation
sun.security.x509 -- Cannot be resolved but is not required and overwritten by Boot Delegation
Any help or recommended approach would be greatly appreciated.
Regards,
Nagendra
Views
Replies
Total Likes
The good news is that most of these are marked as "Cannot be resolved but is not required" - meaning they're optional dependencies that won't prevent your bundle from functioning. Check if your reCAPTCHA functionality is actually working despite these warnings, your bundle may be functioning perfectly fine... of course, test your CAPTCHA implementation to confirm.
Then you can modify your bundle's pom.xml to mark these imports as optional explicitly:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Import-Package>
com.google.appengine.api.datastore;resolution:=optional,
com.google.appengine.api.memcache;resolution:=optional,
com.google.appengine.api.urlfetch;resolution:=optional,
com.google.protobuf.nano;resolution:=optional,
*
</Import-Package>
<Embed-Dependency>
google-api-client,
google-http-client,
google-http-client-jackson2;
inline=true
</Embed-Dependency>
<Import-Package>
!com.google.appengine.*,
!com.google.protobuf.nano,
*
</Import-Package>
</instructions>
</configuration>
</plugin>The !com.google.appengine.* syntax explicitly excludes these packages from import requirements.
On the other hand, if during testing the reCAPTCHA functionality isn't working as expected and you need to embed any of those google packages you can have a look at here: maven-bundle-plugin or bnd-maven-plugin
Views
Replies
Total Likes
Thanks for the prompt response!
After applying your suggestions, the warnings “Cannot be resolved but is not required” are no longer appearing - so that part is resolved.
However, the bundle is still stuck in the Installed state instead of Active.
Views
Replies
Total Likes
In /system/console/bundles, click your Google Captcha bundle and check the Imported Packages section again; anything that shows just “Cannot be resolved” (without “but is not required”) is still blocking activation.Also check if any other bundles are in “Installed” or “Resolved” with unsatisfied imports (they may be the providers you expect for your Captcha bundle, for example a wrapped Google client or shared API bundle).
Maybe a library that used to be exported by another bundle is no longer present or has a different version after installing 6.5.23, so your bundle’s Import-Package range no longer matches.
For each remaining “Cannot be resolved” import, either:
Install a bundle that exports that package (for third‑party JARs, wrap or embed them as proper OSGi bundles), or
Relax/fix the version range or mark it as optional in your maven-bundle-plugin configuration if your code does not truly depend on it at runtime.
Views
Replies
Total Likes
Hi @giuseppebaglio
Thanks for your response.
Views
Replies
Total Likes