mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
When loading JS includes with a full classpath reference, handle the Eclipse classloader behaving slightly differently on absolute paths compared to the JVM one
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28716 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -320,9 +320,14 @@ public class RhinoScriptProcessor extends BaseProcessor implements ScriptProcess
|
||||
{
|
||||
try
|
||||
{
|
||||
// load from classpath
|
||||
// Load from classpath
|
||||
String scriptClasspath = resource.substring(PATH_CLASSPATH.length());
|
||||
URL scriptResource = getClass().getClassLoader().getResource(scriptClasspath);
|
||||
if (scriptResource == null && scriptClasspath.startsWith("/"))
|
||||
{
|
||||
// The Eclipse classloader prefers alfresco/foo to /alfresco/foo, try that
|
||||
scriptResource = getClass().getClassLoader().getResource(scriptClasspath.substring(1));
|
||||
}
|
||||
if (scriptResource == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to locate included script classpath resource: " + resource);
|
||||
|
Reference in New Issue
Block a user