cancel
Showing results for 
Search instead for 
Did you mean: 

couldn't find a variable type that is able to serialize [object global] 'nashorn.global'

jtmille3
Champ in-the-making
Champ in-the-making
My JavaScript task seems to have broken going from JDK7 to JDK8.  I know they swapped out the script engine from Rhino to Nashorn but now I am getting an error message any times to tries to run a ScriptTask.  It could be completely empty and will still fail with the same error message.  When I put a breakpoint in the activiti engine it's failing to find a default variable type for "nashorn.global"

JDK 1.8.0_25
Activiti 5.17.0

couldn't find a variable type that is able to serialize [object global]
org.activiti.engine.ActivitiException: couldn't find a variable type that is able to serialize [object global]
   at org.activiti.engine.impl.variable.DefaultVariableTypes.findVariableType(DefaultVariableTypes.java:62) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableInstance(VariableScopeImpl.java:690) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.createVariableInstance(ExecutionEntity.java:1171) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:604) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:591) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:485) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:442) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.scripting.ScriptBindings.put(ScriptBindings.java:83) ~[activiti-engine-5.17.0.jar:5.17.0]
   at jdk.nashorn.api.scripting.NashornScriptEngine.getNashornGlobalFrom(NashornScriptEngine.java:394) ~[nashorn.jar:na]
   at jdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:640) ~[nashorn.jar:na]
   at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:521) ~[nashorn.jar:na]
   at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:192) ~[nashorn.jar:na]
   at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233) ~[na:1.8.0_25]
   at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:87) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:73) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.bpmn.behavior.ScriptTaskActivityBehavior.execute(ScriptTaskActivityBehavior.java:63) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:80) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:35) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:450) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:428) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:140) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:66) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:45) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:62) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:378) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:111) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:37) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57) ~[activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) [activiti-spring-5.17.0.jar:5.17.0]
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) [spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) [activiti-spring-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37) [activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40) [activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35) [activiti-engine-5.17.0.jar:5.17.0]
   at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:69) [activiti-engine-5.17.0.jar:5.17.0]
   at com.sas.fcs.tdc.services.WorkflowServiceTest.testFetchTasksForEntity(WorkflowServiceTest.java:189) [TDC/:na]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_25]
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_25]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_25]
   at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_25]
   at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) [junit-4.11.jar:na]
   at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.11.jar:na]
   at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) [junit-4.11.jar:na]
   at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.11.jar:na]
   at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) [junit-4.11.jar:na]
   at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:73) [spring-test-4.1.6.RELEASE.jar:4.1.6.RELEASE]
   at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) [junit-4.11.jar:na]
   at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82) [spring-test-4.1.6.RELEASE.jar:4.1.6.RELEASE]
   at org.activiti.engine.test.ActivitiRule$1.evaluate(ActivitiRule.java:126) [activiti-engine-5.17.0.jar:5.17.0]
   at org.junit.rules.RunRules.evaluate(RunRules.java:20) [junit-4.11.jar:na]
   at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:73) [spring-test-4.1.6.RELEASE.jar:4.1.6.RELEASE]
   at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) [junit-4.11.jar:na]
   at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:224) [spring-test-4.1.6.RELEASE.jar:4.1.6.RELEASE]
   at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:83) [spring-test-4.1.6.RELEASE.jar:4.1.6.RELEASE]
   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) [junit-4.11.jar:na]
   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) [junit-4.11.jar:na]
   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) [junit-4.11.jar:na]
   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) [junit-4.11.jar:na]
   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) [junit-4.11.jar:na]
   at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) [junit-4.11.jar:na]
   at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-4.1.6.RELEASE.jar:4.1.6.RELEASE]
   at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:68) [spring-test-4.1.6.RELEASE.jar:4.1.6.RELEASE]
   at org.junit.runners.ParentRunner.run(ParentRunner.java:309) [junit-4.11.jar:na]
   at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:163) [spring-test-4.1.6.RELEASE.jar:4.1.6.RELEASE]
   at org.junit.runner.JUnitCore.run(JUnitCore.java:160) [junit-4.11.jar:na]
   at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78) [junit-rt.jar:na]
   at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212) [junit-rt.jar:na]
   at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68) [junit-rt.jar:na]
7 REPLIES 7

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Is object global type serializable? (if not make it serializable)

Regards
Martin

