AEM Service pack 6.5.19 upgrade issues | Community
Skip to main content
Adobe Champion
January 5, 2024
Solved

AEM Service pack 6.5.19 upgrade issues

  • January 5, 2024
  • 4 replies
  • 9475 views

Hi ,

 

Just updating the post again on what all outstanding issues we have apart from the below one

1. Open SSO login is not working for us after SP19 upgrade.  - We are working with Adobe on this one

2. Our delete functionality is custom to move it to a recycle bin folder, this too not working due to some JavaScript issues. We are on this one too

These are the major ones

 

We are trying to upgrade our environment to SP19 and seeing lot of issues. Among it, one of it is while updating uber jar to 6.5.19 as below.

 

<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.5.19</version>
<classifier>apis-with-deprecations</classifier>
<scope>provided</scope>
</dependency>

 

We are using junit version as below

 

<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.4.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>

 

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.4.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>3.4.6</version>
<scope>test</scope>
</dependency>

 

The issue is that most of our test class where we use AEMContext

 

For eg:

 

Asset asset1 = context.create().asset("/content/dam/asset.jpg", new InputStream() {
@9944223
public int read() throws IOException {
return -1;
}
}, "image/jpg", ImmutableMap.<String, Object>builder()
.put("prism:expirationDate", "2020-03-25T11:51:00.000-04:00")
.put(com.day.cq.dam.api.DamConstants.DC_FORMAT, "image/jpeg")
.put(com.day.cq.dam.scene7.api.constants.Scene7Constants.PN_S7_FILE_AVS, "Asset-AVS")
.build()
);

 

 

This fails and the error is

java.lang.NoClassDefFoundError: org/apache/commons/io/build/AbstractStreamBuilder

Any thoughts here? Has anyone recently upgraded to SP19 and facing issues with test classes failing?

Also, is it mandatory to update the uber jar when we do Service pack updates?

 

 

Update:

 

We commented the problematic junit classes and did the deployment with uber jar update. Still SSO login issue and other SP19 issues are outstanding.

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by 22838leo

I also bumped into the "java.lang.NoClassDefFoundError: org/apache/commons/io/build/AbstractStreamBuilder" unit test error after upgrading to SP19.

I checked in the depfinder for org.apache.commons.io, bundle was found, Maven dependency on the right column:

<dependency> <artifactId>commons-io</artifactId> <version>2.13.0</version> <groupId>commons-io</groupId> <scope>provided</scope> </dependency>

Once I added this dependency to my parent pom.xml file, unit tests were no longer broken, all passed.

(I'm running into other issues but not related to unit tests).

4 replies

DPrakashRaj
Community Advisor
Community Advisor
January 6, 2024

You need to update the Uber jar dependency as <dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.5.19</version>
<scope>provided</scope>
</dependency>

now there is no classifier as explained on https://experienceleague.adobe.com/docs/experience-manager-65/content/release-notes/release-notes.html?lang=en

I haven’t upgraded to sp 19 but it seems mockito-core 3.4.6 version is very old. May be try to update the version of mockito and junit-bom to latest one. May I now the prior version from which you are upgrading to 6.5.19?

P_V_NairAdobe ChampionAuthor
Adobe Champion
January 6, 2024

Sure @dprakashraj Let me try that.

We are trying to upgrade from SP16 to SP19 now, since we have a thread lock issue for scene7 when multiple scene 7 threads are running in SP16 and Adobe advised the permanent hotfix for that is available only from SP19.

Level 3
January 11, 2024

@dprakashraj  I was able to progress a bit further with that error by creating a reflection class inside the class instead of using internal method as below, but still build is a failure and came back to original errors. Please find details below. We also opened a ticket with Adobe for the build issues after SP19

 

import java.lang.reflect.Field;

public class ReflectUtils {
private ReflectUtils() {}

public static void setField(Object object, String fieldName, Object value) {
try {
Field field = object.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
field.set(object, value);
} catch (NoSuchFieldException | IllegalAccessException e) {
throw new RuntimeException("Failed to set " + fieldName + " of object", e);
}
}

public static void setField(Object object, Field fld, Object value) {
try {
fld.setAccessible(true);
fld.set(object, value);
} catch (IllegalAccessException e) {
String fieldName = null == fld ? "n/a" : fld.getName();
throw new RuntimeException("Failed to set " + fieldName + " of object", e);
}
}

}

 

 

But, no luck at all. After this fix, build ran and it did some progress and now flags all the  test classes which was failing and with the same error

 

java.lang.NoClassDefFoundError: org/apache/commons/io/build/AbstractStreamBuilder

 

Currently i use mockito 4.9.0 and junit-bom 5.10.1

 

 


@p_v_nair before you try below steps make sure to have proper back up.

 

1. Have tried removing the jar frm .m2 folder?

2. Are you getting class not found error in buiild or after deployment?

3. Have you tried removing the old jars from system console and try to install the package with new versions?

4. Have you updated the wcm core bundle version to latest?

5. Have you tried updating the Apache Commons IOorg.apache.commons.commons-io version or restarting the bundle in system console.

 

Thanks!

aanchal-sikka
Community Advisor
Community Advisor
January 6, 2024

@p_v_nair 

 

Recommendation is to update the uber jar corresponding to the AEM version + SP.

This assure we are using the latest features and fixes

 

You might want to consider updating versions of all dependencies. All of them seem to be pretty old versions.

Aanchal Sikka
kautuk_sahni
Community Manager
Community Manager
January 8, 2024

@p_v_nair  Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni
P_V_NairAdobe ChampionAuthor
Adobe Champion
January 8, 2024

@kautuk_sahni  I have updated the reply to @dprakashraj . Unfortunately, build issue is still not fixed.

Level 3
January 9, 2024

@p_v_nair have you tried upgrading the dependencies to latest version ?

 

<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.10.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>

 

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>5.8.0</version>
<scope>test</scope>
</dependency>

 

Also before you upgrade make sure old versions are removed in system/console/bundles, try removing the jars and installing the package again. 

 

Thank you!!

P_V_NairAdobe ChampionAuthor
Adobe Champion
January 9, 2024

@teja_g  If you have been following my above comments. That didn't work and also mockito 5.0.0 and above will noy work for java 8

New Member
January 11, 2024

Did we try to explicitly download the dependency bundle which is throwing NoClassDefFoundError, include it as part of META-INF and then rerun the entire build to see if error goes away. 

 

Maven Repository: org.apache.commons » commons-io » 1.3.2 (mvnrepository.com)

 

Can you please let me know which version of dependency are we trying to import for java.lang.NoClassDefFoundError: org/apache/commons/io/build/AbstractStreamBuilder ?

 

I am assuming this is the error you are still getting right?