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

SOLVED

Bundle - Cannot be resolved dependecies

demd43642519
Level 4
Level 4

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

1683757_pastedImage_0.png


What else can I do?

1 Accepted Solution
Gaurav-Behl
Correct answer by
Community Advisor
Community Advisor

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>

View solution in original post

0 Replies
Gaurav-Behl
Correct answer by
Community Advisor
Community Advisor

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>

View solution in original post

demd43642519
Level 4
Level 4

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.

Gaurav-Behl
Community Advisor
Community Advisor

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.

Gaurav-Behl
Community Advisor
Community Advisor

unzip the 'core' bundle of your package..