cancel
Showing results for 
Search instead for 
Did you mean: 

Tables are not getting created in Oracle database

chandanmb1
Champ on-the-rise
Champ on-the-rise
Hello All,

I downloaded the war file. I added the oracle configuration for db.properties as well as activiti_cfg.xml.
I started the server. I am getting the below exception.

db=oracle
jdbc.driver=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbcSmiley Surprisedracle:thin:@10.165.18.29:1521Smiley SurprisedRCL
jdbc.username=ACT_USER
jdbc.password=ACT_USER

  <property name="jdbcUrl" value="jdbcSmiley Surprisedracle:thin:@10.165.18.29:1521Smiley SurprisedRCL" />
      <property name="jdbcDriver" value="oracle.jdbc.driver.OracleDriver" />
      <property name="jdbcUsername" value="ACT_USER" />
      <property name="jdbcPassword" value="ACT_USER" />
      <property name="databaseSchemaUpdate" value="true" />


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoDataConfiguration': Injection of autowired dependencies failed; nested exception is 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.BeanCreationException: Error creating bean with name 'identityService' defined in class path resource [org/activiti/explorer/conf/ActivitiEngineConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.IdentityService]: Factory method 'identityService' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine' defined in class path resource [org/activiti/explorer/conf/ActivitiEngineConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.ProcessEngine]: Factory method 'processEngine' threw exception; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineFactoryBean': FactoryBean threw exception on object creation; nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: java.sql.SQLException: ORA-00942: table or view does not exist

### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEntity.selectProperty-Inline
### The error occurred while setting parameters
### SQL: select * from ACT_GE_PROPERTY where NAME_ = ?
### Cause: java.sql.SQLException: ORA-00942: table or view does not exist

   at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.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:476)
   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:757)
   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:4811)
   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5251)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   at java.lang.Thread.run(Thread.java:745)

4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
did you set databaseSchemaUpdate to true to automatically create the tables?
Is your user owner of the schema? If it's some general user with many schema's, I've seen this exception happen.

chandanmb1
Champ on-the-rise
Champ on-the-rise
Hello,

Yes databaseSchemaUpdate is set to True.
I feel i am the owner of the schema. But still the problems persists.
What is the permission required on Oracle DB level to make the tables created. I have granted all the privileges to the user.

jbarrez
Star Contributor
Star Contributor
That should be it, to be honest. Does the user own multiple schema's? If so, try with only one
(just trying here, never heard of that issue).

sreekanth
Champ in-the-making
Champ in-the-making
Even we are facing the same issue, while using multitenant configuration, we are using single datasource and schema/tenant using postgres, we have tweaked TenantAwareDataSource to return appropriately, if its single schema and the schema name is "public" its working else it throws the same issue. When debugged to org.activiti.engine.impl.db.DbSqlSession#isTablePresent(String tableName) line no 846 :                
tables = e.getTables(catalog, schema, tableName, JDBC_METADATA_TABLE_TYPES);
here value for "schema" going as null, i hope thats the reason its failing for non "public" schema. Any thoughts ?