cancel
Showing results for 
Search instead for 
Did you mean: 

unable to execute a simple process from the demo

dhavaln
Champ in-the-making
Champ in-the-making
As per the documentation I have configured the H2 and copied the financialreport process in my NetBeans project. When I am trying to execute the following code the database tables are getting affected correctly but an exception showing "no process deployed with key financialReport is coming.


        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        RepositoryService repositoryService = processEngine.getRepositoryService();

        Deployment deployment = repositoryService.createDeployment().addClasspathResource("financialreportprocess.xml").deploy();

        processEngine.getRuntimeService().startProcessInstanceByKey("financialReport");
This is the error I am receiving upon execution.

Exception in thread "main" org.activiti.engine.ActivitiException: no processes deployed with key 'financialReport'
        at org.activiti.engine.impl.db.DbRepositorySession.findDeployedLatestProcessDefinitionByKey(DbRepositorySession.java:206)
        at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:52)
        at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:29)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:22)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:37)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:40)
I am new to Activiti, please help me here in case I am missing anything.
7 REPLIES 7

pault
Star Contributor
Star Contributor
I'm fairly new to it myself, but I came across a similar problem.

To get Activiti to recogise and parse a bpmn process I think it needs a specific file name suffix, as you can deploy other kinds of resource.

So if you change the name of your file from financialreportprocess.xml to financialreportprocess.bpmn20.xml, and of course change the deploy call to match, it should work.

dhavaln
Champ in-the-making
Champ in-the-making
Thanks Paul its working now.

I have one more problem if you can answer that it would be a great help.

I have installed the demo and everything goes fine (including download and setup) but when I type the URL in the browser it keeps on waiting. No process in the tomcat and no reply in the browser comes. I am unable to understand this behavior.

OS: Windows 7

pault
Star Contributor
Star Contributor
How are you running the demo ?

I run it with ant demo.start, that actually starts browsers for Activiti Probe etc. as part of the start up - though the first time I run it they normally fail as the start up takes some time as it installs tomcat, h2 etc.

Can you see the tomcat server window - does it look like it is running ?

dhavaln
Champ in-the-making
Champ in-the-making
Yes I can see the tomcat window and all the activities going on it even starts the browser automatically but then nothing comes up.

pault
Star Contributor
Star Contributor
It will fail to connect if Tomcat hasn't finished starting up. But as long as I wait until the startup in Tomcat is complete, i.e. I see this message in the server window :

INFO: Deploying web application directory ROOT
22-Dec-2010 10:20:56 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
22-Dec-2010 10:20:56 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
22-Dec-2010 10:20:56 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/211  config=null
22-Dec-2010 10:20:56 org.apache.catalina.startup.Catalina start
INFO: Server startup in 44231 ms

I can then connect using the URL links in the user guide.

I'm on Windows XP and using Firefox.

Only other thing I can think off is to check the tomcat logs to make sure no errors occured during the start up.

dhavaln
Champ in-the-making
Champ in-the-making
Hello Paul really thanks for the information.

I found the database was not running. I had to manually start the H2 database before starting the Tomcat.

Its working now.

giga_zhang
Champ in-the-making
Champ in-the-making
I'm fairly new to it myself, but I came across a similar problem.

To get Activiti to recogise and parse a bpmn process I think it needs a specific file name suffix, as you can deploy other kinds of resource.

So if you change the name of your file from financialreportprocess.xml to financialreportprocess.bpmn20.xml, and of course change the deploy call to match, it should work.



That's very right,Thanks. the suffix must be 'bpmn20.xml'