3 Replies Latest reply on Jun 23, 2010 2:22 AM by lalitbhatia

    Facing issue integrating Spring3 and jBPM4.3 - NPE at ProcessEngineImpl.checkDb()

    lalitbhatia

      Hi,

       

      M trying to integrate jBPM with Spring 3.0.3 but facing NullPointerException at ProcessEngineImpl.checkDb(ProcessEngineImpl.java:152).

      configuration files are attached.

       

      The error originated at following line in ProcessEngineImpl which returns null.

      userCommandService = (CommandService) processEngineWireContext.get(CommandService.NAME_TX_REQUIRED_COMMAND_SERVICE);

       

      Please help.

       

      Thanks

       

      -------------------------------------------------------

      Trace

      ----------------------------------------------------------

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'workflowService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jbpm.api.RepositoryService com.bankofamerica.crme.clientservice.service.impl.WorkflowServiceImpl.repositoryService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositoryService' defined in class path resource [eu/diversit/jbpm/spring/JbpmAutoSpringConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.RepositoryService eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.repositoryService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jbpmProcessEngine' defined in class path resource [eu/diversit/jbpm/spring/JbpmAutoSpringConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.processEngine()] threw exception; nested exception is java.lang.NullPointerException
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1064)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574)
          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
          at org.springframework.test.AbstractSingleSpringContextTests.createApplicationContext(AbstractSingleSpringContextTests.java:216)
          at org.springframework.test.AbstractSingleSpringContextTests.loadContextLocations(AbstractSingleSpringContextTests.java:192)
          at org.springframework.test.AbstractSingleSpringContextTests.loadContext(AbstractSingleSpringContextTests.java:172)
          at org.springframework.test.AbstractSpringContextTests.getContext(AbstractSpringContextTests.java:133)
          at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:101)
          at junit.framework.TestCase.runBare(TestCase.java:128)
          at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:79)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:120)
          at junit.framework.TestSuite.runTest(TestSuite.java:230)
          at junit.framework.TestSuite.run(TestSuite.java:225)
          at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jbpm.api.RepositoryService com.bankofamerica.crme.clientservice.service.impl.WorkflowServiceImpl.repositoryService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositoryService' defined in class path resource [eu/diversit/jbpm/spring/JbpmAutoSpringConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.RepositoryService eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.repositoryService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jbpmProcessEngine' defined in class path resource [eu/diversit/jbpm/spring/JbpmAutoSpringConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.processEngine()] threw exception; nested exception is java.lang.NullPointerException
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:507)
          at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:283)
          ... 29 more
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositoryService' defined in class path resource [eu/diversit/jbpm/spring/JbpmAutoSpringConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.RepositoryService eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.repositoryService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jbpmProcessEngine' defined in class path resource [eu/diversit/jbpm/spring/JbpmAutoSpringConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.processEngine()] threw exception; nested exception is java.lang.NullPointerException
          at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:572)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:973)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:879)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:838)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:780)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:697)
          at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
          ... 31 more
      Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.RepositoryService eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.repositoryService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jbpmProcessEngine' defined in class path resource [eu/diversit/jbpm/spring/JbpmAutoSpringConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.processEngine()] threw exception; nested exception is java.lang.NullPointerException
          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
          at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:561)
          ... 43 more
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jbpmProcessEngine' defined in class path resource [eu/diversit/jbpm/spring/JbpmAutoSpringConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.processEngine()] threw exception; nested exception is java.lang.NullPointerException
          at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:572)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:973)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:879)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
          at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:206)
          at eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration$$EnhancerByCGLIB$$4875eca7.processEngine(<generated>)
          at eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.repositoryService(JbpmAutoSpringConfiguration.java:109)
          at eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration$$EnhancerByCGLIB$$4875eca7.CGLIB$repositoryService$6(<generated>)
          at eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration$$EnhancerByCGLIB$$4875eca7$$FastClassByCGLIB$$179e31cf.invoke(<generated>)
          at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
          at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:210)
          at eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration$$EnhancerByCGLIB$$4875eca7.repositoryService(<generated>)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:142)
          ... 44 more
      Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.processEngine()] threw exception; nested exception is java.lang.NullPointerException
          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
          at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:561)
          ... 65 more
      Caused by: java.lang.NullPointerException
          at org.jbpm.pvm.internal.processengine.ProcessEngineImpl.checkDb(ProcessEngineImpl.java:152)
          at org.jbpm.pvm.internal.processengine.SpringProcessEngine.create(SpringProcessEngine.java:70)
          at org.jbpm.pvm.internal.cfg.ConfigurationImpl.buildProcessEngine(ConfigurationImpl.java:92)
          at eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration.processEngine(JbpmAutoSpringConfiguration.java:46)
          at eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration$$EnhancerByCGLIB$$4875eca7.CGLIB$processEngine$1(<generated>)
          at eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration$$EnhancerByCGLIB$$4875eca7$$FastClassByCGLIB$$179e31cf.invoke(<generated>)
          at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
          at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:210)
          at eu.diversit.jbpm.spring.JbpmAutoSpringConfiguration$$EnhancerByCGLIB$$4875eca7.processEngine(<generated>)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:142)
          ... 66 more