AnsweredAssumed Answered

Is it appropriate to replace the ACT_ID_* Tables with Views of the same names?

Question asked by tchu_2000 on Oct 31, 2014
Latest reply on Nov 3, 2014 by jbarrez
The reason why we replace the user/group/membership/info tables with views is that we need to map relevant identity info from our business system into context of the Activiti engine without needless redundancy. Meanwhile, keep the modification to Activiti engine as little as possible so as to benefit from engine upgrade more easily.
I do figure out mapping the local identity tables into 4 views with exactly the same schema of the corresponding tables. However, according to the tomcat log, identityService cannot be instantiated.
————– tomcat log ————————————————————————————————–
<blockcode>
Oct 31, 2014 1:28:43 下午 org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Oct 31, 2014 1:28:45 下午 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.activiti.explorer.servlet.WebConfigurer
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]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.activiti.engine.IdentityService org.activiti.explorer.conf.ActivitiEngineConfiguration.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]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.activiti.engine.ProcessEngine org.activiti.explorer.conf.ActivitiEngineConfiguration.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.activiti.engine.ActivitiException: Activiti database problem: Tables missing for component(s) identity
   at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1185)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
   at org.activiti.explorer.servlet.WebConfigurer.contextInitialized(WebConfigurer.java:40)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)
   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
   at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1879)
   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.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
</blockcode>
————————————————————————————————————————
It's said someone else had successfully "cheat" the engine with such hack, but I doubt if it's no longer applicable in the 5.16.4 version?
Especially, I cannot find activiti-standalone-context.xml under the webapps\activiti-explorer\WEB-INF\ anymore.. Where shall I modify the processEngineConfiguration in the new version?

An early reply would be greatly appreciated! :)

Tiancheng Hu

Outcomes