You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by jk...@apache.org on 2020/11/16 19:23:21 UTC

[unomi] branch fixClassLoaderDuringMVELScriptExecute created (now 1e136f7)

This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a change to branch fixClassLoaderDuringMVELScriptExecute
in repository https://gitbox.apache.org/repos/asf/unomi.git.


      at 1e136f7  UNOMI-401: correctly set ClassLoader before MVEL script execute

This branch includes the following new commits:

     new 1e136f7  UNOMI-401: correctly set ClassLoader before MVEL script execute

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[unomi] 01/01: UNOMI-401: correctly set ClassLoader before MVEL script execute

Posted by jk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jkevan pushed a commit to branch fixClassLoaderDuringMVELScriptExecute
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 1e136f7129351771f8495f5020088c6d072a76ed
Author: Kevan <ke...@jahia.com>
AuthorDate: Mon Nov 16 20:23:08 2020 +0100

    UNOMI-401: correctly set ClassLoader before MVEL script execute
---
 .../src/main/java/org/apache/unomi/scripting/MvelScriptExecutor.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripting/src/main/java/org/apache/unomi/scripting/MvelScriptExecutor.java b/scripting/src/main/java/org/apache/unomi/scripting/MvelScriptExecutor.java
index f0fdd51..8777b0f 100644
--- a/scripting/src/main/java/org/apache/unomi/scripting/MvelScriptExecutor.java
+++ b/scripting/src/main/java/org/apache/unomi/scripting/MvelScriptExecutor.java
@@ -44,12 +44,13 @@ public class MvelScriptExecutor implements ScriptExecutor {
 
         final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
         try {
+            Thread.currentThread().setContextClassLoader(secureFilteringClassLoader);
+
             if (!mvelExpressions.containsKey(script)) {
 
                 if (expressionFilterFactory.getExpressionFilter("mvel").filter(script) == null) {
                     mvelExpressions.put(script, INVALID_SCRIPT_MARKER);
                 } else {
-                    Thread.currentThread().setContextClassLoader(secureFilteringClassLoader);
                     ParserConfiguration parserConfiguration = new ParserConfiguration();
                     parserConfiguration.setClassLoader(secureFilteringClassLoader);
                     ParserContext parserContext = new ParserContext(parserConfiguration);