天天看点

Error creating bean with name ‘processEngine‘: FactoryBean threw exception on object creation; nest

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:178) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:101) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1674) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:1248) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:330) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1255) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1175) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760) ~[spring-beans-5.1.13.RELEASE.jar:5.1.13.RELEASE]
	... 69 common frames omitted

           

记录下问题,这是我学习activiti遇到的第二个问题,在之前我练习创建了7.1.0.M2的demo,然后在GitHub下载里一个多案例项目,对其简单的修改错误代码后,直接启动测试。然后就报这堆错误,先是各种mvn clean compile,编译没有问题后,还是不行。

发现该demo的pom使用的是7.1.0.M6版本,修改低版本不行,有其他错误。

因为之前已经创建好数据库,随手改了该demo的数据源配置,直接脸上我之前的数据库,这时就出现这个问题了。

经过变更一个新数据库测试,还是不行。

找到已经成功的案例,比对文件后发现,有一条命令必须加上。否则无法自动创表。

nullCatalogMeansCurrent=true

这条命令加在spring.datasource.url 这里。

应该就是act_ge_property这张表引起的问题,修改过

spring.activiti.database-schema-update=false

配置,不然他创建表,失败!

Error creating bean with name ‘processEngine‘: FactoryBean threw exception on object creation; nest

原因还是没查明,只是更换了一个数据库就好了。