Spring boot Spring Boot 2、LiquiGraph和503执行器运行状况端点错误-org.springframework.jdbc.UncategorizedSQLException

Spring boot Spring Boot 2、LiquiGraph和503执行器运行状况端点错误-org.springframework.jdbc.UncategorizedSQLException,spring-boot,spring-jdbc,spring-data-neo4j,spring-boot-actuator,liquigraph,Spring Boot,Spring Jdbc,Spring Data Neo4j,Spring Boot Actuator,Liquigraph,在我的Spring Boot 2.0.0.M6应用程序中,我使用以下Maven依赖项安装了LiquiGraph: dependency> <groupId>org.liquigraph</groupId> <artifactId>liquigraph-spring-boot-starter</artifactId> <version>3.0.2</version>

在我的Spring Boot 2.0.0.M6应用程序中,我使用以下Maven依赖项安装了LiquiGraph:

    dependency>
        <groupId>org.liquigraph</groupId>
        <artifactId>liquigraph-spring-boot-starter</artifactId>
        <version>3.0.2</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>

    <dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j-jdbc-bolt</artifactId>
        <version>3.1.0</version>
    </dependency>
现在,我的Spring Boot Actuator健康端点响应为
503状态代码和JSON中的以下错误:

org.springframework.jdbc.UncategorizedSQLException

原因可能是什么?如何解决

已更新

这是我的项目Maven依赖关系树:

