dbSchemaUpadate=true java.lang.NullPointerException [FIXED]
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2011 07:02 AM
Is there any reason for this to happen:
I'm using mysql 5.1.
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)
I'm using mysql 5.1.
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2011 07:08 AM
What version of activiti are you using?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2011 07:16 AM
5.6… damn you're quick…
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2011 07:17 AM
Hmm.. can you post your full activiti-config?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2011 07:20 AM
need to add that I'm using programatic configuration…
e.g.
Trying to figure out what is happening in your code:
e.g.
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);
Trying to figure out what is happening in your code:
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();
}
}
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2011 08:04 AM
Sorry for wasting your time…
the problem is fixed.
Was a communication issue with the DBA. He created the tables (with no data) on the fresh schema…
Is possible to remove the thread?
the problem is fixed.
Was a communication issue with the DBA. He created the tables (with no data) on the fresh schema…
Is possible to remove the thread?
