-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.1.20 EE GA2, 6.1.30 EE GA3, 6.2.10 EE GA1, 6.2.X EE, 7.0.0 M5
-
Fix Version/s: 6.2.3 CE GA4, 6.2.X EE, 7.0.0 M5
-
Component/s: Portal Services, Portal Services > Scripting
-
Labels:
-
Branch Version/s:6.2.x
-
Backported to Branch:Committed
-
Story Points:9
-
Git Pull Request:
Steps to reproduce:
1) Login to Portal
2) Navigate to Control Panel > Server Administration > Script
3) Select BeanShell as language
4) Paste the script from below
5) Execute the script and examine the result
Expected result
"TEST SUCCESSFULL!!!" message should be printed
Actual result
The following results are printed:
[ERROR] : Cannot cast org.python.core.PyObjectDerived to java.util.HashMap
TEST FAILED....
The script to use:
import java.util.Set; import java.util.HashSet; import java.util.Map; import java.util.HashMap; import java.io.Serializable; import com.liferay.portal.kernel.scripting.ScriptingUtil; ClassLoader[] servletContextNames = new ClassLoader[0]; String script = "workflowContext.put(\"resetPhase\", \"true\")"; Set outputNames = new HashSet(); outputNames.add("workflowContext"); Map workflowContext = new HashMap(); workflowContext.put("nice", true); Map inputObjects = new HashMap(); inputObjects.put("workflowContext", workflowContext); Map outputObjects = ScriptingUtil.eval(null, inputObjects, outputNames, "python", script, servletContextNames); Object workflowContextObject = outputObjects.get("workflowContext"); HashMap workflowContextHashMap = null; try { workflowContextHashMap =(HashMap)workflowContextObject; } catch(java.lang.Exception e) { out.println("[ERROR] : " + e.getMessage()); } if (workflowContextHashMap == null) { out.println("TEST FAILED...."); } else { out.println("TEST SUCCESSFUL!!!"); }
- relates
-
LPE-13542 Results from PythonExecutor are not castable
-
- Closed
-