Expand my Community achievements bar.

SOLVED

AEM enterprise manager, AMS not cloud. I had to restart custom bundle in order to author pages.

Avatar

Level 7

 

hi folks,

I had to manually restart my custom bundle on the UAT Author instance. (It was in INSTALLED state)

(This was after a deployment and some restarts of the server.)

However, I didn't have this problem with other environments with the same code.

 

After that I was able to Author a page as usual.

Any ideas what caused this?

 

I found the following log error message that might be relevant.

 

 

thanks

Fiona

 

 

 

 


03.06.2025 08:28:09.919 *ERROR* [10.44.31.103 [1748939286758] GET /content/xxx/homepage.html HTTP/1.1] com.day.cq.wcm.core.impl.WCMDeveloperModeFilter Error during include of SlingRequestPathInfo: path='/content/xxxx/homepage/jcr:content', selectorString='null', extension='html', suffix='null'
org.apache.sling.scripting.sightly.SightlyException: Compilation errors in org/apache/sling/scripting/sightly/apps/xxx/components/page/basepage/basepage__002e__html.java:
Line 40, column 1811 : com.xxx.use.xxxxUse cannot be resolved to a type
at org.apache.sling.scripting.sightly.impl.engine.compiled.SlingHTLMasterCompiler.compileSource(SlingHTLMasterCompiler.java:356) [org.apache.sling.scripting.sightly:1.4.24.140]
at org.apache.sling.scripting.sightly.impl.engine.compiled.SlingHTLMasterCompiler.compileHTLScript(SlingHTLMasterCompiler.java:255) [org.apache.sling.scripting.sightly:1.4.24.140]
at org.apache.sling.scripting.sightly.impl.engine.SightlyScriptEngine.compile(SightlyScriptEngine.java:66) [org.apache.sling.scripting.sightly:1.4.24.140]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386) [org.apache.sling.scripting.core:2.4.8]

1 Accepted Solution

Avatar

Correct answer by
Level 9

hi @fionas76543059

your issue indicates that the HTL (Sightly) script is referencing a Java Use-API class that the Sling scripting engine cannot find or load at runtime.

The reason this issue occurs only in UAT/Prod environments and not in Dev/QA I'm unclear. Here are some possible explanations:

  • bundle resolution and classloading issues: the custom bundle containing com.xxx.use.xxxxuse is not active or fully resolved when the HTL engine tries to compile the script. this causes the compilation error and the bundle stays in installed state.

  • dependency or version mismatch: your custom bundle may depend on other bundles or core AEM bundles that are different versions or missing in UAT/prod.

  • class visibility: the package com.xxx.use might not be exported properly in the bundle's export-package or the bundle is not correctly deployed.

 

View solution in original post

3 Replies

Avatar

Correct answer by
Level 9

hi @fionas76543059

your issue indicates that the HTL (Sightly) script is referencing a Java Use-API class that the Sling scripting engine cannot find or load at runtime.

The reason this issue occurs only in UAT/Prod environments and not in Dev/QA I'm unclear. Here are some possible explanations:

  • bundle resolution and classloading issues: the custom bundle containing com.xxx.use.xxxxuse is not active or fully resolved when the HTL engine tries to compile the script. this causes the compilation error and the bundle stays in installed state.

  • dependency or version mismatch: your custom bundle may depend on other bundles or core AEM bundles that are different versions or missing in UAT/prod.

  • class visibility: the package com.xxx.use might not be exported properly in the bundle's export-package or the bundle is not correctly deployed.

 

Avatar

Community Advisor

Hi @fionas76543059 ,

The log shows an error like:

com.xxx.use.xxxxUse cannot be resolved to a type

This indicates that AEM couldn't find or load the custom Java class (xxxxUse) referenced in your HTL.

A bundle in the INSTALLED state means:

  - OSGi recognized the bundle, but dependency resolution failed. That is, required packages/classes weren't available (or available yet) at startup.

This typically happens due to:

  - Missing or incorrectly exported package in the bundle MANIFEST.MF

  - Timing issues during startup your custom bundle may depend on another bundle that wasn't active yet.

  - ClassLoader mismatch or cached class inconsistency post-deployment.

  - AEM doesn't automatically refresh a bundle stuck in INSTALLED you must restart it manually or automate it.

 

Try below options:

Thanks for the useful info!