Closed HCN9 closed 5 months ago
Please upgrade to 2.7.1
[root@localhost ~]# docker logs jmalcloud
.__ . ____ ____ ____
| | | \/ | / \ | | / || | / \ | | | | | \
| | | \ / | / ^ \ | | | ,----'| | | | | | | | | | | .--. |
.--. | | | |\/| | / /_\ \ | | | | | | | | | | | | | | | | | |
| `--' | | | | | / ___ \ | ----.|
----.| ----.|
--' | | `--' | | '--' |
__/ || || // _\ || __||___| _/ _____/ |___/
:: jmalcloud :: (v2.7.1) :: Spring Boot :: (v3.2.4) :: JDK Version :: (v17.0.7)
2024-04-15 10:10:05.297 |ERROR |main |MongoClientConfig.java:56 |com.jmal.clouddisk.config.MongoClientConfig |mongo: Name or service not known
java.net.UnknownHostException: mongo: Name or service not known
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(Unknown Source)
at java.base/java.net.InetAddress.getAddressesFromNameService(Unknown Source)
at java.base/java.net.InetAddress$NameServiceAddresses.get(Unknown Source)
at java.base/java.net.InetAddress.getAllByName0(Unknown Source)
at java.base/java.net.InetAddress.getAllByName(Unknown Source)
at java.base/java.net.InetAddress.getAllByName(Unknown Source)
at java.base/java.net.InetAddress.getByName(Unknown Source)
at com.jmal.clouddisk.config.MongoClientConfig.domainResolver(MongoClientConfig.java:53)
at com.jmal.clouddisk.config.MongoClientConfig.lambda$configureClientSettings$0(MongoClientConfig.java:81)
at com.mongodb.MongoClientSettings$Builder.applyToClusterSettings(MongoClientSettings.java:345)
at com.jmal.clouddisk.config.MongoClientConfig.configureClientSettings(MongoClientConfig.java:79)
at org.springframework.data.mongodb.config.MongoConfigurationSupport.mongoClientSettings(MongoConfigurationSupport.java:227)
at org.springframework.data.mongodb.config.AbstractMongoClientConfiguration.mongoClient(AbstractMongoClientConfiguration.java:55)
at org.springframework.data.mongodb.config.AbstractMongoClientConfiguration.mongoDbFactory(AbstractMongoClientConfiguration.java:78)
at com.jmal.clouddisk.config.MongoClientConfig$$SpringCGLIB$$0.CGLIB$mongoDbFactory$5(
请问是从2.5.0 升级到2.7.0吗, 看看docker-compose.yml文件
[root@localhost ~]# docker logs jmalcloud .__ . ____ ____ ____ | | | \/ | / \ | | / || | / \ | | | | | \ | | | \ / | / ^ \ | | | ,----'| | | | | | | | | | | .--. | .--. | | | |\/| | / /_\ \ | | | | | | | | | | | | | | | | | | | `--' | | | | | / ___ \ |
----.|
----.|----.|
--' | | `--' | | '--' | __/ || || // _\ || __||___| _/ _____/ |___/:: jmalcloud :: (v2.5.0) :: Spring Boot :: (v3.0.3) :: JDK Version :: (v17.0.6)
Exception in thread "pool-2-thread-1" org.springframework.dao.DataAccessResourceFailureException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=mongo:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: mongo}, caused by {java.net.UnknownHostException: mongo}}] at org.springframework.data.mongodb.core.MongoExceptionTranslator.translateExceptionIfPossible(MongoExceptionTranslator.java:91) at org.springframework.data.mongodb.core.MongoTemplate.potentiallyConvertRuntimeException(MongoTemplate.java:2808) at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:574) at org.springframework.data.mongodb.core.MongoTemplate.doExactCount(MongoTemplate.java:1136) at org.springframework.data.mongodb.core.MongoTemplate.doCount(MongoTemplate.java:1108) at org.springframework.data.mongodb.core.MongoTemplate$ExistsCallback.doInCollection(MongoTemplate.java:2913) at org.springframework.data.mongodb.core.MongoTemplate$ExistsCallback.doInCollection(MongoTemplate.java:2899) at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:572) at org.springframework.data.mongodb.core.MongoTemplate.exists(MongoTemplate.java:816) at org.springframework.data.mongodb.core.MongoTemplate.exists(MongoTemplate.java:801) at com.jmal.clouddisk.service.impl.MenuService.lambda$init$0(MenuService.java:63) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) at java.base/java.util.concurrent.CountedCompleter.exec(Unknown Source) at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=mongo:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: mongo}, caused by {java.net.UnknownHostException: mongo}}] at com.mongodb.internal.connection.BaseCluster.getDescription(BaseCluster.java:184) at com.mongodb.internal.connection.SingleServerCluster.getDescription(SingleServerCluster.java:46) at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:144) at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:101) at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.getClientSession(MongoClientDelegate.java:291) at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:183) at com.mongodb.client.internal.MongoCollectionImpl.executeCount(MongoCollectionImpl.java:224) at com.mongodb.client.internal.MongoCollectionImpl.countDocuments(MongoCollectionImpl.java:194) at org.springframework.data.mongodb.core.MongoTemplate.lambda$doExactCount$15(MongoTemplate.java:1137) at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:572) ... 18 more 2024-04-15 09:58:14.072 |WARN |main |AbstractApplicationContext.java:592 |org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext |Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userSettingController': Unsatisfied dependency expressed through field 'settingService': Error creating bean with name 'settingService': Invocation of init method failed 2024-04-15 09:58:14.211 |ERROR |main |SpringApplication.java:822 |org.springframework.boot.SpringApplication |Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userSettingController': Unsatisfied dependency expressed through field 'settingService': Error creating bean with name 'settingService': Invocation of init method failed at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:712) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:692) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:133) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:481) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1398) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:961) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) at com.jmal.clouddisk.ClouddiskApplication.main(ClouddiskApplication.java:22) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) at org.springframework.boot.loader.Launcher.launch(Launcher.java:95) at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'settingService': Invocation of init method failed at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:195) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:421) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1744) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1405) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1325) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:709) ... 26 common frames omitted Caused by: org.springframework.dao.DataAccessResourceFailureException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=mongo:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: mongo}, caused by {java.net.UnknownHostException: mongo}}] at org.springframework.data.mongodb.core.MongoExceptionTranslator.translateExceptionIfPossible(MongoExceptionTranslator.java:91) at org.springframework.data.mongodb.core.MongoTemplate.potentiallyConvertRuntimeException(MongoTemplate.java:2808) at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:574) at org.springframework.data.mongodb.core.MongoTemplate.doExactCount(MongoTemplate.java:1136) at org.springframework.data.mongodb.core.MongoTemplate.doCount(MongoTemplate.java:1108) at org.springframework.data.mongodb.core.MongoTemplate$ExistsCallback.doInCollection(MongoTemplate.java:2913) at org.springframework.data.mongodb.core.MongoTemplate$ExistsCallback.doInCollection(MongoTemplate.java:2899) at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:572) at org.springframework.data.mongodb.core.MongoTemplate.exists(MongoTemplate.java:816) at org.springframework.data.mongodb.core.MongoTemplate.exists(MongoTemplate.java:801) at com.jmal.clouddisk.service.impl.MenuService.existsMenu(MenuService.java:301) at com.jmal.clouddisk.service.impl.SettingService.init(SettingService.java:84) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:424) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:368) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:192) ... 38 common frames omitted Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=mongo:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: mongo}, caused by {java.net.UnknownHostException: mongo}}] at com.mongodb.internal.connection.BaseCluster.getDescription(BaseCluster.java:184) at com.mongodb.internal.connection.SingleServerCluster.getDescription(SingleServerCluster.java:46) at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:144) at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:101) at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.getClientSession(MongoClientDelegate.java:291) at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:183) at com.mongodb.client.internal.MongoCollectionImpl.executeCount(MongoCollectionImpl.java:224) at com.mongodb.client.internal.MongoCollectionImpl.countDocuments(MongoCollectionImpl.java:194) at org.springframework.data.mongodb.core.MongoTemplate.lambda$doExactCount$15(MongoTemplate.java:1137) at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:572) ... 54 common frames omitted