cancel
Showing results for 
Search instead for 
Did you mean: 

ActivityException: Error while building ibatis SqlSessionFactory: null

imkeshav
Confirmed Champ
Confirmed Champ
Hi All,

I'm new to activiti, trying to configure with Spring.

Please find the below java based configurations:

   @Bean
   public DataSource dataSource() throws PropertyVetoException
   {
      ComboPooledDataSource dataSource = new ComboPooledDataSource();
      dataSource.setDriverClass(env.getProperty("jdbc.driverClassName"));
      dataSource.setJdbcUrl(env.getProperty("jdbc.url"));
      dataSource.setUser(env.getProperty("jdbc.username"));
      dataSource.setPassword(env.getProperty("jdbc.password"));
      dataSource.setAcquireIncrement(5);
      dataSource.setIdleConnectionTestPeriod(60);
      dataSource.setMaxPoolSize(10);
      dataSource.setMaxStatements(5);
      dataSource.setMinPoolSize(3);
      return dataSource;
   }
   
   //activiti setup for workflow
   @Bean
   @DependsOn("transactionManager")
   public SpringProcessEngineConfiguration processEngineConfiguration() throws PropertyVetoException{
      SpringProcessEngineConfiguration configuration = new SpringProcessEngineConfiguration();
      configuration.setDataSource(dataSource());
      configuration.setDatabaseType("postgresql");
      configuration.setTransactionManager(transactionManager());
      configuration.setDatabaseSchemaUpdate("true");
      configuration.setJobExecutorActivate(true);

      return configuration;
   }

   @Bean
   @DependsOn("processEngineConfiguration")
   public ProcessEngineFactoryBean processEngineFactoryBean() throws PropertyVetoException{
      ProcessEngineFactoryBean bean = new ProcessEngineFactoryBean();
      bean.setProcessEngineConfiguration(processEngineConfiguration());

      return bean;
   }
   
   @Bean
   @DependsOn("processEngineFactoryBean")
   RepositoryService repositoryService() throws PropertyVetoException{
      return processEngineFactoryBean().getProcessEngineConfiguration().getRepositoryService();
   }



Please see the below exception:


15:33:55,000 INFO  [stdout] (ServerService Thread Pool – 56) 15:33:54.999 [ServerService Thread Pool – 56] WARN  o.s.w.c.s.XmlWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt

15:33:55,000 INFO  [stdout] (ServerService Thread Pool – 56) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineFactoryBean': FactoryBean threw exception on object creation; nested exception is org.activiti.engine.ActivitiException: Error while building ibatis SqlSessionFactory: null

15:33:55,000 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,000 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,001 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1574) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,001 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:253) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,001 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,001 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:295) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,001 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,001 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,001 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,001 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) ~[spring-context-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,001 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) [spring-web-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,001 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) [spring-web-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,002 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,002 INFO  [stdout] (ServerService Thread Pool – 56)    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.4.8.Final-redhat-4.jar!/:7.4.8.Final-redhat-4]

15:33:55,002 INFO  [stdout] (ServerService Thread Pool – 56)    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.4.8.Final-redhat-4.jar!/:7.4.8.Final-redhat-4]

15:33:55,002 INFO  [stdout] (ServerService Thread Pool – 56)    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161) [jboss-as-web-7.4.0.Final-redhat-19.jar!/:7.4.0.Final-redhat-19]

15:33:55,002 INFO  [stdout] (ServerService Thread Pool – 56)    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:59) [jboss-as-web-7.4.0.Final-redhat-19.jar!/:7.4.0.Final-redhat-19]

15:33:55,002 INFO  [stdout] (ServerService Thread Pool – 56)    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:94) [jboss-as-web-7.4.0.Final-redhat-19.jar!/:7.4.0.Final-redhat-19]

15:33:55,002 INFO  [stdout] (ServerService Thread Pool – 56)    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_45]

15:33:55,002 INFO  [stdout] (ServerService Thread Pool – 56)    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_45]

15:33:55,002 INFO  [stdout] (ServerService Thread Pool – 56)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]

15:33:55,003 INFO  [stdout] (ServerService Thread Pool – 56)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45]

15:33:55,003 INFO  [stdout] (ServerService Thread Pool – 56)    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]

15:33:55,003 INFO  [stdout] (ServerService Thread Pool – 56)    at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final-redhat-1.jar!/:2.1.1.Final-redhat-1]

15:33:55,003 INFO  [stdout] (ServerService Thread Pool – 56) Caused by: org.activiti.engine.ActivitiException: Error while building ibatis SqlSessionFactory: null

15:33:55,003 INFO  [stdout] (ServerService Thread Pool – 56)    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:744) ~[activiti-engine-5.19.0.jar:5.19.0]

15:33:55,003 INFO  [stdout] (ServerService Thread Pool – 56)    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:470) ~[activiti-engine-5.19.0.jar:5.19.0]

15:33:55,003 INFO  [stdout] (ServerService Thread Pool – 56)    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:440) ~[activiti-engine-5.19.0.jar:5.19.0]

15:33:55,003 INFO  [stdout] (ServerService Thread Pool – 56)    at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:65) ~[activiti-spring-5.19.0.jar:5.19.0]

15:33:55,004 INFO  [stdout] (ServerService Thread Pool – 56)    at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:60) ~[activiti-spring-5.19.0.jar:5.19.0]

15:33:55,004 INFO  [stdout] (ServerService Thread Pool – 56)    at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32) ~[activiti-spring-5.19.0.jar:5.19.0]

15:33:55,004 INFO  [stdout] (ServerService Thread Pool – 56)    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168) ~[spring-beans-4.2.0.RELEASE.jar:4.2.0.RELEASE]

15:33:55,004 INFO  [stdout] (ServerService Thread Pool – 56)    … 23 common frames omitted

15:33:55,004 INFO  [stdout] (ServerService Thread Pool – 56) Caused by: java.lang.NullPointerException: null
1 REPLY 1

vasile_dirla
Star Contributor
Star Contributor
Hi,
try adding a breakpoint in ProcessEngineConfigurationImpl.java in the method:   protected void initSqlSessionFactory()

so you can see step by step which call throws the exception and start investigating from here.