【发布时间】:2019-03-11 05:15:26
【问题描述】:
我的 spring-boot 执行器端点(如 /health、/env、/info 等)收到 406 Not Acceptable 错误
我使用的是 spring-boot 1.5.8 版
访问端点,例如 http://localhost:6061/health http://localhost:6061/env
这是我的 gradle 构建文件的一部分
buildscript {
ext {
springBootVersion = '1.5.8.RELEASE'
}
dependencies {
classpath(group: 'org.springframework.boot', name: 'spring-boot-
gradle-plugin', version:'1.5.8.RELEASE')
}
}
repositories {
mavenLocal()
maven {
url "${artifactory_url}" + "libs-release"
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
maven {
url "${artifactory_url}" + "libs-snapshot"
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
}
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'project-report'
dependencies {
compile("org.apache.commons:commons-csv:1.4")
runtime 'com.google.guava:guava:19.0'
compile fileTree(dir: 'src/libs/', include: '*.jar')
compile("org.springframework.cloud:spring-cloud-stream:1.2.2.RELEASE")
compile('org.springframework.cloud:spring-cloud-starter-hystrix-
dashboard:1.3.1.RELEASE')
compile('org.springframework.cloud:spring-cloud-starter-
hystrix:1.3.1.RELEASE')
compile('org.springframework.cloud:spring-cloud-starter-
eureka:1.3.1.RELEASE')
compile('org.springframework.cloud:spring-cloud-starter-
turbine:1.3.1.RELEASE')
compile("org.springframework.boot:spring-boot-starter-actuator")
【问题讨论】:
-
我想问题是如何成功访问端点?您可以使用访问端点的方式更新票证吗?
-
@Boris 添加了上面的评论,访问这个端点localhost:6061/health
-
您也可以添加应用程序属性文件吗?您有任何与执行器相关的设置吗?
-
@Boris 我的 application.properties 中没有任何与执行器相关的设置。
标签: spring-boot spring-boot-actuator http-status-code-406