天天看點

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

原因還是沒查明,隻是更換了一個資料庫就好了。