Expand my Community achievements bar.

Migration from AEM 6.3 to 6.5 package issues

Avatar

Level 4

We are upgrading from AEM 6.3 to 6.5 and as it currently stands, there are issues starting bundles because of dependencies. The frustration is that it starts with just a couple then as those packages are added to the bundle, more dependencies are found.

What is the best way to deal with this? 

 

For instance, they were using the com.thoughtworks.xstream.XStream class which causes a dependency issue with org.jdom. If I add the org.jdom package, then that opens up a bunch more dependency problems. Some of the libraries aren't available in our repository. It seems that the more packages I add, even more dependency issues pop instead of removing them.

9 Replies

Avatar

Level 4

Since we don't have a cloud account, that link isn't very helpful. I'll have to see if I can open a ticket for access.

Avatar

Community Advisor

When you look maven repo for those dependent jars at https://mvnrepository.com/artifact/org.jdom/jdom/2.0.2 you can look for the compile dependencies and check idle your aem or your Pom are using same version or different version

Avatar

Level 4

I have done that. When I add the org.jdom version shown to be missing, then there are about 10 more dependencies that show up that aren't in the maven repo.

Avatar

Community Advisor

Hi @RobertHarperFS,

There are inner dependencies that gets added as Import packages and causes bundle to be in Installed state. You can neglect those dependencies and try testing your functionality which is using third party dependency if all is working fine once bundle is active. 

You can neglect such packages by using "!" and add resolution=optional to avoid failure.

example : 

Import-Package: javax.annotation;version=0.0.0,!org.xyz,*;resolution=optional

Sachin_Arora__0-1685257752200.png

https://bnd.bndtools.org/chapters/920-faq.html

 

 

Avatar

Level 4

How can this be marked as a solution when it hasn't even been tested?

 

First, the missing dependencies are causing my bundles not to start. I highly doubt that simply ignoring them will allow the bundles to start because several classes in my bundle are using these libraries for key functionality.

 

Second, I find it very frustrating that answers get marked as being the solution when I haven't checked them out and I'm sure this won't solve my problem.

Avatar

Level 4

I added the libraries that were not loading with the resolution:=optional setting. It did remove the error in the bundle but the bundle still will not start because of the missing dependencies.

This really didn't resolve anything in the end.

Avatar

Community Advisor

Hello @RobertHarperFS 

 

We should try following order:

1. Update the versions of all the bundles which are currently declared in pom.xml (including uber jar).

2. For the dependencies available as bundles in maven, deploy them by embedding via all package.

3. For the dependencies available as jar only, you can use wither of the following approaches: 

- use bnd tool/eclipse to convert it to bundle

- embed jars via pom.xml

- Embed Third party dependency using bnd-maven-plugin

 

https://myaemlearnings.blogspot.com/2021/12/embed-third-party-dependency-using-bnd.html


Aanchal Sikka

Avatar

Level 4

I have been adding them to the POM file but resolving one missing dependency only exposes even more that that library links to. The problem even grows where one leads to many more and many of them I don't have the library to add to the imported packages.