Error creating bean with name 'mongobee', no such method iterator(). because com.google.guava dependency is on version 18 and method _iterator_ does not exist.
Update dependency to 22
v4.6.2.
This ticket has been closed as the guidelines are not followed.
Tickets must follow our Guidelines, as mentioned in:
We have also created a template on the "create a new ticket" page to help you follow those guidelines.
Open a new issue with proper details or update this issue with all details and request to reopen.
Issues opened without proper details will be closed without explanation.
If you have a question please use Stack Overflow for that. Tag the question with jhipster and someone will help you out there.
This helps us to keep our issue tracker clean. Also, Stack Overflow will give your query a larger audience.
Please paste jhipster info
output so that we can reproduce.
Executing jhipster:info
Options:
Welcome to the JHipster Information Sub-Generator
/home/tommaso/Work/jhipster/survant/analysismicroservice
└── [email protected]
##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
{ "generator-jhipster": { "promptValues": { "packageName": "it.eng.survant", "nativeLanguage": "en" }, "jhipsterVersion": "4.6.2", "baseName": "analysismicroservice", "packageName": "it.eng.survant", "packageFolder": "it/eng/survant", "serverPort": "8082", "authenticationType": "jwt", "hibernateCache": "no", "clusteredHttpSession": false, "websocket": false, "databaseType": "mongodb", "devDatabaseType": "mongodb", "prodDatabaseType": "mongodb", "searchEngine": false, "messageBroker": "kafka", "serviceDiscoveryType": "eureka", "buildTool": "gradle", "enableSocialSignIn": false, "jwtSecretKey": "replaced-by-jhipster-info", "enableTranslation": true, "applicationType": "microservice", "testFrameworks": [], "jhiPrefix": "jhi", "skipClient": true, "skipUserManagement": true, "nativeLanguage": "en", "languages": [ "en", "el", "it", "es" ], "clientPackageManager": "yarn" } }
entityName.json
files generated in the .jhipster
directory
JDL entity definitions
entity RelevantInformation (relevant_information) { createDate LocalDate, description String } paginate RelevantInformation with pager service RelevantInformation with serviceImpl microservice RelevantInformation with analysismicroservice
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
git version 2.7.4
node: v7.4.0
npm: 5.3.0
bower: 1.7.9
gulp:
[10:57:37] CLI version 1.3.0
[10:57:37] Local version 3.9.1
yeoman: 2.0.0
yarn: 0.21.3
Docker version 17.05.0-ce, build 89658be
docker-compose version 1.8.0, build unknown
Execution complete
OK, I have reproduced the bug in 4.6.2
stack trace
2017-08-01 15:52:21.838 DEBUG 9374 --- [ restartedMain] Mongobee dao : Index in collection dbchangelog was created 2017-08-01 15:52:21.851 INFO 9374 --- [ restartedMain] com.github.mongobee.Mongobee : Mongobee aqcuired process lock, starting the data migration sequence.. 2017-08-01 15:52:22.012 INFO 9374 --- [ restartedMain] com.github.mongobee.Mongobee : Mongobee is releasing process lock. 2017-08-01 15:52:22.016 WARN 9374 --- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongobee' defined in class path resource [it/eng/survant/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; 2017-08-01 15:52:22.046 ERROR 9374 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongobee' defined in class path resource [it/eng/survant/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 it.eng.survant.AnalysismicroserviceApp.main(AnalysismicroserviceApp.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.(Reflections.java:126) at org.reflections.Reflections. (Reflections.java:168) at org.reflections.Reflections. (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
@tommynicoletti would you want to submit a pull request?
no
Strangely, this does not happen with maven only with gradle.
No need to define an entity, no need for kafka.
.yo-rc.json
{ "generator-jhipster": { "promptValues": { "packageName": "it.eng.survant", "nativeLanguage": "en" }, "jhipsterVersion": "4.6.1", "baseName": "analysismicroservice", "packageName": "it.eng.survant", "packageFolder": "it/eng/survant", "serverPort": "8082", "authenticationType": "jwt", "hibernateCache": "no", "clusteredHttpSession": false, "websocket": false, "databaseType": "mongodb", "devDatabaseType": "mongodb", "prodDatabaseType": "mongodb", "searchEngine": false, "messageBroker": false, "serviceDiscoveryType": "eureka", "buildTool": "gradle", "enableSocialSignIn": false, "jwtSecretKey": "replaced-by-jhipster-info", "enableTranslation": true, "applicationType": "microservice", "testFrameworks": [], "jhiPrefix": "jhi", "skipClient": true, "skipUserManagement": true, "nativeLanguage": "en", "languages": [ "en", "el", "it", "es" ], "clientPackageManager": "yarn" } }
.
As I don't use neither mongodb nor gradle and as reporter does not seem to be interested, I'm tempted to put this on hold until I have more time.
I pinned version of guava to 18 as another method was removed in 19 and up. When I checked maven it resolved to 18 too. Can check it during the week again.
I just ran gradlew dependencies
and it showed guava is referenced 162 times in 7 different versions: 14.0.1, 15.0, 16.0, 16.0.1, 18.0, 19.0 and 20.0 !!!! It reminds me of managing commons-logging dep many years ago. Fortunately, our code does not depend on it directly, so we're not part of the problem ;)
So.....there is no solution for now?
I've tried the suggested fix with no luck.
It seems to break dependencies with com.google.common.util.concurrent.FutureFallback :(
Use maven if you can't fix it by yourself and cannot wait.
I've solved changing the dependencies to:
Cassandra? This issue is about Mongo...
@gmarziou I was wondering the same!
This issue doesn't make no sense (wtf is this with Cassandra instead of MongoDB??), and the original author doesn't want to contribute, let's close this...
No news, so closing this
Most helpful comment
I just ran
gradlew dependencies
and it showed guava is referenced 162 times in 7 different versions: 14.0.1, 15.0, 16.0, 16.0.1, 18.0, 19.0 and 20.0 !!!! It reminds me of managing commons-logging dep many years ago. Fortunately, our code does not depend on it directly, so we're not part of the problem ;)