AnsweredAssumed Answered

Problem making my first Activiti engine run

Question asked by juanb on Aug 7, 2014
Latest reply on Oct 25, 2016 by cjose
Hi, I have been working on an app in OpenXava (framework for rapid-application development in Java) and I wanted to integrate it with Activiti. What I made to make it work is download the .jar file (activiti-engine-5.16.jar) and include it in my project. As OpenXava works with Ant files and not with Maven, to include the jar file I needed to add it to the project build path on Eclipse (is this correct?). Once I did this, I had access to the Java methods of Activiti. So to create the Engine I made this:
1. I created a class Engine.java with the following:
public class Engine {
   private static ProcessEngine engine;

   static public ProcessEngine getEngine() {
      if (engine != null) {
         return engine;
      }
      ProcessEngineConfiguration conf = ProcessEngineConfiguration
            .createStandaloneProcessEngineConfiguration();
      conf.setDatabaseType("postgres");
        conf.setJdbcDriver("com.postgresql.Driver");
        conf.setDatabaseSchemaUpdate("check-version");
        conf.setJdbcUrl("jdbc:postgresql://localhost/testapp");
        conf.setJdbcPassword("postgres");
        conf.setJdbcUsername("postgres");
        engine = conf.buildProcessEngine();
      return engine;
   }
}
2. From a OpenXava class (such as Item.java which contains the definition of an item, I call the method Engine.getEngine() ).The problem is that it fails on the very first line of the Engine class (ProcessEngineConfiguration conf = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();). It does not tell anything because OpenXava deploys on Tomcat automatically and I have no information about the error on the log. The strange thing is that if I create an empty document on my desktop (by Java coding) before the line of ProcessEngineConfiguration conf = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();, the document creates. But if I create it before, the document never creates. That's why I know that the error is on that line. I think that maybe as I am including the activiti-engine.jar in Eclipse as project build path, it is incorrect this and thats why on runtime it isn't working properly.
Thanks

Outcomes