AEM 6.2: Exception when using foundation components in responsivegrid

daniel_strmecki

17-10-2016

I get a class not found for ValueMap when adding a foundation component to responsivegrid. My custom components however work fine and all Sling bundles are activated. Any ideas whats wrong?

 

17.10.2016 13:28:26.103 *ERROR* [0:0:0:0:0:0:0:1 [1476703706098] GET /content/sample2/en/home/jcr:content/root/responsivegrid/columns_2/par_col2_1/text.html HTTP/1.1] org.apache.sling.scripting.javascript.wrapper.ScriptableResource Unable to adapt object.
java.lang.ClassNotFoundException: [JavaPackage org.apache.sling.api.resource.ValueMap]
    at org.apache.sling.commons.classloader.impl.ClassLoaderFacade.loadClass(ClassLoaderFacade.java:149)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.apache.sling.scripting.javascript.wrapper.ScriptableResource.jsFunction_adaptTo(ScriptableResource.java:298)
    at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
    at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:387)...

Answers (13)

Answers (13)

benjamin_cheria

04-10-2017

I ran into this issue today using AEM 6.3 with Oak 1.6.3. Resolved it by running offline compaction. Not sure why this happened. I had added some package dependencies and then removed them before the issue started.

smacdonald2008

25-07-2018

As I mentioned earlier - best to talk to support via a ticket. Most of the community is on newer AEM versions and using HTL/Core components vs Foundation components.

FredrickDominy

03-02-2018

I had the same exception crop up mysteriously too. It bugged our dev server but locally everything was fine.  The problem was resolved by hitting the Refresh Packages button in /system/console/configMgr

SDharmaraj

01-02-2018

Thanks benjamin.cherian . I also faced the same issue and i did Offline compaction , the issue resolved. This issue started after installing SP1 & CFP1 on top of AEM6.3.

shajiahmed

04-04-2017

I do see the same issue when using sightly image component. This works fine in my localhost and our dev environment.

We are seeing this issue in QA environment only, however our environments are exact replica of one another.

daniel_strmecki

19-10-2016

Tried it on a new AEM 6.2 instance and the same exception occurs with Adobe Archetype 10 when using wcm/foundation/components/parsys and adding a component with a supertype e.g. wcm/foundation/components/text.

Is it possible that Archetype 10 is missing some dependency for HTL components?

 

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="cq:Component" sling:resourceSuperType="wcm/foundation/components/text" jcr:title="Title" componentGroup="sample2-main"/>

 

<dependencyManagement> <dependencies> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-atinject_1.0_spec</artifactId> <version>1.0</version> <scope>provided</scope> </dependency> <!-- OSGi Dependencies --> <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.scr</artifactId> <version>1.6.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.scr.annotations</artifactId> <version>1.9.6</version> <scope>provided</scope> </dependency> <dependency> <groupId>biz.aQute</groupId> <artifactId>bndlib</artifactId> <version>1.50.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.core</artifactId> <version>4.2.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.compendium</artifactId> <version>4.2.0</version> <scope>provided</scope> </dependency> <!-- Logging Dependencies --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.5.11</version> <scope>provided</scope> </dependency> <!-- Apache Sling Dependencies --> <dependency> <groupId>com.adobe.aem</groupId> <artifactId>aem-api</artifactId> <version>6.0.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.models.api</artifactId> <version>1.0.0</version> <scope>provided</scope> </dependency> <!-- Servlet API --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.1</version> <scope>provided</scope> </dependency> <!-- JCR --> <dependency> <groupId>javax.jcr</groupId> <artifactId>jcr</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> <!-- Taglibs --> <dependency> <groupId>com.day.cq.wcm</groupId> <artifactId>cq-wcm-taglib</artifactId> <version>5.7.4</version> <scope>provided</scope> </dependency> <!-- Testing --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <scope>test</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.5.11</version> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>1.9.5</version> <scope>test</scope> </dependency> <dependency> <groupId>junit-addons</groupId> <artifactId>junit-addons</artifactId> <version>1.4</version> <scope>test</scope> </dependency> </dependencies> </dependencyManagement>

 

Daniel