当前位置: 首页 > 知识库问答 >
问题:

spring-boot-starter-actuator的Spring boot应用程序提供“无法启动Tomcat”异常

史默
2023-03-14

我有了我的spring-boot-starter-web,然后我将spring-boot-starter-actuator添加到gradle文件中。没有编译错误。但是当我尝试运行服务器时,它会出现以下异常。

我的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'  .........
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
server.compression.enabled=true
server.compression.mime-types=application/json,text/plain
spring.servlet.multipart.enabled=true
spring.servlet.multipart.maxFileSize=50MB
spring.servlet.multipart.maxRequestSize=50MB
@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
org.springframework.context.ApplicationContextException: Unable to start web server;            
nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource 
WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed;    nested exception is org.springframework.beans.BeanInstantiationException: 
Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; 
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthEndpoint' defined in class path resource 
org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 1; 
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthIndicatorRegistry' defined in class path resource  [org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorAutoConfiguration.class]: Bean instantiation via factory method failed

共有1个答案

贺方伟
2023-03-14

在通过application.properties文件中的以下条目关闭默认运行状况检查后,我终于能够启动应用程序

management.health.defaults.enabled=false 
 类似资料:
  • 我有了我的spring-boot应用程序,带有spring-boot-starter-web,然后我将Spring-Boot-Starter-Actutor添加到gradle文件中。没有编译错误。但当我尝试运行服务器时,它会出现以下异常。 我的Build.Gradle内容(仅包含主要内容) 我的应用程序.属性内容 我的应用程序.java 启动服务器时出现以下异常。

  • 我的程序编译了所有内容,我没有出错,但我实际上期望tomcat应该永久在端口8080上。输出中也没有Spring。在另一个项目中,我做的一切都很好。谢谢你帮助我。 我的父母: 我的tarter.class: 我的Starter-Pom: 控制台输出: 然后什么都不会发生了。谢谢你的帮助。

  • 问题内容: 我有一个使用Spring Boot Actuator的Java后端,但不会在Digitalocean Ubuntu VPS上启动。同一应用程序可以在我的Mac和另一台Ubuntu PC上很好地运行。 它开始初始化,但每次都在同一点停止(无例外,只是挂起)。如果我尝试在此时停止它,它将不会带回外壳。 这是输出: 这是在:之后的输出 有人遇到过同样的问题吗?你们能帮我吗? 这里有线程转储(

  • 想要基于spring boot starter mail实现简单邮件发送器解决方案在添加依赖项并设置属性后,我试图运行应用程序,但出现了错误。我认为值得注意的是,我没有,也不打算实现Spring Cloud。只有邮件服务。不明白为什么spring boot需要来自这些包的一些服务。 尝试了不同版本的依赖关系,定义了一些@Beans,但不认为这是问题所在 日志: 只想通过smtp发送电子邮件。gma

  • 我已经在tomcat服务器上安装了应用程序。在启动和加载应用程序的过程中,我有以下堆栈跟踪的错误。如何解决这个问题? apache-tomcat-7.0.47/webapps/petclinic 2016年10月27日下午12:14:36 org。阿帕奇。卡塔琳娜。果心标准上下文起始内部 严重:ServletContainerInitializer处理javax时出错。servlet。Servle