com.example:api:war:0.0.1
+- com.example:domain:jar:0.0.1:compile
|  +- org.neo4j:neo4j-ogm-bolt-driver:jar:3.0.1:compile
|  |  +- org.neo4j:neo4j-ogm-api:jar:3.0.1:compile
|  |  \- org.neo4j.driver:neo4j-java-driver:jar:1.4.4:compile
|  +- org.springframework.social:spring-social-security:jar:2.0.0.M4:compile
|  |  \- org.springframework.security:spring-security-web:jar:5.0.0.RC1:compile
|  +- org.springframework.security.oauth:spring-security-oauth2:jar:2.2.0.RELEASE:compile
|  |  +- org.springframework.security:spring-security-core:jar:5.0.0.RC1:compile
|  |  +- org.springframework.security:spring-security-config:jar:5.0.0.RC1:compile
|  |  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
|  |     \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
|  +- org.springframework:spring-context-support:jar:5.0.1.RELEASE:compile
|  +- org.springframework.boot:spring-boot-starter-data-neo4j:jar:2.0.0.M6:compile
|  |  \- org.springframework.data:spring-data-neo4j:jar:5.0.1.RELEASE:compile
|  |     +- org.springframework.data:spring-data-commons:jar:2.0.1.RELEASE:compile
|  |     \- org.neo4j:neo4j-ogm-core:jar:3.0.1:compile
|  |        \- io.github.lukehutch:fast-classpath-scanner:jar:2.7.4:compile
|  +- org.liquigraph:liquigraph-spring-boot-starter:jar:3.0.2:compile
|  |  \- org.liquigraph:liquigraph-core:jar:3.0.2:compile
|  |     \- org.neo4j:neo4j-jdbc-driver:jar:3.1.0:compile
|  +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.0.0.M6:compile
|  |  +- com.zaxxer:HikariCP:jar:2.7.2:compile
|  |  \- org.springframework:spring-jdbc:jar:5.0.1.RELEASE:compile
|  +- org.neo4j:neo4j-jdbc-bolt:jar:3.1.0:compile
|  |  \- org.neo4j:neo4j-jdbc:jar:3.1.0:compile
|  +- org.springframework.boot:spring-boot-starter-data-mongodb:jar:2.0.0.M6:compile
|  |  +- org.mongodb:mongodb-driver:jar:3.5.0:compile
|  |  |  +- org.mongodb:bson:jar:3.5.0:compile
|  |  |  \- org.mongodb:mongodb-driver-core:jar:3.5.0:compile
|  |  \- org.springframework.data:spring-data-mongodb:jar:2.0.1.RELEASE:compile
|  +- org.springframework.boot:spring-boot-starter-data-elasticsearch:jar:2.0.0.M6:compile
|  |  \- org.springframework.data:spring-data-elasticsearch:jar:3.0.1.RELEASE:compile
|  |     +- commons-lang:commons-lang:jar:2.6:compile
|  |     +- joda-time:joda-time:jar:2.9.9:compile
|  |     +- org.elasticsearch:elasticsearch:jar:5.5.3:compile
|  |     |  +- org.apache.lucene:lucene-core:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-analyzers-common:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-backward-codecs:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-grouping:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-highlighter:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-join:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-memory:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-misc:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-queries:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-queryparser:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-sandbox:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-spatial:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-spatial-extras:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-spatial3d:jar:6.6.0:compile
|  |     |  +- org.apache.lucene:lucene-suggest:jar:6.6.0:compile
|  |     |  +- org.elasticsearch:securesm:jar:1.1:compile
|  |     |  +- net.sf.jopt-simple:jopt-simple:jar:5.0.2:compile
|  |     |  +- com.carrotsearch:hppc:jar:0.7.1:compile
|  |     |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.9.2:compile
|  |     |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.9.2:compile
|  |     |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.9.2:compile
|  |     |  +- com.tdunning:t-digest:jar:3.0:compile
|  |     |  \- org.elasticsearch:jna:jar:4.4.0:compile
|  |     +- org.elasticsearch.client:transport:jar:5.5.3:compile
|  |     |  +- org.elasticsearch.plugin:transport-netty3-client:jar:5.5.3:compile
|  |     |  |  \- io.netty:netty:jar:3.10.6.Final:compile
|  |     |  +- org.elasticsearch.plugin:reindex-client:jar:5.5.3:compile
|  |     |  |  \- org.elasticsearch.client:rest:jar:5.5.3:compile
|  |     |  |     +- org.apache.httpcomponents:httpasyncclient:jar:4.1.3:compile
|  |     |  |     \- org.apache.httpcomponents:httpcore-nio:jar:4.4.8:compile
|  |     |  +- org.elasticsearch.plugin:lang-mustache-client:jar:5.5.3:compile
|  |     |  |  \- com.github.spullara.mustache.java:compiler:jar:0.9.3:compile
|  |     |  +- org.elasticsearch.plugin:percolator-client:jar:5.5.3:compile
|  |     |  \- org.elasticsearch.plugin:parent-join-client:jar:5.5.3:compile
|  |     \- org.elasticsearch.plugin:transport-netty4-client:jar:5.5.3:compile
|  |        +- io.netty:netty-buffer:jar:4.1.16.Final:compile
|  |        +- io.netty:netty-codec:jar:4.1.16.Final:compile
|  |        +- io.netty:netty-codec-http:jar:4.1.16.Final:compile
|  |        +- io.netty:netty-common:jar:4.1.16.Final:compile
|  |        +- io.netty:netty-handler:jar:4.1.16.Final:compile
|  |        +- io.netty:netty-resolver:jar:4.1.16.Final:compile
|  |        \- io.netty:netty-transport:jar:4.1.16.Final:compile
|  +- org.springframework.boot:spring-boot-starter-security:jar:2.0.0.M6:compile
|  +- org.springframework.boot:spring-boot-starter-validation:jar:2.0.0.M6:compile
|  +- org.springframework.boot:spring-boot-starter-social-twitter:jar:2.0.0.M6:compile
|  |  \- org.springframework.social:spring-social-twitter:jar:2.0.0.M4:compile
|  |     \- org.springframework.security:spring-security-crypto:jar:5.0.0.RC1:compile
|  +- org.springframework.kafka:spring-kafka:jar:2.0.0.RELEASE:compile
|  |  +- org.springframework:spring-messaging:jar:5.0.1.RELEASE:compile
|  |  +- org.springframework.retry:spring-retry:jar:1.2.1.RELEASE:compile
|  |  \- org.apache.kafka:kafka-clients:jar:0.11.0.0:compile
|  |     +- net.jpountz.lz4:lz4:jar:1.3.0:compile
|  |     \- org.xerial.snappy:snappy-java:jar:1.1.2.6:compile
|  +- com.google.guava:guava:jar:19.0-rc1:compile
|  +- com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:jar:20160924.1:compile
|  +- eu.bitwalker:UserAgentUtils:jar:1.20:compile
|  +- org.quartz-scheduler:quartz:jar:2.3.0:compile
|  |  +- com.mchange:c3p0:jar:0.9.5.2:compile
|  |  +- com.mchange:mchange-commons-java:jar:0.2.11:compile
|  |  \- com.zaxxer:HikariCP-java6:jar:2.3.13:compile
|  \- com.novemberain:quartz-mongodb:jar:2.0.0:compile
|     +- org.mongodb:mongo-java-driver:jar:3.5.0:runtime
|     \- org.clojure:clojure:jar:1.7.0:runtime
+- com.example:coinmarketcap:jar:0.0.1:compile
+- org.springframework.boot:spring-boot-starter-web:jar:2.0.0.M6:compile
|  +- org.springframework.boot:spring-boot-starter-json:jar:2.0.0.M6:compile
|  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.2:compile
|  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.2:compile
|  |  +- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.2:compile
|  |  \- com.fasterxml.jackson.module:jackson-module-kotlin:jar:2.9.2:compile
|  +- org.hibernate.validator:hibernate-validator:jar:6.0.4.Final:compile
|  |  +- javax.validation:validation-api:jar:2.0.0.Final:compile
|  |  \- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
|  +- org.springframework:spring-web:jar:5.0.1.RELEASE:compile
|  \- org.springframework:spring-webmvc:jar:5.0.1.RELEASE:compile
+- org.springframework.boot:spring-boot-starter-thymeleaf:jar:2.0.0.M6:compile
|  +- org.thymeleaf:thymeleaf-spring5:jar:3.0.8.RELEASE:compile
|  |  \- org.thymeleaf:thymeleaf:jar:3.0.8.RELEASE:compile
|  |     +- org.attoparser:attoparser:jar:2.0.4.RELEASE:compile
|  |     \- org.unbescape:unbescape:jar:1.1.5.RELEASE:compile
|  \- org.thymeleaf.extras:thymeleaf-extras-java8time:jar:3.0.1.RELEASE:compile
+- org.springframework.boot:spring-boot-starter-tomcat:jar:2.0.0.M6:compile
|  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.23:compile
|  |  \- org.apache.tomcat:tomcat-annotations-api:jar:8.5.23:compile
|  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.23:compile
|  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.23:compile
+- org.springframework.boot:spring-boot-starter-actuator:jar:2.0.0.M6:compile
|  +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.0.0.M6:compile
|  |  \- org.springframework.boot:spring-boot-actuator:jar:2.0.0.M6:compile
|  \- io.micrometer:micrometer-core:jar:1.0.0-rc.3:compile
|     +- org.hdrhistogram:HdrHistogram:jar:2.1.10:compile
|     \- org.latencyutils:LatencyUtils:jar:2.0.3:compile
+- org.springframework.boot:spring-boot-starter-social-facebook:jar:2.0.0.M6:compile
|  +- org.springframework.social:spring-social-config:jar:2.0.0.M4:compile
|  +- org.springframework.social:spring-social-core:jar:2.0.0.M4:compile
|  +- org.springframework.social:spring-social-web:jar:2.0.0.M4:compile
|  \- org.springframework.social:spring-social-facebook:jar:3.0.0.M3:compile
+- org.springframework.boot:spring-boot-starter-social-linkedin:jar:2.0.0.M6:compile
|  \- org.springframework.social:spring-social-linkedin:jar:2.0.0.M3:compile
+- org.springframework.security:spring-security-jwt:jar:1.0.8.RELEASE:compile
|  \- org.bouncycastle:bcpkix-jdk15on:jar:1.56:compile
|     \- org.bouncycastle:bcprov-jdk15on:jar:1.56:compile
+- org.springframework.social:spring-social-google:jar:1.0.0.RELEASE:compile
+- org.springframework.social:spring-social-github:jar:1.0.0.M4:compile
+- com.jayway.jsonpath:json-path:jar:2.4.0:test
|  +- net.minidev:json-smart:jar:2.3:test
|  |  \- net.minidev:accessors-smart:jar:1.2:test
|  |     \- org.ow2.asm:asm:jar:5.0.4:test
|  \- org.slf4j:slf4j-api:jar:1.7.25:compile
+- com.jayway.jsonpath:json-path-assert:jar:2.4.0:test
|  +- org.hamcrest:hamcrest-core:jar:1.3:test
|  \- org.hamcrest:hamcrest-library:jar:1.3:test
+- javax.servlet:javax.servlet-api:jar:3.1.0:provided
+- javax:javaee-web-api:jar:7.0:provided
+- org.apache.httpcomponents:httpclient:jar:4.5.3:compile
|  +- org.apache.httpcomponents:httpcore:jar:4.4.8:compile
|  \- commons-codec:commons-codec:jar:1.11:compile
+- io.springfox:springfox-swagger2:jar:2.6.0:compile
|  +- io.swagger:swagger-annotations:jar:1.5.10:compile
|  +- io.swagger:swagger-models:jar:1.5.10:compile
|  +- io.springfox:springfox-spi:jar:2.6.0:compile
|  |  \- io.springfox:springfox-core:jar:2.6.0:compile
|  +- io.springfox:springfox-schema:jar:2.6.0:compile
|  +- io.springfox:springfox-swagger-common:jar:2.6.0:compile
|  +- io.springfox:springfox-spring-web:jar:2.6.0:compile
|  +- com.fasterxml:classmate:jar:1.3.4:compile
|  +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
|  +- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
|  \- org.mapstruct:mapstruct:jar:1.0.0.Final:compile
+- io.springfox:springfox-swagger-ui:jar:2.6.0:compile
+- com.github.dfabulich:sitemapgen4j:jar:1.0.6:compile
+- com.jayway.restassured:rest-assured:jar:2.9.0:test
|  +- org.codehaus.groovy:groovy:jar:2.5.0-beta-1:test
|  +- org.codehaus.groovy:groovy-xml:jar:2.5.0-beta-1:test
|  +- org.apache.httpcomponents:httpmime:jar:4.5.3:test
|  +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:test
|  +- com.jayway.restassured:json-path:jar:2.9.0:test
|  |  +- org.codehaus.groovy:groovy-json:jar:2.5.0-beta-1:test
|  |  \- com.jayway.restassured:rest-assured-common:jar:2.9.0:test
|  \- com.jayway.restassured:xml-path:jar:2.9.0:test
+- com.google.code.gson:gson:jar:2.8.2:compile
+- javax.xml.bind:jaxb-api:jar:2.2.12:compile
+- com.fasterxml.jackson.core:jackson-core:jar:2.9.2:compile
+- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
+- com.fasterxml.jackson.core:jackson-databind:jar:2.9.2:compile
+- org.springframework:spring-core:jar:5.0.1.RELEASE:compile
|  \- org.springframework:spring-jcl:jar:5.0.1.RELEASE:compile
+- org.springframework:spring-beans:jar:5.0.1.RELEASE:compile
+- org.springframework:spring-aop:jar:5.0.1.RELEASE:compile
+- org.springframework:spring-aspects:jar:5.0.1.RELEASE:compile
|  \- org.aspectj:aspectjweaver:jar:1.8.12:compile
+- org.springframework:spring-context:jar:5.0.1.RELEASE:compile
+- org.springframework:spring-expression:jar:5.0.1.RELEASE:compile
+- org.springframework:spring-tx:jar:5.0.1.RELEASE:compile
+- org.springframework.boot:spring-boot-starter:jar:2.0.0.M6:compile
|  +- javax.annotation:javax.annotation-api:jar:1.3.1:compile
|  \- org.yaml:snakeyaml:jar:1.19:compile
+- org.springframework.boot:spring-boot:jar:2.0.0.M6:compile
+- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.0.M6:compile
+- org.springframework.boot:spring-boot-starter-logging:jar:2.0.0.M6:compile
|  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
|  |  \- ch.qos.logback:logback-core:jar:1.2.3:compile
|  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.9.1:compile
|  |  \- org.apache.logging.log4j:log4j-api:jar:2.9.1:compile
|  +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
|  \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
+- org.springframework.boot:spring-boot-starter-test:jar:2.0.0.M6:test
|  +- org.springframework.boot:spring-boot-test:jar:2.0.0.M6:test
|  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.0.0.M6:test
|  +- org.assertj:assertj-core:jar:3.8.0:test
|  +- org.mockito:mockito-core:jar:2.11.0:test
|  |  +- net.bytebuddy:byte-buddy:jar:1.7.8:test
|  |  +- net.bytebuddy:byte-buddy-agent:jar:1.7.8:test
|  |  \- org.objenesis:objenesis:jar:2.6:test
|  +- org.skyscreamer:jsonassert:jar:1.5.0:test
|  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
|  +- org.springframework:spring-test:jar:5.0.1.RELEASE:test
|  \- org.xmlunit:xmlunit-core:jar:2.5.0:test
+- javax.enterprise:cdi-api:jar:2.0-EDR1:compile
|  +- javax.el:javax.el-api:jar:3.0.0:compile
|  +- javax.interceptor:javax.interceptor-api:jar:1.2:compile
|  \- javax.inject:javax.inject:jar:1:compile
+- javax.transaction:jta:jar:1.1:compile
+- org.apache.commons:commons-lang3:jar:3.4:compile
+- commons-validator:commons-validator:jar:1.5.0:compile
|  +- commons-beanutils:commons-beanutils:jar:1.9.3:compile
|  +- commons-digester:commons-digester:jar:2.1:compile
|  +- commons-logging:commons-logging:jar:1.2:compile
|  \- commons-collections:commons-collections:jar:3.2.2:compile
+- commons-io:commons-io:jar:2.4:compile
+- org.apache.commons:commons-compress:jar:1.14:compile
\- junit:junit:jar:4.12:test

