AEM 6.4 beta, Apache Sling JCR Resource Resolver not present | Community
Skip to main content
Level 2
Feb 1, 2018 6:10 PM UTC
Solved

AEM 6.4 beta, Apache Sling JCR Resource Resolver not present

Hi all

I'm trying to migrate an app so it works on AEM 6.4 beta, but I ran into the following problem:
When I install my bundle. I get the following error:

org.apache.sling.jcr.resource,version=[2.4,3) -- Cannot be resolved

Right now, I'm using version 2.9.2 of org.apache.sling.jcr.resource. Here's the pom dependency:

<dependency>

    <groupId>org.apache.sling</groupId>

    <artifactId>org.apache.sling.jcr.resource</artifactId>

    <version>2.9.2</version>

    <scope>provided</scope>

</dependency>

I checked in AEM's web console, and searched for that dependency using the dependency finder ( http://localhost:4502/system/console/depfinder ), and It turns out that package "org.apache.sling.jcr.resource" cannot be found in AEM 6.4 beta:

I checked in AEM 6.3, but I do get a result there:

It is because of this that I suspect that the problem is that this dependency is not present in AEM 6.4 beta. But still, I'm not an expert on dependencies so I'm not sure if this is the case, or if it's a problem on my project.


I'd appreciate if someone can point me in the right direction on this. Basically I want to check if the problem is related to AEM 6.4 beta dependencies.

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
AlthamAccepted solution
Level 3
Aug 27, 2018 10:36 PM UTC

Hi,

Actually these issues are due to changes in uber jar file i.e. interfaces and classes has been restructured in uber jar 6.4.

You can decompile uber jar and see the changes by yourself.

Taking an example of org.apache.sling.jcr.resource ....

org.apache.sling.jcr.resource.JcrResourceUtil is changed to com.day.cq.commons.jcr.JcrUtil

org.apache.sling.jcr.resource.JcrResourceConstants changed to org.apache.sling.jcr.resource.api.JcrResourceConstants

Links to figure out deprecated API's

https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/javadoc/deprecated-list.html

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/deprecated-list.html

25 replies

sindhug14537977
Level 2
Aug 28, 2018 8:34 PM UTC

atulj26424737​ Thanks! It worked.!

Translate
AlthamAccepted solution
Level 3
Aug 27, 2018 10:36 PM UTC

Hi,

Actually these issues are due to changes in uber jar file i.e. interfaces and classes has been restructured in uber jar 6.4.

You can decompile uber jar and see the changes by yourself.

Taking an example of org.apache.sling.jcr.resource ....

org.apache.sling.jcr.resource.JcrResourceUtil is changed to com.day.cq.commons.jcr.JcrUtil

org.apache.sling.jcr.resource.JcrResourceConstants changed to org.apache.sling.jcr.resource.api.JcrResourceConstants

Links to figure out deprecated API's

https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/javadoc/deprecated-list.html

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/deprecated-list.html

Translate
sindhug14537977
Level 2
Aug 27, 2018 10:22 PM UTC

i got the same issue while upgrading to 6.4.

is there a link to the above mentioned article.

Thanks!

Translate
smacdonald2008
Level 10
Apr 27, 2018 5:58 PM UTC

Been successful creating an HTL component that pulls data from the JCR using these APIs:

We will release this article next week.

This uses Maven Arch 13. UBER 6.4, a system user, Java code,  and HTL.

Translate
Level 3
Apr 27, 2018 4:28 PM UTC

Aaah, understood.

Translate
joerghoh
Employee
Apr 27, 2018 4:24 PM UTC

The compatibility package allows you to run your AEM 6.3 application unchanged (no recompilation required) on AEM 6.4. Therfor you should not update to the 6.4 uber.jar

Jörg

Translate
smacdonald2008
Level 10
Apr 27, 2018 4:19 PM UTC

We need a 6.4 article that uses this JAVA to pull data from the JCR and display in an HTL component:

Map<String, Object> param = new HashMap<String, Object>();

param.put(ResourceResolverFactory.SUBSERVICE, "datawrite");

ResourceResolver resolver = null;


try {

          

    //Invoke the adaptTo method to create a Session used to create a QueryManager

  resolver = resolverFactory.getServiceResourceResolver(param);

    session = resolver.adaptTo(Session.class);

Translate
Level 3
Apr 27, 2018 4:13 PM UTC

Thank you smacdonald2008 this information will definitely help.

I am facing this issue at package compilation time itself. (mvn clean install)

The compatibility package goes directly on the server through package manager, but I am not able to make my package ready & compatible with 6.4 after adding 6.4.0 uber jar in the pom.xml.

I am trying to follow this document.. Upgrading Code and Customizations

Translate
joerghoh
Employee
Apr 27, 2018 4:01 PM UTC

Check the documentation at Backward Compatibility in AEM 6.4​.

Jörg

Translate
smacdonald2008
Level 10
Apr 27, 2018 3:59 PM UTC

I will update a HELPX article to AEM 6.4 that uses this data type. I will post back results.

Translate