解决springboot 新版本 2.1.6 spring-boot-starter-actuator 访问报404
pom.xml
-
<?xml version="1.0" encoding="UTF-8"?>
-
-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
<modelVersion>4.0.0</modelVersion>
-
-
<artifactId>demoservice</artifactId>
-
-
<name>demoservice</name>
-
<!-- FIXME change it to the project's website -->
-
<url>http://www.example.com</url>
-
-
-
<parent>
-
<groupId>org.springframework.boot</groupId>
-
<artifactId>spring-boot-starter-parent</artifactId>
-
<version>2.1.6.RELEASE</version>
-
<relativePath/> <!-- lookup parent from repository -->
-
</parent>
-
-
<properties>
-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-
<maven.compiler.source>1.8</maven.compiler.source>
-
<maven.compiler.target>1.8</maven.compiler.target>
-
<spring-cloud.version>Greenwich.SR2</spring-cloud.version>
-
</properties>
-
<dependencyManagement>
-
<dependencies>
-
<dependency>
-
<groupId>org.springframework.cloud</groupId>
-
<artifactId>spring-cloud-dependencies</artifactId>
-
<version>${spring-cloud.version}</version>
-
<type>pom</type>
-
<scope>import</scope>
-
</dependency>
-
</dependencies>
-
</dependencyManagement>
-
-
<dependencies>
-
<dependency>
-
<groupId>org.springframework.boot</groupId>
-
<artifactId>spring-boot-starter-web</artifactId>
-
</dependency>
-
<dependency>
-
<groupId>org.springframework.boot</groupId>
-
<artifactId>spring-boot-starter-actuator</artifactId>
-
</dependency>
-
<dependency>
-
<groupId>org.springframework.boot</groupId>
-
<artifactId>spring-boot-starter-test</artifactId>
-
<scope>test</scope>
-
</dependency>
-
</dependencies>
-
-
<build>
-
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
-
<plugins>
-
<plugin>
-
<groupId>org.springframework.boot</groupId>
-
<artifactId>spring-boot-maven-plugin</artifactId>
-
</plugin>
-
</plugins>
-
</pluginManagement>
-
</build>
-
</project>
application.yml
-
server:
-
# 适用于本地调试,防止端口冲突
-
port: ${random.int[8000,9000]}
-
-
# springboot 2.1.6 引入actuator需要声明导出的接口,否则不会像早期版本那样自动映射出去
-
management:
-
endpoints:
-
web:
-
exposure:
-
include: "*"
启动服务,输出日志:
-
. ____ _ __ _ _
-
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
-
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
-
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
-
' |____| .__|_| |_|_| |_\__, | / / / /
-
=========|_|==============|___/=/_/_/_/
-
:: Spring Boot :: (v2.1.6.RELEASE)
-
-
2019-08-20 16:55:15.502 INFO 2320 --- [ main] com.hknaruto.DemoServiceApp : Starting DemoServiceApp on localhost.localdomain with PID 2320 (/home/yeqiang/IdeaProjects/springclouddemo/demoservice/target/classes started by yeqiang in /home/yeqiang/IdeaProjects/springclouddemo)
-
2019-08-20 16:55:15.514 INFO 2320 --- [ main] com.hknaruto.DemoServiceApp : No active profile set, falling back to default profiles: default
-
2019-08-20 16:55:16.825 INFO 2320 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8073 (http)
-
2019-08-20 16:55:16.849 INFO 2320 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
-
2019-08-20 16:55:16.849 INFO 2320 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.21]
-
2019-08-20 16:55:16.929 INFO 2320 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
-
2019-08-20 16:55:16.929 INFO 2320 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1332 ms
-
2019-08-20 16:55:17.400 INFO 2320 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
-
2019-08-20 16:55:17.616 INFO 2320 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 15 endpoint(s) beneath base path '/actuator'
-
2019-08-20 16:55:17.684 INFO 2320 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8073 (http) with context path ''
-
2019-08-20 16:55:17.686 INFO 2320 --- [ main] com.hknaruto.DemoServiceApp : Started DemoServiceApp in 2.63 seconds (JVM running for 3.01)
-
2019-08-20 16:55:30.432 INFO 2320 --- [nio-8073-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
-
2019-08-20 16:55:30.432 INFO 2320 --- [nio-8073-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
-
2019-08-20 16:55:30.439 INFO 2320 --- [nio-8073-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 7 ms
访问:http://127.0.0.1:8073/actuator 得到:
-
{
-
"_links": {
-
"self": {
-
"href": "http://127.0.0.1:8073/actuator",
-
"templated": false
-
},
-
"auditevents": {
-
"href": "http://127.0.0.1:8073/actuator/auditevents",
-
"templated": false
-
},
-
"beans": {
-
"href": "http://127.0.0.1:8073/actuator/beans",
-
"templated": false
-
},
-
"caches-cache": {
-
"href": "http://127.0.0.1:8073/actuator/caches/{cache}",
-
"templated": true
-
},
-
"caches": {
-
"href": "http://127.0.0.1:8073/actuator/caches",
-
"templated": false
-
},
-
"health-component": {
-
"href": "http://127.0.0.1:8073/actuator/health/{component}",
-
"templated": true
-
},
-
"health": {
-
"href": "http://127.0.0.1:8073/actuator/health",
-
"templated": false
-
},
-
"health-component-instance": {
-
"href": "http://127.0.0.1:8073/actuator/health/{component}/{instance}",
-
"templated": true
-
},
-
"conditions": {
-
"href": "http://127.0.0.1:8073/actuator/conditions",
-
"templated": false
-
},
-
"configprops": {
-
"href": "http://127.0.0.1:8073/actuator/configprops",
-
"templated": false
-
},
-
"env-toMatch": {
-
"href": "http://127.0.0.1:8073/actuator/env/{toMatch}",
-
"templated": true
-
},
-
"env": {
-
"href": "http://127.0.0.1:8073/actuator/env",
-
"templated": false
-
},
-
"info": {
-
"href": "http://127.0.0.1:8073/actuator/info",
-
"templated": false
-
},
-
"loggers": {
-
"href": "http://127.0.0.1:8073/actuator/loggers",
-
"templated": false
-
},
-
"loggers-name": {
-
"href": "http://127.0.0.1:8073/actuator/loggers/{name}",
-
"templated": true
-
},
-
"heapdump": {
-
"href": "http://127.0.0.1:8073/actuator/heapdump",
-
"templated": false
-
},
-
"threaddump": {
-
"href": "http://127.0.0.1:8073/actuator/threaddump",
-
"templated": false
-
},
-
"metrics": {
-
"href": "http://127.0.0.1:8073/actuator/metrics",
-
"templated": false
-
},
-
"metrics-requiredMetricName": {
-
"href": "http://127.0.0.1:8073/actuator/metrics/{requiredMetricName}",
-
"templated": true
-
},
-
"scheduledtasks": {
-
"href": "http://127.0.0.1:8073/actuator/scheduledtasks",
-
"templated": false
-
},
-
"httptrace": {
-
"href": "http://127.0.0.1:8073/actuator/httptrace",
-
"templated": false
-
},
-
"mappings": {
-
"href": "http://127.0.0.1:8073/actuator/mappings",
-
"templated": false
-
}
-
}
-
}
说明:
1. 响应内容经过手动json格式化
2. json内容显示了所有支持的导出方法,与老版本有一定差异
访问mapping接口,http://127.0.0.1:8073/actuator/mappings 响应如下:
-
{
-
"contexts": {
-
"application": {
-
"mappings": {
-
"dispatcherServlets": {
-
"dispatcherServlet": [{
-
"handler": "ResourceHttpRequestHandler [class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/], ServletContext resource [/], class path resource []]",
-
"predicate": "/**/favicon.ico",
-
"details": null
-
}, {
-
"handler": "Actuator web endpoint 'auditevents'",
-
"predicate": "{GET /actuator/auditevents, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/auditevents"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'beans'",
-
"predicate": "{GET /actuator/beans, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/beans"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'caches-cache'",
-
"predicate": "{DELETE /actuator/caches/{cache}, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["DELETE"],
-
"params": [],
-
"patterns": ["/actuator/caches/{cache}"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'caches'",
-
"predicate": "{GET /actuator/caches, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/caches"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'caches'",
-
"predicate": "{DELETE /actuator/caches}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["DELETE"],
-
"params": [],
-
"patterns": ["/actuator/caches"],
-
"produces": []
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'caches-cache'",
-
"predicate": "{GET /actuator/caches/{cache}, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/caches/{cache}"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'health-component'",
-
"predicate": "{GET /actuator/health/{component}, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/health/{component}"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'health'",
-
"predicate": "{GET /actuator/health, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/health"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'health-component-instance'",
-
"predicate": "{GET /actuator/health/{component}/{instance}, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/health/{component}/{instance}"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'conditions'",
-
"predicate": "{GET /actuator/conditions, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/conditions"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'configprops'",
-
"predicate": "{GET /actuator/configprops, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/configprops"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'env-toMatch'",
-
"predicate": "{GET /actuator/env/{toMatch}, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/env/{toMatch}"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'env'",
-
"predicate": "{GET /actuator/env, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/env"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'info'",
-
"predicate": "{GET /actuator/info, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/info"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'loggers'",
-
"predicate": "{GET /actuator/loggers, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/loggers"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'loggers-name'",
-
"predicate": "{GET /actuator/loggers/{name}, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/loggers/{name}"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'loggers-name'",
-
"predicate": "{POST /actuator/loggers/{name}, consumes [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}],
-
"headers": [],
-
"methods": ["POST"],
-
"params": [],
-
"patterns": ["/actuator/loggers/{name}"],
-
"produces": []
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'heapdump'",
-
"predicate": "{GET /actuator/heapdump, produces [application/octet-stream]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/heapdump"],
-
"produces": [{
-
"mediaType": "application/octet-stream",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'threaddump'",
-
"predicate": "{GET /actuator/threaddump, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/threaddump"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'metrics'",
-
"predicate": "{GET /actuator/metrics, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/metrics"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'metrics-requiredMetricName'",
-
"predicate": "{GET /actuator/metrics/{requiredMetricName}, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/metrics/{requiredMetricName}"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'scheduledtasks'",
-
"predicate": "{GET /actuator/scheduledtasks, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/scheduledtasks"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'httptrace'",
-
"predicate": "{GET /actuator/httptrace, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/httptrace"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator web endpoint 'mappings'",
-
"predicate": "{GET /actuator/mappings, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
-
"name": "handle",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator/mappings"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "Actuator root web endpoint",
-
"predicate": "{GET /actuator, produces [application/vnd.spring-boot.actuator.v2+json || application/json]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping.WebMvcLinksHandler",
-
"name": "links",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Ljava/lang/Object;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": ["GET"],
-
"params": [],
-
"patterns": ["/actuator"],
-
"produces": [{
-
"mediaType": "application/vnd.spring-boot.actuator.v2+json",
-
"negated": false
-
}, {
-
"mediaType": "application/json",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)",
-
"predicate": "{ /error, produces [text/html]}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController",
-
"name": "errorHtml",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/springframework/web/servlet/ModelAndView;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": [],
-
"params": [],
-
"patterns": ["/error"],
-
"produces": [{
-
"mediaType": "text/html",
-
"negated": false
-
}]
-
}
-
}
-
}, {
-
"handler": "public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)",
-
"predicate": "{ /error}",
-
"details": {
-
"handlerMethod": {
-
"className": "org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController",
-
"name": "error",
-
"descriptor": "(Ljavax/servlet/http/HttpServletRequest;)Lorg/springframework/http/ResponseEntity;"
-
},
-
"requestMappingConditions": {
-
"consumes": [],
-
"headers": [],
-
"methods": [],
-
"params": [],
-
"patterns": ["/error"],
-
"produces": []
-
}
-
}
-
}, {
-
"handler": "ResourceHttpRequestHandler [\"classpath:/META-INF/resources/webjars/\"]",
-
"predicate": "/webjars/**",
-
"details": null
-
}, {
-
"handler": "ResourceHttpRequestHandler [\"classpath:/META-INF/resources/\", \"classpath:/resources/\", \"classpath:/static/\", \"classpath:/public/\", \"/\"]",
-
"predicate": "/**",
-
"details": null
-
}]
-
},
-
"servletFilters": [{
-
"servletNameMappings": [],
-
"urlPatternMappings": ["/*"],
-
"name": "webMvcMetricsFilter",
-
"className": "org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter"
-
}, {
-
"servletNameMappings": [],
-
"urlPatternMappings": ["/*"],
-
"name": "requestContextFilter",
-
"className": "org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter"
-
}, {
-
"servletNameMappings": [],
-
"urlPatternMappings": ["/*"],
-
"name": "Tomcat WebSocket (JSR356) Filter",
-
"className": "org.apache.tomcat.websocket.server.WsFilter"
-
}, {
-
"servletNameMappings": [],
-
"urlPatternMappings": ["/*"],
-
"name": "hiddenHttpMethodFilter",
-
"className": "org.springframework.boot.web.servlet.filter.OrderedHiddenHttpMethodFilter"
-
}, {
-
"servletNameMappings": [],
-
"urlPatternMappings": ["/*"],
-
"name": "characterEncodingFilter",
-
"className": "org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter"
-
}, {
-
"servletNameMappings": [],
-
"urlPatternMappings": ["/*"],
-
"name": "httpTraceFilter",
-
"className": "org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter"
-
}, {
-
"servletNameMappings": [],
-
"urlPatternMappings": ["/*"],
-
"name": "formContentFilter",
-
"className": "org.springframework.boot.web.servlet.filter.OrderedFormContentFilter"
-
}],
-
"servlets": [{
-
"mappings": [],
-
"name": "default",
-
"className": "org.apache.catalina.servlets.DefaultServlet"
-
}, {
-
"mappings": ["/"],
-
"name": "dispatcherServlet",
-
"className": "org.springframework.web.servlet.DispatcherServlet"
-
}]
-
},
-
"parentId": null
-
}
-
}
-
}
解决springboot 新版本 2.1.6 spring-boot-starter-actuator 访问报404的更多相关文章
- spring boot的maven项目报404错误
$.ajax({ async: false, type: "POST", url:'searchFileSource', contentType : "applicati ...
- SpringBoot零XML配置的Spring Boot Application
Spring Boot 提供了一种统一的方式来管理应用的配置,允许开发人员使用属性properties文件.YAML 文件.环境变量和命令行参数来定义优先级不同的配置值.零XML配置的Spring B ...
- SpringBoot 之Spring Boot Starter依赖包及作用
Spring Boot 之Spring Boot Starter依赖包及作用 spring-boot-starter 这是Spring Boot的核心启动器,包含了自动配置.日志和YAML. spri ...
- Druid Spring Boot Starter 从配置到简单运行 -解决zone不匹配 -解决dataSource加载失败
Druid Spring Boot Starter 中文 | English Druid Spring Boot Starter 用于帮助你在Spring Boot项目中轻松集成Druid数据库连接池 ...
- Spring Boot Starter 介绍
http://www.baeldung.com/spring-boot-starters 作者:baeldung 译者:http://oopsguy.com 1.概述 依赖管理是任何复杂项目的关键部分 ...
- 创建自己的Spring Boot Starter
抽取通用模块作为项目的一个spring boot starter.可参照mybatis的写法. IDEA创建Empty Project并添加如下2个module,一个基本maven模块,另一个引入sp ...
- 手把手教你定制标准Spring Boot starter,真的很清晰
写在前面 我们每次构建一个 Spring 应用程序时,我们都不希望从头开始实现具有「横切关注点」的内容:相反,我们希望一次性实现这些功能,并根据需要将它们包含到任何我们要构建的应用程序中 横切关注点 ...
- 年轻人的第一个自定义 Spring Boot Starter!
陆陆续续,零零散散,栈长已经写了几十篇 Spring Boot 系列文章了,其中有介绍到 Spring Boot Starters 启动器,使用的.介绍的都是第三方的 Starters ,那如何开发一 ...
- 从零开始开发一个Spring Boot Starter
一.Spring Boot Starter简介 Starter是Spring Boot中的一个非常重要的概念,Starter相当于模块,它能将模块所需的依赖整合起来并对模块内的Bean根据环境( 条件 ...
- 一个简单易上手的短信服务Spring Boot Starter
前言 短信服务在用户注册.登录.找回密码等相关操作中,可以让用户使用更加便捷,越来越多的公司都采用短信验证的方式让用户进行操作,从而提高用户的实用性. Spring Boot Starter 由于 S ...
随机推荐
- linux命令之------Chown命令
Chown命令 1) 作用:将指定文件的拥有者改为指定的用户或组. 2) -c:显示更改的部分的信息. 3)-f:忽略错误信息. 4)-h:修复符号链接. 5)-v:显示详细的处理信息. 6)-R:处 ...
- CSP内容安全策略总结及如何抵御 XSS 攻击
跨域脚本攻击 XSS 是最常见.危害最大的网页安全漏洞.为了防止它们,要采取很多编程措施,非常麻烦.很多人提出,能不能根本上解决问题,浏览器自动禁止外部注入恶意脚本?这就是"网页安全政策&q ...
- 【06NOIP普及组】数列(信息学奥赛一本通 1937)(洛谷 1062)
[题目描述] 给定一个正整数k(3≤k≤15),把所有k的方幂及所有有限个互不相等的k的方幂之和构成一个递增的序列,例如,当k=3时,这个序列是: 1,3,4,9,10,12,13,… (该序列实际上 ...
- mysql count() 函数,对结果统计计数
mysql> ; +----------+------------+-----+---------------------+ | name_new | transactor | pid | or ...
- 【DataStage】使用Sequence Job报错:CopyOfseq_ld..JobControl (fatal error from @Coordinator): Sequence job (restartable) will abort due to previous unrecoverable errors
错误描述: 在使用Sequence Job加载作业的时候,报了个错,详细错误内容如下: 出现这个错误的原因是由于以下配置问题,Excution action的状态为Run造成. 解决方案: 将Excu ...
- 剑指offer:孩子们的游戏(圆圈中最后剩下的数)
题目描述: 每年六一儿童节,牛客都会准备一些小礼物去看望孤儿院的小朋友,今年亦是如此.HF作为牛客的资深元老,自然也准备了一些小游戏.其中,有个游戏是这样的:首先,让小朋友们围成一个大圈.然后,他随机 ...
- linux core 性能
apt-get install lrzsz apt-get install vim apt-get install -y net-tools apt-get install -y procps htt ...
- 文件分片 浏览器文件大小限制 自定义请求头 在一个资源的加载进度停止之后被触发 arrayBuffer 异步 二进制数据缓存区
js 整数限制 浏览器文件大小限制 https://w3c.github.io/FileAPI/#dom-blob-arraybuffer https://developer.mozilla.org/ ...
- PostgreSQL中的The Oversized-Attribute Storage Technique(TOAST:超大属性存储技术)
PostgreSQL使用固定的页面大小(通常为8kB),并且不允许元组跨越多个页面.因此,不可能直接存储非常大的字段值.为了克服这种限制,将大字段值压缩和/或分解成多个物理行.这对用户来说是透明的,对 ...
- Linux MySQL 5.6.43 安装
[注意] 1.首先安装在默认目录 /usr/local/mysql,如需更改数据存储目录,进行2.3两步 2.如果需要修改数据目录,将my.nf 中的 datadir=/usr/local/mysql ...