tl;博士

management.health.db.enabled=false
添加到配置中

详细信息

由于您还将在配置中注册JDBC数据源以使用liquigraph,因此SpringBoot的自动配置将启动,并为此数据库注册一个额外的
HealthIndicator
。您可以通过设置
management.health.db.enabled=false来停用此指示器

如果您计划升级到SpringBoot 2.0.0.M7,请提供更多信息:健康检查的配置已更改为:

management.endpoint.health.enabled=true
management.endpoint.health.show-details=ALWAYS
management.health.db.enabled=false

作为替代解决方案,您仍然可以通过以下方式获得数据源的运行状况检查,有效地隐藏自动配置的
datasourcehealthdindicator
bean:

@Bean 
public DataSourceHealthIndicator dataSourceHealthIndicator(DataSource datasource) {
    return new DataSourceHealthIndicator(datasource, "match (n) return count(n) as nodes");
}

您能在这里显示您所有的maven依赖项吗?或者,更好的是,您是否有指向此项目或测试项目的链接?因此,基本上执行器健康检查似乎使用了错误的查询,但它不应该()这似乎来自()我已经用project Maven dependencies树更新了我的问题。你是对的,但在本例中,neo4j实例已经是运行状况检查的一部分,并且只有在liquigraph应用程序启动时才需要JDBC连接。谢谢,这种方法很好用!我还尝试更新到SpringBoot2.0.0.M7,但失败了,因为SpringSocialAutoconfiguration已经从那里删除,我现在不知道如何配置它。
management.endpoint.health.enabled=true
management.endpoint.health.show-details=ALWAYS
management.health.db.enabled=false
@Bean 
public DataSourceHealthIndicator dataSourceHealthIndicator(DataSource datasource) {
    return new DataSourceHealthIndicator(datasource, "match (n) return count(n) as nodes");
}