cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a demo that works?

coderchris
Champ in-the-making
Champ in-the-making
I've been following the 10 minute demo (here: http://activiti.org/userguide/index.html#10minutetutorial) and I wanted to know if there is a demo that actually works. My upper management wants a demo of BPM in general and Activiti specifically, but I can't get the code to work. It just errors out:

org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-170]
   at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
   at org.h2.message.DbException.get(DbException.java:158)
   at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:399)
   at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:287)

I can get the demo setup working, but even that has issues (it refuses to work in Firefox now; I had to switch to Chrome, which handles it). Is there a quick demo somewhere that actually works?
14 REPLIES 14

bmarkmann
Champ in-the-making
Champ in-the-making
I put together a little demo that walks through a simple process; you might find it useful:

http://c20g.com/getting-started-with-activiti/

- Bill

sheing3003
Champ in-the-making
Champ in-the-making
Do the 1 minute version, basically you start tomcat and then drop the activiti.war file into webapp, it'll automatically deploy. Then just go to http://localhost:8080/activiti-explorer

andzoff
Champ in-the-making
Champ in-the-making
Same problem of CoderChris.

I'm trying to run a simple activity workflow with its JUnit test. My choice is the second exercise on the Activiti In Action book.
The first exercise works (section 1.4.1 page 12), but it does not involve the H2 database.
The second exercise (section 1.4.2 page 14) involves the H2 database, and for me it's not working.
So, here is what I'm doing:
  • I've got eclipse with the Activiti plugin installed;
  • I create a new Activiti project;
  • In the Activiti project, in the src/main/resources I create a file [font=courier]bookorder.bpmn20.xml[/font] (see the text on the book, listing 1.3 pages 14, 15 or request it to me);
  • In the Activiti project, in the src/main/resources I copy the [font=courier]activiti.cfg.xml[/font] file (attached at the end of this message);
  • In the Activiti project, in the src/test/java, I create a JUnit Test file called [font=courier]BookOrderTest.java[/font] (see the text on the book, listing 1.4 pages 15, 16 or request it to me);
  • In the project's properties page I add all the required External JARs. These are the activiti pack ones and the activiti-explorer (under Tomcat) ones. After this action there are no more errors on the [font=courier]BookOrderTest.java[/font] file;
  • I go on the [font=courier]BookOrderTest.java[/font] file and give the Run As/JUnit Test command…
The error is:

org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-170]
### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEntity.selectDbSchemaVersion
### The error occurred while executing a query
### Cause: org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-170]
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
<bla bla something omissis>
Caused by: org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-170]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:158)
at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:399)
    <bla bla something omissis>
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
… 57 more
What am I missing?
Any help would be appreciated.

Here is the [font=courier]activiti.cfg.xml[/font] file text:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">

  <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration" >
    <!– Database configurations –>
    <property name="databaseType" value="h2" />
    <property name="jdbcUrl" value="jdbc:h2:tcp://localhost/activiti" />
    <property name="jdbcDriver" value="org.h2.Driver" />
    <property name="jdbcUsername" value="sa" />
    <property name="jdbcPassword" value="" />

    <property name="mailServerPort" value="1025"/>
   
    <property name="jobExecutorActivate" value="false" />
   
    <property name="customPostDeployers">
      <list>
        <bean class="org.activiti.engine.impl.rules.RulesDeployer" />
      </list>
    </property>
   
  </bean>
 
</beans>

andzoff
Champ in-the-making
Champ in-the-making
Oh, I found the problem!
In the first working example, the JUnit test uses the following invokation:

ProcessEngine processEngine = ProcessEngineConfiguration
   .createStandaloneInMemProcessEngineConfiguration()
    .buildProcessEngine();
In the second (non working for me) example the following invokation is used:

ProcessEngine processEngine = ProcessEngineConfiguration
   .createStandaloneProcessEngineConfiguration()
    .buildProcessEngine();
The difference is in the InMem magic substring.
Well, now the mentioned error is disappeared, but I get another error that I will treat in another thread.
Thanks to the forumers reading my adventures.
Andrea


coderchris
Champ in-the-making
Champ in-the-making
Bill/bmarkmann, thanks for the demo. Unfortunately, my workplace blocks access to the site. I'll take a look at it somewhere more liberal access permissions (like @ home).

Andrea/andzoff, it's nice to hear I'm not the only one encountering problems! Smiley Happy Good luck with your adventures.

trademak
Star Contributor
Star Contributor
Did you install the standalone H2 database? That's needed when not using the in-memory database.
For more info read this:

http://bpmn20inaction.blogspot.nl/2013/02/activiti-in-action-updates-part-1.html

Best regards,

andzoff
Champ in-the-making
Champ in-the-making
Hi Tijs,
now all is working for me.

I've written an article representing a step-by-step walkthrough (with screenshots) to the two examples in the first chapter of Activiti in action, with some nice semplifications.
I think it could be an interesting guide for some newbies to Activiti: it's a newbie's point of view dedicated to newbies.
I've just finished to write it, and it would be an honour for me to see my article in your blog.
Please let me know if this could be ok for you.

Thank you for your presence in the forum.
Andrea

djcameronsc
Champ in-the-making
Champ in-the-making
I would SURE like to see your document, Andrea…..could you email to me at icmrn@aim.com ?  If there's a problem with emailing due to size or whatever, let me know, I can FTP or some other way……

trademak
Star Contributor
Star Contributor
Hi Andrea, sorry for the late response. Yes definitely we would like to add it to our Activiti team feed and I can link to it from my blog. Just let me know where I can read the walkthrough.

Best regards,