cancel
Showing results for 
Search instead for 
Did you mean: 

activiti.cfg

awhobbes
Champ in-the-making
Champ in-the-making
I'm trying to create a standalone engine, using the following code to access the H2 DB:
ProcessEngine processEngine = ProcessEngineConfiguration
         .createStandaloneProcessEngineConfiguration()
          .buildProcessEngine();

I installed the H2 DB myself (couldn't get the demo.start working) and was getting the problem that the tables aren't set up.
So I've added <property name="databaseSchemaUpdate" value="true" />

I tried installing version 5.9 in hope of getting the examples working and now, even after I've removed the directory, I'm getting the message:
org.activiti.engine.ActivitiWrongDbException: version mismatch: activiti library version is '5.13', db version is 5.9 Hint: Set <property name="databaseSchemaUpdate" to value="true" or value="create-drop" (use create-drop for testing only!) in bean processEngineConfiguration in activiti.cfg.xml for automatic schema creation
   at org.activiti.engine.impl.db.DbSqlSession.dbSchemaCheckVersion(DbSqlSession.java:598)

It seems like there's a cfg file I'm hitting, not hitting my own file.   I've got my own cfg file in my classpath, moved to the top so that it ought to get loaded first.

Am I missing something?
Thanks,
Axel
4 REPLIES 4

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Axel,

activiti library version is '5.13', db version is 5.9
It seems that you are trying to run 5.13 libraries on the Database schema version 5.9. -> It should be in sync.

I'm trying to create a standalone engine, using the following code to access the H2 DB:
Process engine is instantiated in almost each jUnit test in activiti project. Try to find it.

Regards
Martin

awhobbes
Champ in-the-making
Champ in-the-making
Hi Martin,
Thanks for getting back to me so quick.   I know how to instantiate the engine, and, in fact I've gotten around my problem (but would like to understand better what's going on) by using ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration().setJdbcUrl( "jdbc:h2:tcp://localhost/~/test").setDatabaseSchemaUpdate("true").buildProcessEngine();

This points me at the H2 DB I want to use.   But I'd still like to understand where the default cfg file is and why I can't get my own file to work even though I've got in my class path.  Is it in the activiti.jar?
Thanks,
Axel

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Axel,

Another method for creating process engine configuration should be used to apply activiti.cfg.xml


  public static ProcessEngineConfiguration createProcessEngineConfigurationFromResourceDefault() {
    return createProcessEngineConfigurationFromResource("activiti.cfg.xml", "processEngineConfiguration");
  }

  public static ProcessEngineConfiguration createProcessEngineConfigurationFromResource(String resource) {
    return createProcessEngineConfigurationFromResource(resource, "processEngineConfiguration");
  }

Regards
Martin

awhobbes
Champ in-the-making
Champ in-the-making
Ok, sounds good will try that.
Thanks
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.