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