服务器部署整合了elasticsearch的springboot项目后报错

这篇具有很好参考价值的文章主要介绍了服务器部署整合了elasticsearch的springboot项目后报错。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

        今天在服务器上面更新自己的项目的时候报错了

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'commentController': Unsatisfied dependency expressed through field 'commentService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'commentService': Unsatisfied dependency expressed through field 'discussPostService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'discussPostService': Unsatisfied dependency expressed through field 'discussPostRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'discussPostRepository' defined in com.newcoder.community.dao.elasticsearch.DiscussPostRepository defined in @EnableElasticsearchRepositories declared on ElasticsearchRepositoriesRegistrar.EnableElasticsearchRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository]: Constructor threw exception; nested exception is org.springframework.data.elasticsearch.UncategorizedElasticsearchException: java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed; nested exception is ElasticsearchException[java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed]; nested: ExecutionException[org.apache.http.ConnectionClosedException: Connection is closed]; nested: ConnectionClosedException[Connection is closed];
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.22.jar!/:5.3.22]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.22.jar!/:5.3.22]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.11.jar!/:2.6.11]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) [spring-boot-2.6.11.jar!/:2.6.11]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420) [spring-boot-2.6.11.jar!/:2.6.11]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-2.6.11.jar!/:2.6.11]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) [spring-boot-2.6.11.jar!/:2.6.11]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) [spring-boot-2.6.11.jar!/:2.6.11]
        at com.newcoder.community.SpringbootApplication.main(SpringbootApplication.java:24) [classes!/:0.0.1-SNAPSHOT]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [springboot-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) [springboot-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [springboot-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) [springboot-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'commentService': Unsatisfied dependency expressed through field 'discussPostService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'discussPostService': Unsatisfied dependency expressed through field 'discussPostRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'discussPostRepository' defined in com.newcoder.community.dao.elasticsearch.DiscussPostRepository defined in @EnableElasticsearchRepositories declared on ElasticsearchRepositoriesRegistrar.EnableElasticsearchRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository]: Constructor threw exception; nested exception is org.springframework.data.elasticsearch.UncategorizedElasticsearchException: java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed; nested exception is ElasticsearchException[java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed]; nested: ExecutionException[org.apache.http.ConnectionClosedException: Connection is closed]; nested: ConnectionClosedException[Connection is closed];
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656) ~[spring-beans-5.3.22.jar!/:5.3.22]
        ... 28 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'discussPostService': Unsatisfied dependency expressed through field 'discussPostRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'discussPostRepository' defined in com.newcoder.community.dao.elasticsearch.DiscussPostRepository defined in @EnableElasticsearchRepositories declared on ElasticsearchRepositoriesRegistrar.EnableElasticsearchRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository]: Constructor threw exception; nested exception is org.springframework.data.elasticsearch.UncategorizedElasticsearchException: java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed; nested exception is ElasticsearchException[java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed]; nested: ExecutionException[org.apache.http.ConnectionClosedException: Connection is closed]; nested: ConnectionClosedException[Connection is closed];
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656) ~[spring-beans-5.3.22.jar!/:5.3.22]
        ... 42 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'discussPostRepository' defined in com.newcoder.community.dao.elasticsearch.DiscussPostRepository defined in @EnableElasticsearchRepositories declared on ElasticsearchRepositoriesRegistrar.EnableElasticsearchRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository]: Constructor threw exception; nested exception is org.springframework.data.elasticsearch.UncategorizedElasticsearchException: java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed; nested exception is ElasticsearchException[java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed]; nested: ExecutionException[org.apache.http.ConnectionClosedException: Connection is closed]; nested: ConnectionClosedException[Connection is closed];
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656) ~[spring-beans-5.3.22.jar!/:5.3.22]
        ... 56 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository]: Constructor threw exception; nested exception is org.springframework.data.elasticsearch.UncategorizedElasticsearchException: java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed; nested exception is ElasticsearchException[java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed]; nested: ExecutionException[org.apache.http.ConnectionClosedException: Connection is closed]; nested: ConnectionClosedException[Connection is closed];
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:224) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.data.repository.core.support.RepositoryFactorySupport.lambda$instantiateClass$5(RepositoryFactorySupport.java:579) ~[spring-data-commons-2.6.6.jar!/:2.6.6]
        at java.util.Optional.map(Optional.java:215) ~[na:1.8.0_121]
        at org.springframework.data.repository.core.support.RepositoryFactorySupport.instantiateClass(RepositoryFactorySupport.java:579) ~[spring-data-commons-2.6.6.jar!/:2.6.6]
        at org.springframework.data.repository.core.support.RepositoryFactorySupport.getTargetRepositoryViaReflection(RepositoryFactorySupport.java:544) ~[spring-data-commons-2.6.6.jar!/:2.6.6]
        at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory.getTargetRepository(ElasticsearchRepositoryFactory.java:74) ~[spring-data-elasticsearch-4.3.6.jar!/:4.3.6]
        at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:325) ~[spring-data-commons-2.6.6.jar!/:2.6.6]
        at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:323) ~[spring-data-commons-2.6.6.jar!/:2.6.6]
        at org.springframework.data.util.Lazy.getNullable(Lazy.java:231) ~[spring-data-commons-2.6.6.jar!/:2.6.6]
        at org.springframework.data.util.Lazy.get(Lazy.java:115) ~[spring-data-commons-2.6.6.jar!/:2.6.6]
        at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:329) ~[spring-data-commons-2.6.6.jar!/:2.6.6]
        at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean.afterPropertiesSet(ElasticsearchRepositoryFactoryBean.java:69) ~[spring-data-elasticsearch-4.3.6.jar!/:4.3.6]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.22.jar!/:5.3.22]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.22.jar!/:5.3.22]
        ... 66 common frames omitted
Caused by: org.springframework.data.elasticsearch.UncategorizedElasticsearchException: java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed; nested exception is ElasticsearchException[java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed]; nested: ExecutionException[org.apache.http.ConnectionClosedException: Connection is closed]; nested: ConnectionClosedException[Connection is closed];
        at org.springframework.data.elasticsearch.core.ElasticsearchExceptionTranslator.translateExceptionIfPossible(ElasticsearchExceptionTranslator.java:72) ~[spring-data-elasticsearch-4.3.6.jar!/:4.3.6]
        at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.translateException(ElasticsearchRestTemplate.java:427) ~[spring-data-elasticsearch-4.3.6.jar!/:4.3.6]
        at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.execute(ElasticsearchRestTemplate.java:410) ~[spring-data-elasticsearch-4.3.6.jar!/:4.3.6]
        at org.springframework.data.elasticsearch.core.RestIndexTemplate.doExists(RestIndexTemplate.java:103) ~[spring-data-elasticsearch-4.3.6.jar!/:4.3.6]
        at org.springframework.data.elasticsearch.core.AbstractIndexTemplate.exists(AbstractIndexTemplate.java:134) ~[spring-data-elasticsearch-4.3.6.jar!/:4.3.6]
        at org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository.<init>(SimpleElasticsearchRepository.java:92) ~[spring-data-elasticsearch-4.3.6.jar!/:4.3.6]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_121]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_121]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_121]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_121]
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211) ~[spring-beans-5.3.22.jar!/:5.3.22]
        ... 79 common frames omitted
Caused by: org.elasticsearch.ElasticsearchException: java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed
        at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2078) ~[elasticsearch-rest-high-level-client-7.15.2.jar!/:7.15.2]
        at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1732) ~[elasticsearch-rest-high-level-client-7.15.2.jar!/:7.15.2]
        at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1717) ~[elasticsearch-rest-high-level-client-7.15.2.jar!/:7.15.2]
        at org.elasticsearch.client.IndicesClient.exists(IndicesClient.java:963) ~[elasticsearch-rest-high-level-client-7.15.2.jar!/:7.15.2]
        at org.springframework.data.elasticsearch.core.RestIndexTemplate.lambda$doExists$2(RestIndexTemplate.java:103) ~[spring-data-elasticsearch-4.3.6.jar!/:4.3.6]
        at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.execute(ElasticsearchRestTemplate.java:408) ~[spring-data-elasticsearch-4.3.6.jar!/:4.3.6]
        ... 87 common frames omitted
Caused by: java.util.concurrent.ExecutionException: org.apache.http.ConnectionClosedException: Connection is closed
        at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.getValue(BaseFuture.java:262) ~[elasticsearch-7.15.2.jar!/:7.15.2]
        at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.java:249) ~[elasticsearch-7.15.2.jar!/:7.15.2]
        at org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:76) ~[elasticsearch-7.15.2.jar!/:7.15.2]
        at org.elasticsearch.client.RestHighLevelClient.performClientRequest(RestHighLevelClient.java:2075) ~[elasticsearch-rest-high-level-client-7.15.2.jar!/:7.15.2]
        ... 92 common frames omitted
Caused by: org.apache.http.ConnectionClosedException: Connection is closed
        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.endOfInput(HttpAsyncRequestExecutor.java:356) ~[httpcore-nio-4.4.15.jar!/:4.4.15]
        at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:261) ~[httpcore-nio-4.4.15.jar!/:4.4.15]
        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:87) ~[httpasyncclient-4.1.5.jar!/:4.1.5]
        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:40) ~[httpasyncclient-4.1.5.jar!/:4.1.5]
        at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114) ~[httpcore-nio-4.4.15.jar!/:4.4.15]
        at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162) ~[httpcore-nio-4.4.15.jar!/:4.4.15]
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337) ~[httpcore-nio-4.4.15.jar!/:4.4.15]
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315) ~[httpcore-nio-4.4.15.jar!/:4.4.15]
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276) ~[httpcore-nio-4.4.15.jar!/:4.4.15]
        at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104) ~[httpcore-nio-4.4.15.jar!/:4.4.15]
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:591) ~[httpcore-nio-4.4.15.jar!/:4.4.15]
        at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_121]

报错太长了,我提炼了一下,主要是说bean注入失败,各种service和controller全都寄了,后来看到里面有个elasticsearchRepository,又因为刚整合了elasticsearch,所以基本上可以确定问题就是出在elasticsearch上。

        这里不得不说elasticsearch还是挺重视安全的,不能用root直接运行,要新建一个用户,并且把elasticsearch的拥有者转给这个用户才行。

        然后我就先检查了配置文件,按理来说端口data,logs的路径什么的也都是默认的,基本上开箱即用。

服务器部署整合了elasticsearch的springboot项目后报错,elasticsearch,服务器,spring boot

        没什么问题,于是我尝试用服务器本地访问服务器的9200端口,好家伙,果然不行。 

服务器部署整合了elasticsearch的springboot项目后报错,elasticsearch,服务器,spring boot

然后我又去试了下curl

curl -X GET "119.91.222.49:9200/_cat/health?v"

果然也不行

服务器部署整合了elasticsearch的springboot项目后报错,elasticsearch,服务器,spring boot

最后千c万c最后发现了还是配置文件的问题,elasticsearch.yml有个这个

xpack.security.enabled: true

 把这个改成false

服务器部署整合了elasticsearch的springboot项目后报错,elasticsearch,服务器,spring boot

嗨嗨,解决了捏!!! 

 (菜鸡在学习路上的一点小体会,大佬轻喷!)文章来源地址https://www.toymoban.com/news/detail-752267.html

到了这里,关于服务器部署整合了elasticsearch的springboot项目后报错的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • SpringBoot部署一 Windows服务器部署

    一、概要         1.1、项目打包成jar包 二、部署运行         2.1、方法一 java -jar 命令         2.2、方法二 Service 服务部署 三、总结  #Spring Boot官方的部署说明 Deploying Spring Boot Applications 一、概要 SpringBoot 内置了Tomcat服务器,目的是为了简化部署的难度,直接用 java

    2024年02月02日
    浏览(58)
  • springboot整合https使用自签名证书实现浏览器和服务器之间的双向认证

    效果描述: 本地环境  两台以上电脑  可以实现安装客户端证书的电脑可以访问springboot启动项目,没有安装客户端证书的电脑无法访问springboot启动项目 1.操作:需要安装openssl工具 工具包:Win64OpenSSL_Light-3_3_0.exe 或者Win64OpenSSL_Light-3_3_0.msi  官网:[ Downloads ] - /source/index.html

    2024年04月28日
    浏览(50)
  • SpringBoot项目部署到服务器

    此次用到了三个软件:IDEA、WinSCP、FinalShell 服务器的性能相比较本地有着更大的内存空间,运行程序代码会更加的快捷方便,而且服务器开启后,程序放在那边让它跑就好了。 一般的web项目想要放到服务器上运行的话,需要首先在服务器上装一个Tomcat,然后将项目打包成wa

    2024年02月04日
    浏览(58)
  • springboot项目网站部署到服务器

            用eclipse跟着教程做了一个网站,java语言,springboot项目。在本地电脑上运行成功后,想把它部署到线上,通过网络访问。下面是我自己作为新手自己摸索出来的一个方法,供读者参考。 目录 1. jar包  2. 服务器 3. jdk 和 Tomcat 4. 部署网站 (1)本地电脑远程连接服务器

    2024年02月04日
    浏览(44)
  • Idea+maven+springboot项目搭建系列--2 整合Rabbitmq完成客户端&服务器端消息收发

    前言:本文通过springBoot -maven 框架,对Rabbitmq 进行整合,完成客户端消息的发送和消费; 1 为什么要使用Rabbitmq: RabbitMQ 是一个可靠的、灵活的、开源的消息中间件,具有以下优点: 异步通信:RabbitMQ 支持异步通信,使得消息发送者和接收者能够异步处理,提高了系统性能和

    2024年02月07日
    浏览(57)
  • 阿里云服务器部署安装hadoop与elasticsearch踩坑笔记

    2023-09-12 14:00——2023.09.13 20:06 目录 00、软件版本 01、阿里云服务器部署hadoop 1.1、修改四个配置文件 1.1.1、core-site.xml 1.1.2、hdfs-site.xml 1.1.3、mapred-site.xml 1.1.4、yarn-site.xml 1.2、修改系统/etc/hosts文件与系统变量 1.2.1、修改主机名解析文件/etc/hosts 1.2.2、修改系统环境变量/etc/profil

    2024年02月08日
    浏览(37)
  • Nacos基础(2)——nacos的服务器和命名空间 & springBoot整合nacos & 多个nacos配置的情况

    1.nacos是服务发现、配置管理和服务管理平台; 2.nacos的命名空间–组–服务; 3.springboot整合nacos,版本的对应; 4.引入多个nacos配置的方法; 用户 服务管理,命名空间,集群管理 命名空间唯一id 自定义命名空间,公共命名空间 如何找到配置文件 新建配置 层级关系 bootstrap

    2024年02月03日
    浏览(45)
  • 【Springboot】--如何将springboot+vue项目部署到云服务器?

    目录 一、准备工作 1、购买云服务器 2、获取面板地址 二、jdk和数据库 1、安装环境  2、配置jdk环境变量 3、java版本的问题 4、添加数据库 三、前端部署  1、vue 2、创建站点 ​编辑 四、后端部署 1、application.yml 2、idea打包 3、运行jar包 4、开放端口 五、可能遇到的问题 1、4

    2024年04月27日
    浏览(36)
  • Linux | 将SpringBoot+Vue项目部署到服务器上

    大家好,我是初心,咱们又见面了!今天想跟大家分享的内容是如何部署 SpringBoot+Vue的前后端分离项目到服务器上。 本篇文章收录于 初心 的 Linux教程 专栏。 🏠 个人主页:初心%个人主页 🧑 个人简介:大家好,我是初心,和大家共同努力 💕 座右铭:理想主义的花,终究

    2024年02月04日
    浏览(40)
  • 如何用docker在自己服务器上部署springboot项目

    一、将springboot项目打包 1、maven clean项目 2、maven package项目 打包成功之后生成jar文件(在target目录下) 3、为Java创建Dockerfile 引入jdk8的Docker镜像 FROM openjdk:8 为了使运行其余命令时更容易,让我们设置映像的工作目录。这将指示Docker使用此路径作为所有后续命令的默认位置。通

    2024年02月04日
    浏览(50)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包