jtmille3
Champ in-the-making
Champ in-the-making
Here's my test.  Please note the script block.  I'm not serializing anything except what I am trying to store on execution.  I could leave the script block empty and I will get the same error.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
  <process id="tdcTestEntityProcess" name="Test Entity" isExecutable="true">
    <startEvent id="sid-6EB1FE64-96F9-4280-8CA7-3F7D59B99559"></startEvent>
    <userTask id="tdcTestEntityTask" name="Entity Test"></userTask>
    <sequenceFlow id="sid-DCC5AE6F-5D74-4AC8-BF00-7B6375113A56" sourceRef="sid-6EB1FE64-96F9-4280-8CA7-3F7D59B99559" targetRef="tdcEntitySetVariables"></sequenceFlow>
    <endEvent id="sid-6BA9D8E9-E25C-403A-8B13-5C5E7029029B"></endEvent>
    <sequenceFlow id="sid-B53F967C-4DD1-4D2D-AECA-BB4BB0399E1B" sourceRef="tdcTestEntityTask" targetRef="sid-6BA9D8E9-E25C-403A-8B13-5C5E7029029B"></sequenceFlow>
    <sequenceFlow id="sid-00D537B4-C3BA-4480-AB7D-9704DEFC35F8" sourceRef="tdcEntitySetVariables" targetRef="tdcTestEntityTask"></sequenceFlow>
    <scriptTask id="tdcEntitySetVariables" name="Set Entity" scriptFormat="javascript" activiti:autoStoreVariables="true">
      <script>
        execution.setVariable("object_type_cd", "alert");
        execution.setVariable("id", "17000");
      </script>
    </scriptTask>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_tdcTestEntityProcess">
    <bpmndi:BPMNPlane bpmnElement="tdcTestEntityProcess" id="BPMNPlane_tdcTestEntityProcess">
      <bpmndi:BPMNShape bpmnElement="sid-6EB1FE64-96F9-4280-8CA7-3F7D59B99559" id="BPMNShape_sid-6EB1FE64-96F9-4280-8CA7-3F7D59B99559">
        <omgdc:Bounds height="30.0" width="30.0" x="158.0" y="145.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="tdcTestEntityTask" id="BPMNShape_tdcTestEntityTask">
        <omgdc:Bounds height="80.0" width="100.0" x="435.0" y="120.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-6BA9D8E9-E25C-403A-8B13-5C5E7029029B" id="BPMNShape_sid-6BA9D8E9-E25C-403A-8B13-5C5E7029029B">
        <omgdc:Bounds height="28.0" width="28.0" x="585.0" y="146.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="tdcEntitySetVariables" id="BPMNShape_tdcEntitySetVariables">
        <omgdc:Bounds height="80.0" width="100.0" x="255.0" y="120.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sid-B53F967C-4DD1-4D2D-AECA-BB4BB0399E1B" id="BPMNEdge_sid-B53F967C-4DD1-4D2D-AECA-BB4BB0399E1B">
        <omgdi:waypoint x="535.0" y="160.0"></omgdi:waypoint>
        <omgdi:waypoint x="585.0" y="160.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-00D537B4-C3BA-4480-AB7D-9704DEFC35F8" id="BPMNEdge_sid-00D537B4-C3BA-4480-AB7D-9704DEFC35F8">
        <omgdi:waypoint x="355.0" y="160.0"></omgdi:waypoint>
        <omgdi:waypoint x="435.0" y="160.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-DCC5AE6F-5D74-4AC8-BF00-7B6375113A56" id="BPMNEdge_sid-DCC5AE6F-5D74-4AC8-BF00-7B6375113A56">
        <omgdi:waypoint x="188.0" y="160.0"></omgdi:waypoint>
        <omgdi:waypoint x="255.0" y="160.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

jtmille3
Champ in-the-making
Champ in-the-making
I'm attaching my example workflow.

jbarrez
Star Contributor
Star Contributor
I'm guessing that the embedded javascript engine in the JDK is creating some odd object instead of the default one. Can you verify that? Can you check if it works with a regular Java delegate doing the same thing?

mdond
Champ in-the-making
Champ in-the-making
I'm having the same error (JDK 1.8.0_25, Activiti 5.12.0) right on process start with the following simple javascript-task as the first task of my process:

<scriptTask id="scripttask1" name="Initialize Variables" scriptFormat="javascript" activiti:autoStoreVariables="true">
      <script>
          if (execution.getVariable('shortProcess')==null) {
       execution.setVariable('shortProcess', false)
          }
    </script>
</scriptTask>

@jtmille3: Did you find a solution?

stemly
Champ in-the-making
Champ in-the-making
Hi, problem is activiti:autoStoreVariables="true" in that case Nashorn tries to put in binding variable "nahshorn.global" of type jdk.nashorn.api.scripting.ScriptObjectMirror that is not Serializable see part of stackTrace
Try to remove activiti:autoStoreVariables="true" from diagram definition, that could help.

This block us from migrating to Java 1.8, since we need to upgrade all old process definitions where we use simple Javacsript like
<code>
<script>action=null</script>
</code>

Joram I would it be possible to serialize non Serializable object with JSON, or make special handling "nashorn.global"?

<code>
org.activiti.engine.ActivitiException: couldn't find a variable type that is able to serialize [object global]
at org.activiti.engine.impl.variable.DefaultVariableTypes.findVariableType(DefaultVariableTypes.java:62)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableInstance(VariableScopeImpl.java:690)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.createVariableInstance(ExecutionEntity.java:1171)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:604)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:591)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:485)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:442)
at org.activiti.engine.impl.scripting.ScriptBindings.put(ScriptBindings.java:83)
at jdk.nashorn.api.scripting.NashornScriptEngine.getNashornGlobalFrom(NashornScriptEngine.java:394)
at jdk.nashorn.api.scripting.NashornScriptEngine.compileImpl(NashornScriptEngine.java:640)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:521)
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:192)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:87)
</code>

jbarrez
Star Contributor
Star Contributor
It might be, but I am not sure if the 'global' object is something you want to serialize, what I read online is that it's a container of many other things too.

You can register a VariableType with the process engine for types that the engine doesn't support out of the box.
Normally, the Object serializer is the 'catch-all', but probably this object does not implement Serializeable.
So how would you convert that to JSON?