Bundle - Cannot be resolved dependecies | Community
Skip to main content
Level 4
Feb 4, 2019 9:12 AM UTC
Solved

Bundle - Cannot be resolved dependecies

I'm dealing with these errors in my bundle.

I'm on aem 6.4

I've done the following:

  1. Checked the IDE for any errors before the deploy
  2. Changed the Core Bundle version
  3. Updated those dependencies with a newer version
  4. Right click on root POM -> Maven - > Generate Sources and Update Folders


What else can I do?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Feb 4, 2019 1:46 PM UTC

Your bundle requires "commons.net" version to be from 3.3-4 (exclusive) but AEM/Felix is unable to provide the same version. Hence, include "commons.net" bundle with either version from 3.3-4 and package it within your source code bundle. You may check if the same bundle is available in Felix with a different version or not?

Alternatively, if you don't need this bundle then add "!org.apache.commons.net.util" in the <Import-Package> of <maven-bundle-plugin>

Similar approach goes for "commons-validator". Provide either version from 1.6 to 2 or otherwise, block this dependency to be included in your import statements as applicable.

Maven Repository: commons-net » commons-net

Maven Repository: commons-validator » commons-validator

OR   // based on your use case

<groupId>org.apache.felix</groupId>

<artifactId>maven-bundle-plugin</artifactId>

<extensions>true</extensions>

<configuration>

<instructions>

<Import-Package>!org.apache.comons.net.util,!org.apache.commons.validator.routines,*</Import-Package>

</instructions>

</configuration>

5 replies

Gaurav-Behl
Level 10
Feb 4, 2019 11:50 PM UTC

unzip the 'core' bundle of your package..

Translate
Level 4
Feb 4, 2019 9:06 PM UTC

Do I need to unzip them?

Translate
Gaurav-Behl
Level 10
Feb 4, 2019 8:56 PM UTC

That's for compile time dependencies

Are these jars being packaged inside your code bundle to be available in Felix when your bundle is activated? You may unzip your bundle and validate.

Translate
Level 4
Feb 4, 2019 8:49 PM UTC

I'm using the following dependencies: a~

<dependency>
  <groupId>commons-validator</groupId>
  <artifactId>commons-validator</artifactId>
  <version>1.6</version>
</dependency>
<dependency>
  <groupId>commons-net</groupId>
  <artifactId>commons-net</artifactId>
  <version>3.3</version>
</dependency>

And the following import statements:

import org.apache.commons.validator.routines.EmailValidator;

import org.apache.commons.net.util.SubnetUtils;

I don't see what is wrong with these.

Translate
Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Feb 4, 2019 1:46 PM UTC

Your bundle requires "commons.net" version to be from 3.3-4 (exclusive) but AEM/Felix is unable to provide the same version. Hence, include "commons.net" bundle with either version from 3.3-4 and package it within your source code bundle. You may check if the same bundle is available in Felix with a different version or not?

Alternatively, if you don't need this bundle then add "!org.apache.commons.net.util" in the <Import-Package> of <maven-bundle-plugin>

Similar approach goes for "commons-validator". Provide either version from 1.6 to 2 or otherwise, block this dependency to be included in your import statements as applicable.

Maven Repository: commons-net » commons-net

Maven Repository: commons-validator » commons-validator

OR   // based on your use case

<groupId>org.apache.felix</groupId>

<artifactId>maven-bundle-plugin</artifactId>

<extensions>true</extensions>

<configuration>

<instructions>

<Import-Package>!org.apache.comons.net.util,!org.apache.commons.validator.routines,*</Import-Package>

</instructions>

</configuration>

Translate