I have a problem to call a spring bean from an activiti service task.
In my environment I use the activiti-5.6 with the given configuration. I unpack the activiti-5.6.zip file, open a windows command shell in the setup directory and execute the command “ant demo.install”.
After this I change in the tomcat in “webapps\activiti-rest” the configuration to support the spring configuration. I remove the file “activiti.cfg.jar” in “webapps\activiti-rest\lib”. Create a file “activiti.cfg.xml” in “webapps\activiti-rest\WEB-INF\classes”
Than I zip this file and rename it to “FastBaseTest.testDelegateExpression.bar”
Now I start the activiti environment with the command “ant demo.start” in the setup directory.
I login as “kermit” into the “activiti-probe” and deploy the “FastBaseTest.testDelegateExpression.bar” file.
In the next step I login as “kermit” into “activiti-explorer”, go to the process view and start the process.
Result is an error message “09060000 Wrapped Exception (with status template): Unknown property used in expression”.
and the exception in the logfile:
FINE: — starting StartProcessInstanceCmd ——————————————————– 06-Oct-2011 14:01:09 org.activiti.engine.impl.persistence.entity.ExecutionEntity initialize FINE: initializing ProcessInstance[113] 06-Oct-2011 14:01:09 org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute execute FINE: ProcessInstance[113] executes Activity(start): org.activiti.engine.impl.bpmn.behavior.NoneStartEventActivityBehavior 06-Oct-2011 14:01:09 org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior performOutgoingBehavior FINE: Leaving activity 'start' 06-Oct-2011 14:01:09 org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake execute FINE: ProcessInstance[113] takes transition (start)–flow1–>(serviceTask) 06-Oct-2011 14:01:09 org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute execute FINE: ProcessInstance[113] executes Activity(serviceTask): org.activiti.engine.impl.bpmn.behavior.ServiceTaskExpressionActivityBehavior 06-Oct-2011 14:01:09 org.activiti.engine.impl.interceptor.CommandContext close SEVERE: Error while closing command context org.activiti.engine.ActivitiException: Unknown property used in expression at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:48) at org.activiti.engine.impl.bpmn.behavior.ServiceTaskExpressionActivityBehavior.execute(ServiceTaskExpressionActivityBehavior.java:39) at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:48) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:45) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:44) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:61) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:111) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:326) at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:92) at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:49) at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44) at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36) at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481) at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:44) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481) at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:44) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:52) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:280) at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:70) at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:30) at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42) at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40) at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceById(RuntimeServiceImpl.java:69) at org.activiti.rest.api.process.ProcessInstancePost.executeWebScript(ProcessInstancePost.java:58) at org.activiti.rest.util.ActivitiWebScript.executeImpl(ActivitiWebScript.java:68) at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64) at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69) at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333) at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189) at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'fastBaseBean' at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83) at org.activiti.engine.impl.juel.AstMethod.invoke(AstMethod.java:79) at org.activiti.engine.impl.juel.AstMethod.eval(AstMethod.java:75) at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50) at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26) at org.activiti.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114) at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:46) … 74 more 06-Oct-2011 14:01:09 org.activiti.engine.impl.interceptor.LogInterceptor execute FINE: — StartProcessInstanceCmd finished ——————————————————–
The same process, spring bean and configuration run as test case in the “activiti-5.6\workspace\activiti-spring-examples” without any problem.