You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Roy Teeuwen (Jira)" <ji...@apache.org> on 2026/07/03 19:55:00 UTC
[jira] [Resolved] (SLING-13207) RhinoJavaScriptEngineFactory has a stale NativeJavaPackage permanently cached even when a bundle restarts
[ https://issues.apache.org/jira/browse/SLING-13207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Roy Teeuwen resolved SLING-13207.
---------------------------------
Resolution: Fixed
> RhinoJavaScriptEngineFactory has a stale NativeJavaPackage permanently cached even when a bundle restarts
> ---------------------------------------------------------------------------------------------------------
>
> Key: SLING-13207
> URL: https://issues.apache.org/jira/browse/SLING-13207
> Project: Sling
> Issue Type: Bug
> Affects Versions: Scripting JavaScript 3.1.4
> Reporter: Roy Teeuwen
> Assignee: Roy Teeuwen
> Priority: Major
>
> Rhino scripting permanently fails to resolve Java classes (e.g. org.apache.sling.api.resource.ValueMap) even when the class becomes available again.
> This happens because there is a single shared rootScope that is reused by every ScriptEngine instance. If at creation of that rootScope, the DynamicClassLoader that is used does not have access to the class, it will wrongly cache the class as a NativeJavaPackage org.apache.sling.api.resource.ValueMap instead of NativeJavaClass causing a ClassNotFoundException when the ValueMap is used (e.g. in /libs/sling/sightly/js/internal/resource.js)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)