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
BedrockMission!

Learn More

View all

Sign in to view all badges

Two bundles looking for same package, but different versions

Avatar

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Srinin
Level 2

30-03-2017

Hi,

I have this ERROR:

org.osgi.framework.BundleException: Uses constraint violation. Unable to resolve bundle revision com.sample.test-wcm-bundle [397.825] because it is exposed to package 'org.apache.commons.lang.math' from bundle revisions com.sample.test-wcm-dependencies-bundle [398.824] and com.day.commons.osgi.wrapper.commons-lang2 [45.0] via two dependency chains.

com.day.commons.osgi.wrapper.commons-lang2 has commons-lang version 2.5, 

My bundle com.sample.test-wcm-dependencies-bundle needs commons-lang version 2.6.

How to resolve this?

thanks

Srini 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,113 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,113 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

04-04-2017

Hi,

the sample works here on AEM 6.2, the april-project bundle ist active.

Jörg

Answers (11)

Answers (11)

Avatar

Avatar
Level 1
ethomasjoseph
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
ethomasjoseph
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
ethomasjoseph
Level 1

03-04-2017

Hi Srini,

It is bit difficult to visualise the actual dependency and the error. But try packaging your code bundle and dependencies as one bundle instead of two.

The problem here could be that when a bundle with second level dependencies which vary in version is installed, only the bundle itself is tried for a rewiring. When you restart the instance, all the bundles in the system are taken into account and attempted for a dependency rewiring.

Even in your current setup, just hit "Refresh Packages" in the Felix Console and your issue should be resolved.

HTH,

Thomas

Avatar

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Srinin
Level 2

03-04-2017

Hello,

I am still these issues. I created a sample project here [1]. If you could import this project to Eclipse and build to your local, you can understand the issues I am facing. 

[1] https://github.com/nsrini/april-project

If you build to your local AEM, you could see that sideadmin won't respond and errors in the error.log. If anyone could resolve the errors by adjusting the pom files, I really appreciate. I use AEM 6.0 SP2.

Please let me know if you have any questions.

thanks

Srini

Avatar

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Srinin
Level 2

02-04-2017

Jörg,

I almost did like that only. I have a dependencies  bundle with all the 3rd party dependencies. 

My concerns are: The version conflict I talked about, is not there if I restart the author instance. But If I do the build, the version conflict issues comes back.Why?

Thanks

Srini

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,113 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,113 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

02-04-2017

Can you be more specific regarding the AWS bundle?

The typical approach for this would be to wrap the AWS bundle plus its dependencies into a custom bundle, which has not other external dependency.

Jörg

Avatar

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Srinin
Level 2

02-04-2017

Hi MC,

Here are more details:

My code uses package X (AWS - 3rd party package) uses org.apache.commons.lang 2.6.0
My code uses package Y (Adobe - 3rd party package) uses org.apache.commons.lang 2.4

I can't adjust versions in either bundle X or Y. Is there anything I can do in my pom files. 

Excluding package import doesn't help.

Avatar

Avatar
Validate 1
Level 8
MC_Stuff
Level 8

Likes

78 likes

Total Posts

467 posts

Correct Reply

158 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 8
MC_Stuff
Level 8

Likes

78 likes

Total Posts

467 posts

Correct Reply

158 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
MC_Stuff
Level 8

31-03-2017

Hi Srini,

On your custom bundle embed the commons-lang version 2.6.  and exclude it to expose api.

Thanks,

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

31-03-2017

When i first read that - i thought you were pointing to a wrong version that could be corrected by referencing the correct version in the MF file.

Lets take a step back. How are you building the bundle? Are you using Maven 10 Archetype and Urber 6.2?  

Avatar

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Srinin
Level 2

31-03-2017

Hi Scott,

I am Sorry for the confusion. Here is the actual error. This com.day.cq.commons is using the old version. And this refers cq-commons-5.7.14.jar. I need to change the version Manifest of this file.

Chain 1:
  com.mynews.my-wcm-bundle [397.825]
    import: (&(osgi.wiring.package=org.apache.commons.lang.math)(version>=2.6.0)(!(version>=3.0.0)))
     |
    export: osgi.wiring.package=org.apache.commons.lang.math
  com.mynews.my-wcm-dependencies-bundle [398.824]

Chain 2:
  com.mynews.my-wcm-bundle [397.825]
    import: (osgi.wiring.package=com.day.cq.security)
     |
    export: osgi.wiring.package=com.day.cq.security; uses:=com.day.cq.commons
  com.day.cq.cq-security-api [468.0]
    import: (osgi.wiring.package=com.day.cq.commons)
     |
    export: osgi.wiring.package=com.day.cq.commons; uses:=org.apache.commons.lang.time
  com.day.cq.cq-commons [424.0]
    import: (&(osgi.wiring.package=org.apache.commons.lang.time)(version>=2.4.0)(!(version>=3.0.0)))
     |
    export: osgi.wiring.package=org.apache.commons.lang.time; uses:=org.apache.commons.lang.math
    export: osgi.wiring.package=org.apache.commons.lang.math
  com.day.commons.osgi.wrapper.commons-lang2 [45.0]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3986)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2043)
        at org.apache.felix.framework.Felix$RefreshHelper.restart(Felix.java:4861)
        at org.apache.felix.framework.Felix.refreshPackages(Felix.java:4128)
        at org.apache.felix.framework.FrameworkWiringImpl.run(FrameworkWiringImpl.java:178)
        at java.lang.Thread.run(Thread.java:745)

Avatar

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 2
Srinin
Level 2

Like

1 like

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Srinin
Level 2

31-03-2017

Hi Scott,

Thanks for your reply. Here we have two bundles, which bundle you were talking about?

com.day.commons.osgi.wrapper.commons-lang2 OR  com.sample.test-wcm-dependencies-bundle ?

com.sample.test-wcm-dependencies-bundle generates every time I do the build. So we can't change Manifest every time here.

So, I think, you were referring this com.day.commons.osgi.wrapper.commons-lang2.

thanks

Srini

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

31-03-2017

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

31-03-2017

All you need to do is open the bundle and modify the Manifest file to point to the correct version of a specific package.