I'm very new to Activiti so still finding my way around, however I seem to be stuck with this exception and can't figure out if I'm doing something wrong. So any help would be appreciated.
Here's a summary of where I'm at:
I'm creating a Java (1.6.0_21) and Spring (3.0.5) application which hosts a RESTEasy web service layered above by an embedded Activiti (5.8) engine. The app is deployed as a .war onto Springtc 2.6.1 (Tomcat 6.0.33).
———————————— The Spring application context is configured with the following snippet:
The log file shows the associated exception within the stated transaction boundaries:
2012-01-19 01:33:53.453 Creating new JDBC Driver Connection to [jdbc:mysql://localhost:3306/phoenix] 2012-01-19 01:33:53.468 Acquired Connection [com.mysql.jdbc.JDBC4Connection@1d69c87] for JDBC transaction 2012-01-19 01:33:53.468 Switching JDBC Connection [com.mysql.jdbc.JDBC4Connection@1d69c87] to manual commit 2012-01-19 01:33:53.468 ooo Connection Opened 2012-01-19 01:33:53.468 ==> Executing: select * from ACT_RE_PROCDEF where KEY_ = ? and VERSION_ = (select max(VERSION_) from ACT_RE_PROCDEF where KEY_ = ?) 2012-01-19 01:33:53.468 ==> Parameters: member(String), member(String) 2012-01-19 01:33:53.468 Participating in existing transaction 2012-01-19 01:33:53.468 xxx Connection Closed 2012-01-19 01:33:53.468 Initiating transaction rollback on application exception org.activiti.engine.ActivitiException: no processes deployed with key 'member' at org.activiti.engine.impl.persistence.deploy.DeploymentCache.findDeployedLatestProcessDefinitionByKey(DeploymentCache.java:62) at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:58) at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:31) 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.startProcessInstanceByKey(RuntimeServiceImpl.java:49) at com.xxx.MemberBpmServiceImpl.startBusinessProcess(MemberBpmServiceImpl.java:24) at com.xxx.MemberREST.createMember(MemberREST.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140) at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) 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:175) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) 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 com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.traceNextValve(HttpRequestOperationCollectionValve.java:112) at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:94) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:279) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300) 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:619) 2012-01-19 01:33:53.484 Initiating transaction rollback 2012-01-19 01:33:53.484 Rolling back JDBC transaction on Connection [com.mysql.jdbc.JDBC4Connection@1d69c87] 2012-01-19 01:33:53.484 Releasing JDBC Connection [com.mysql.jdbc.JDBC4Connection@1d69c87] after transaction 2012-01-19 01:33:53.484 Returning JDBC Connection to DataSource
————————————————————————
The act_re_procedef table mentioned in the above log snippet has 0 rows on the MySQL database. And I see no signs of an 'insert into act_re_procdef….' statement in log file.
————————————————————————
Further up in the log file I can see the following report:
2012-01-19 01:32:38.859 Creating new transaction with name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT 2012-01-19 01:32:38.859 Creating new JDBC Driver Connection to [jdbc:mysql://localhost:3306/phoenix] 2012-01-19 01:32:38.875 Acquired Connection [com.mysql.jdbc.JDBC4Connection@792b21] for JDBC transaction 2012-01-19 01:32:38.875 Switching JDBC Connection [com.mysql.jdbc.JDBC4Connection@792b21] to manual commit 2012-01-19 01:32:38.875 ooo Connection Opened 2012-01-19 01:32:38.875 ==> Executing: select * from ACT_RE_DEPLOYMENT D where NAME_=? order by D.DEPLOY_TIME_ asc 2012-01-19 01:32:38.875 ==> Parameters: SpringAutoDeployment(String) 2012-01-19 01:32:38.875 <== Columns: ID_, NAME_, DEPLOY_TIME_ 2012-01-19 01:32:38.890 <== Row: 1, SpringAutoDeployment, 2012-01-19 00:16:49.0 2012-01-19 01:32:38.890 ==> Executing: select * from ACT_GE_BYTEARRAY where DEPLOYMENT_ID_ = ? order by NAME_ asc 2012-01-19 01:32:38.890 ==> Parameters: 1(String) 2012-01-19 01:32:38.890 <== Columns: ID_, REV_, NAME_, DEPLOYMENT_ID_, BYTES_ 2012-01-19 01:32:38.890 <== Row: 2, 1, correct_file_path_to\vfabric-tc-server-developer-2.6.1.RELEASE\insight-instance\webapps\MyService\WEB-INF\classes\bpm\activitiMemberFlows.bpmn20.xml, 1, <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" targetNamespace="http://www.bpmnwithactiviti.org" xmlns:activiti="http://activiti.org/bpmn"> <process id="member" name="Member"> <startEvent id="startevent1" name="Start"/> <serviceTask id="serviceTask1" name="Validate order" activiti:expression="#{;}"/> <sequenceFlow id="sequenceflow1" name="Validate order" sourceRef="startevent1" targetRef="serviceTask1"/> <endEvent id="endevent1" name="End"/> <sequenceFlow id="sequenceflow3" name="flow" sourceRef="sequenceflow1" targetRef="endevent1"/> </process>
In case anyone has a similar problem, it appears to have been caused by the .bpmn20.xml file not being on the classpath defined in the Spring application context file. I changed my project structure to match the examples, and copied the SpringProcessEngineConfiguration.deploymentResources value from the example project as well. This seems to have fixed the problem