cancel
Showing results for 
Search instead for 
Did you mean: 

Error after pointing activiti-explorer to postgresql db

shreyashp
Champ in-the-making
Champ in-the-making
I have deployed activiti db schema using DbSchemaCreate's main method. i.e an db with no data.
Further i have deployed activiti-explorer-5.18 web app on tomcat.

Db-Properties:
db=postgres
jdbc.driver=org.postgresql.Driver
jdbc.url=jdbcSmiley Tongueostgresql://localhost:5432/mydb?currentSchema=activiti
jdbc.username=mydb
jdbc.password=mydb

Activiti-custom-context.xml:
I have uncommented the whole file as it is.
Just added <property name="databaseSchema" value="activiti" /> to the processEngineConfiguration.

Now when i start my tomcat i get following stacktrace:
11:48:35,335 [pool-2-thread-1] INFO  org.springframework.beans.factory.config.PropertyPlaceholderConfigurer  - Loading properties file from
class path resource [ui.properties]
11:48:35,351 [pool-2-thread-1] INFO  org.springframework.beans.factory.config.PropertyPlaceholderConfigurer  - Loading properties file from
class path resource [db.properties]
11:48:37,597 [pool-2-thread-1] WARN  org.springframework.web.context.support.AnnotationConfigWebApplicationContext  - Exception encountered
during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoDataConfiguration': Injection of autowired depen
dencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.activit
i.engine.IdentityService org.activiti.explorer.conf.DemoDataConfiguration.identityService; nested exception is org.springframework.beans.fac
tory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception
is java.lang.NullPointerException
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBe
anPostProcessor.java:334)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java
:1202)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java
:537)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4
76)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755
)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:75
7)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
        at org.activiti.explorer.servlet.WebConfigurer.contextInitialized(WebConfigurer.java:40)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.activiti.engine.IdentityService
org.activiti.explorer.conf.DemoDataConfiguration.identityService; nested exception is org.springframework.beans.factory.BeanCreationExceptio
n: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerE
xception
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotatio
nBeanPostProcessor.java:561)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBe
anPostProcessor.java:331)
        … 25 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw excepti
on on object creation; nested exception is java.lang.NullPointerException
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:1
75)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103
)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1517)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:314)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:368)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapabl
eBeanFactory.java:1111)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactor
y.java:1006)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java
:504)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:4
76)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotatio
nBeanPostProcessor.java:533)
        … 27 more
Caused by: java.lang.NullPointerException
        at org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpdate(DbSqlSession.java:1081)
        at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:1473)
        at org.activiti.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:25)
        at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
        at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:77)
        at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:427)
        at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:65)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:60)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32)
        at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:1
68)
        … 44 more
5 REPLIES 5

shreyashp
Champ in-the-making
Champ in-the-making
Stacktrace continued:
Jan 7, 2016 12:20:01 PM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class org.activiti.explorer.servlet.WebConfigurer
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:83)
at org.activiti.explorer.servlet.WebConfigurer.contextDestroyed(WebConfigurer.java:73)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4805)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5453)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

jbarrez
Star Contributor
Star Contributor
That error seems to be coming from here: https://github.com/Activiti/Activiti/blob/activiti-5.18.0/modules/activiti-engine/src/main/java/org/...

Which means that
1) the table was present, but
2) did not contain the right information

How did you create the database schema?

shreyashp
Champ in-the-making
Champ in-the-making
I have deployed activiti db schema using DbSchemaCreate's main method. Changed the activiti.cfg.xml to point to an empty schema.
act_ge_property contained:
"next.dbid";"1";1
"schema.history";"create(5.20.0.1)";1
"schema.version";"5.20.0.1";1

All other tables are empty.

hari
Star Contributor
Star Contributor
Hi Shreyash,

Try it in this way,
Go to the Activiti zip that you have downloaded. It will contain the database folder and inside of it, you will find create and inside you will find 3 db script files related to postgres database with names activiti.postgres.create.engine.sql, activiti.postgres.create.history.sql, activiti.postgres.create.identity.sql.
1) Now open your DB and create an empty database and run these scripts in that db. You will have all necessary db objects created.
2) Next go to your tomcat's webapps\activiti-explorer\WEB-INF\classes folder and set the db properties appropriately.
3) Make sure you have the postgresql jar file in your tomcat lib folder.
That's it. Every thing should work smooth now.

uzair_zaman
Champ in-the-making
Champ in-the-making
Hi Hari,
I had followed the same steps you have explained about 5 months before to setup msql and it worked exactly fine.
Now I am trying to follow the same steps for mssql but it's not working.
I have copied the sqljdbc4 under\apache-tomcat-7.0.67 - Activiti Tomcat\webapps\activiti-explorer\WEB-INF\lib and have changed the db.properties file accordingly:
db=mssql
jdbc.driver=com.microsoft.sqlsever.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://10.10.44.1:1433;databaseName=activiti
jdbc.username=sa
jdbc.password=password

Any suggestions?