Hi All,
We are using latest version of cq-personalization jar available in repository (http://repo.adobe.com/nexus/content/groups/public) in our custom bundle which is working fine till AEM 6.1. Now we are migrating to AEM 6.3, and there we are getting error as "java.lang.NoClassDefFoundError: com/day/cq/personalization/UserPropertiesUtil". In AEM 6.3 web-console, the version of cq-personalization jar used by default is 5.10.60, which is not available to download from maven repo. Did anyone faced similar issue. Please advice.
Thanks in advance.
Anusha
Solved! Go to Solution.
Views
Replies
Total Likes
Issue has been resolved by removing the explicit maven dependency included for “cq-personalization” jar from pom.xml.
Views
Replies
Total Likes
Personalization is different in AEM 6.3 then 6.1.
In AEM 6.3 - you can use ContextHUb or AEM and Adobe Target. See these links:
Using the Adobe Experience Manager ContextHub to work with Personal Experiences
Working with Experience Fragments and the Experience Manager ContextHub
Creating Personal Experiences using Experience Manager and Adobe Target
Views
Replies
Total Likes
This should be part of the AEM Uber JAR - when using the Uber JAR - you only put the UBER dependency.
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.3.0</version>
<classifier>obfuscated-apis</classifier>
<scope>provided</scope>
</dependency>
Views
Replies
Total Likes
I tested and this works and does not throw an error:
Follow this article to learn how to work with AEM 6.3 UBER
Creating an Adobe Experience Manager 6.3 Project using Adobe Maven Archetype 11
Then in the Sling Model class - you can test this class with this code:
import javax.annotation.PostConstruct;
import com.day.cq.personalization.UserPropertiesUtil;
import javax.inject.Inject;
import javax.inject.Named;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Default;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.settings.SlingSettingsService;
@Model(adaptables=Resource.class)
public class HelloWorldModel {
@Inject
private SlingSettingsService settings;
@Inject @Named("sling:resourceType") @Default(values="No resourceType")
protected String resourceType;
private String message;
@PostConstruct
protected void init() {
UserPropertiesUtil pi = new UserPropertiesUtil();
message = "\tHello World!\n";
message += "\tThis is instance: " + settings.getSlingId() + "\n";
message += "\tClass is " + pi.getClass() + "\n";
}
public String getMessage() {
return message;
}
}
Views
Replies
Total Likes
Hi Scott,
Thanks for the reply. I have added the dependency as given, but I am not able to build my bundle with "uber-jar-6.3.0-obfuscated-apis.jar". Getting below exception. I am using JDK version 1.8
Caused by: org.apache.maven.plugin.PluginContainerException: An API incompatibility was encountered while executing org.apache.felix:maven-scr-plugin:1.7.4:scr: java.lang.VerifyError: Constructor must call super() or this() before return
Exception Details:
Location:
com/adobe/cq/sightly/WCMUsePojo.<init>()V @1: return
Reason:
Error exists in the bytecode
Bytecode:
0x0000000: 2ab1
Earlier I was using below given maven dependency,
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.3.0</version>
<classifier>apis</classifier>
<scope>provided</scope>
</dependency>
and I was able to build the bundle, but getting "java.lang.NoClassDefFoundError:com/day/cq/personalization/UserPropertiesUtil"
Views
Replies
Total Likes
Issue has been resolved by removing the explicit maven dependency included for “cq-personalization” jar from pom.xml.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies