我有一个带有spring-boot-starter-web的spring-boot应用程序,然后在gradle文件中添加了spring-boot-starter-actuator。没有编译错误。但是,当我尝试运行服务器时,出现以下异常。
我的build.gradle内容(仅包含主要内容)
plugins {
id 'org.springframework.boot' version '2.1.3.RELEASE'
} ...........
compile "org.springframework.boot:spring-boot-starter-actuator"
compile group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: '1.1.3' .........
我的application.properties内容
server.port = 2128
spring.couchbase.env.timeouts.connect = 10000
spring.couchbase.env.timeouts.query = 180000
spring.couchbase.env.timeouts.view = 20000
spring.couchbase.bootstrap-hosts = localhost
spring.couchbase .bucket.name = localdb
spring.couchbase.bucket.password = *****
spring.data.couchbase.repositories.type = auto
spring.data.couchbase.auto-index
= true
服务器.compression.enabled = true服务器。 compression.mime-types = application / json,text / plain
spring.servlet.multipart.enabled = true
spring.servlet.multipart.maxFileSize = 50MB
spring.servlet.multipart.maxRequestSize = 50MB
我的Application.java
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
启动服务器时给出以下异常。
org.springframework.context.ApplicationContextException:无法启动Web服务器;无法启动Web服务器。 嵌套的异常是org.springframework.boot.web.server.WebServerException:无法启动嵌入式Tomcat,其 原因是:org.springframework.beans.factory.BeanCreationException:在类路径资源 WebMvcServletEndpointManagementContextConfiguration.class中创建名称为“ servletEndpointRegistrar”的bean时出错。:通过工厂方法实例化Bean失败;嵌套异常是org.springframework.beans.BeanInstantiationException: 无法实例化[org.springframework.boot.act.ateu.endpoint.web.ServletEndpointRegistrar]:工厂方法servletEndpointRegistrar抛出了异常; 嵌套的异常是org.springframework.beans.factory.UnsatisfiedDependencyException:在类路径资源创建名称为“ healthEndpoint”的bean时出错 org / springframework / boot / actuate / autoconfigure / health / HealthEndpointConfiguration.class]:通过方法“ healthEndpoint”参数1表示的不满意依赖关系; 嵌套的异常是org.springframework.beans.factory.BeanCreationException:在类路径资源[org / springframework / boot / actuate / autoconfigure / health / HealthIndicatorAutoConfiguration.class]中创建名称为'healthIndicatorRegistry'的bean时出错:通过工厂方法实例化Bean失败
有什么有用的提示吗?
在关闭默认的运行状况检查之后,我终于能够通过application.properties文件中的以下条目来启动应用程序
management.health.defaults.enabled=false
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句