08-16-2011 07:02 AM
16-08-2011 10:29:37 Bootstrap [FATAL] Couldn't initialize Activiti Engine
java.lang.NullPointerException
at org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpdate(DbSqlSession.java:620)
at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:872)
at org.activiti.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:25)
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.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:77)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:280)
at com.me.gae.servlet.Bootstrap.initActiviti(Bootstrap.java:67)
08-16-2011 07:08 AM
08-16-2011 07:16 AM
08-16-2011 07:17 AM
08-16-2011 07:20 AM
org.apache.commons.dbcp.BasicDataSource bds = new org.apache.commons.dbcp.BasicDataSource();
bds.setDefaultAutoCommit(false); //FIXME: make me configurable
bds.setUsername(ApplicationConfig.getEncryptedConfigParamDecrypted("activiti.username"));
bds.setPassword(ApplicationConfig.getEncryptedConfigParamDecrypted("activiti.password"));
bds.setDriverClassName(ApplicationConfig.getConfigParam("activiti.driverClassName"));
bds.setUrl(ApplicationConfig.getConfigParam("activiti.url"));
ProcessEngine processEngine = ProcessEngineConfiguration
.createStandaloneProcessEngineConfiguration()
.setDataSource(bds) .setJdbcMaxActiveConnections(Integer.parseInt(ApplicationConfig.getConfigParam("activiti.jdbcMaxActiveConnections")))
.setJdbcMaxIdleConnections(Integer.parseInt(ApplicationConfig.getConfigParam("activiti.jdbcMaxIdleConnections")))
.setDatabaseType(ApplicationConfig.getConfigParam("activiti.databaseType"))
.setDatabaseSchemaUpdate(ApplicationConfig.getConfigParam("activiti.databaseSchemaUpdate"))
.setHistory(ApplicationConfig.getConfigParam("activiti.history"))
.setProcessEngineName(ACTIVITI_ENGINE_NAME)
.setJobExecutorActivate(false) //FIXME: make me configurable
.buildProcessEngine();
ProcessEngines.registerProcessEngine(processEngine);
public void dbSchemaUpdate() {
String dbVersion = null;
boolean isUpgradeNeeded = false;
if (isEngineTablePresent()) {
// the next piece assumes both DB version and library versions are formatted 5.x
PropertyEntity dbVersionProperty = selectById(PropertyEntity.class, "schema.version");
dbVersion = dbVersionProperty.getValue();
isUpgradeNeeded = !ProcessEngine.VERSION.equals(dbVersion);
if (isUpgradeNeeded) {
dbVersionProperty.setValue(ProcessEngine.VERSION);
PropertyEntity dbHistoryProperty;
if ("5.0".equals(dbVersion)) {
dbHistoryProperty = new PropertyEntity("schema.history", "create(5.0)");
insert(dbHistoryProperty);
} else {
dbHistoryProperty = selectById(PropertyEntity.class, "schema.history");
}
String dbHistoryValue = dbHistoryProperty.getValue()+" upgrade("+dbVersion+"->"+ProcessEngine.VERSION+")";
dbHistoryProperty.setValue(dbHistoryValue);
dbSchemaUpgrade("engine", dbVersion);
}
} else {
dbSchemaCreateEngine();
}
if (isHistoryTablePresent()) {
if (isUpgradeNeeded) {
dbSchemaUpgrade("history", dbVersion);
}
} else if (dbSqlSessionFactory.isDbHistoryUsed()) {
dbSchemaCreateHistory();
}
if (isIdentityTablePresent()) {
if (isUpgradeNeeded) {
dbSchemaUpgrade("identity", dbVersion);
}
} else if (dbSqlSessionFactory.isDbIdentityUsed()) {
dbSchemaCreateIdentity();
}
if (isCycleTablePresent()) {
if (isUpgradeNeeded) {
dbSchemaUpgrade("cycle", dbVersion);
}
} else if (dbSqlSessionFactory.isDbCycleUsed()) {
dbSchemaCreateCycle();
}
}
08-16-2011 08:04 AM
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.