在类路径资源中定义名为“mongobee”的bean时出错

时间:2017-07-20 07:44:01

标签: java mongodb database-connection jhipster database

我不知道为什么会出现这个错误,我没有做任何事情,创建了一个新的流浪汉机器,最新版本的jhipster创建了新的微服务并启动了应用程序,我得到了下面提到的错误,有什么帮助吗?

    2017-07-20 07:36:58,144 ERROR restartedMain o.s.b.SpringApplication:771 - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongobee' defined in class path resource [com/nearbuy/ngservice/config/DatabaseConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.google.common.collect.Sets$SetView.iterator()Lcom/google/common/collect/UnmodifiableIterator;
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
        at com.nearbuy.ngservice.NgServiceApp.main(NgServiceApp.java:68)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.NoSuchMethodError: com.google.common.collect.Sets$SetView.iterator()Lcom/google/common/collect/UnmodifiableIterator;
        at org.reflections.Reflections.expandSuperTypes(Reflections.java:380)
        at org.reflections.Reflections.<init>(Reflections.java:126)
        at org.reflections.Reflections.<init>(Reflections.java:168)
        at org.reflections.Reflections.<init>(Reflections.java:141)
        at com.github.mongobee.utils.ChangeService.fetchChangeLogs(ChangeService.java:43)
        at com.github.mongobee.Mongobee.executeMigration(Mongobee.java:166)
        at com.github.mongobee.Mongobee.execute(Mongobee.java:153)
        at com.github.mongobee.Mongobee.afterPropertiesSet(Mongobee.java:123)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
        ... 19 common frames omitted

1 个答案:

答案 0 :(得分:1)

我将com.google.guava依赖项从版本18更改为版本22(从latest guava relase下载)和ERORR,如您提到的那样消失。

enter image description here