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

当作为Docker容器启动时,Spring Boot服务无法连接到Spring云配置服务器

萧自珍
2023-03-14

我正在使用Spring Cloud Config Server和一个简单的Spring Boot项目。所以我有一个Spring Cloud Config Service服务和另一个连接到Spring Cloud Config Service以获取数据库凭据和其他属性等一些属性的简单服务。如果我在本地测试它一切正常,但如果我尝试将这2个服务作为docker容器启动,它就不起作用了。Spring Cloud Config Service启动正常,然后我尝试启动其他服务,但它不起作用。它无法连接到配置服务器,我不明白为什么。

spring云配置服务器应用程序。yml:

server:
  port: 8888

spring:
  application:
    name: spring-cloud-config-server
  cloud:
    config:
      label: master
      server:
        git:
          uri: https://github.com/...
  security:
    user:
      name: gigi
      password: $2a$10$QpA9JjOQiciPKokmwlxEYOPtZLIHfTFECvDeL8in.ZGWVUY24Cx/a

spring云配置服务器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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.0</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.gab.microservices</groupId>
    <artifactId>spring-cloud-config-server</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>spring-cloud-config-server</name>
    <description>Centralized Configuration Server</description>
    <properties>
        <java.version>11</java.version>
        <spring-cloud.version>2021.0.3</spring-cloud.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-server</artifactId>
        </dependency>

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

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <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>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <image>
                        <name>eveningstar33/mmv2-${project.artifactId}:${project.version}</name>
                        <pullPolicy>IF_NOT_PRESENT</pullPolicy>
                    </image>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

我在本地启动Spring云配置服务器作为docker容器:

$ docker run -p 8888:8888 eveningstar33/mmv2-spring-cloud-config-server:0.0.1-SNAPSHOT
Setting Active Processor Count to 4
Calculating JVM memory based on 4828376K available memory
`For more information on this calculation, see https://paketo.io/docs/reference/java-reference/#memory-calculator
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx4211948K -XX:MaxMetaspaceSize=104427K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 4828376K, Thread Count: 250, Loaded Class Count: 16023, Headroom: 0%)
Enabling Java Native Memory Tracking
Adding 127 container CA certificates to JVM truststore
Spring Cloud Bindings Enabled
Picked up JAVA_TOOL_OPTIONS: -Djava.security.properties=/layers/paketo-buildpacks_bellsoft-liberica/java-security-properties/java-security.properties -XX:+ExitOnOutOfMemoryError -XX:ActiveProcessorCount=4 -XX:MaxDirectMemorySize=10M -Xmx4211948K -XX:MaxMetaspaceSize=104427K -XX:ReservedCodeCacheSize=240M -Xss1M -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics -Dorg.springframework.cloud.bindings.boot.enable=true

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.7.0)

2022-06-26 15:40:12.369  INFO 1 --- [           main] g.m.s.SpringCloudConfigServerApplication : Starting SpringCloudConfigServerApplication v0.0.1-SNAPSHOT using Java 11.0.15.1 on 058d17df827b with PID 1 (/workspace/BOOT-INF/classes started by cnb in /workspace)
2022-06-26 15:40:12.376  INFO 1 --- [           main] g.m.s.SpringCloudConfigServerApplication : No active profile set, falling back to 1 default profile: "default"
2022-06-26 15:40:14.409  INFO 1 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=e8bf239d-fb47-310c-99e0-8c15e49dfb55
2022-06-26 15:40:15.015  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8888 (http)
2022-06-26 15:40:15.034  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2022-06-26 15:40:15.035  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.63]
2022-06-26 15:40:15.158  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2022-06-26 15:40:15.158  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2630 ms
2022-06-26 15:40:16.137  INFO 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@5dbbb292, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@613f7eb7, org.springframework.security.web.context.SecurityContextPersistenceFilter@1ac730cd, org.springframework.security.web.header.HeaderWriterFilter@b5b9333, org.springframework.security.web.csrf.CsrfFilter@30bbcf91, org.springframework.security.web.authentication.logout.LogoutFilter@487cd177, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@3375ebd3, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@6467ddc7, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@565aa4ac, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@40717ed, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@5aa62ee7, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1f7cec93, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@587c5c1, org.springframework.security.web.session.SessionManagementFilter@38588dea, org.springframework.security.web.access.ExceptionTranslationFilter@79627d27, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@2199e845]
2022-06-26 15:40:17.116  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8888 (http) with context path ''
2022-06-26 15:40:17.148  INFO 1 --- [           main] g.m.s.SpringCloudConfigServerApplication : Started SpringCloudConfigServerApplication in 5.731 seconds (JVM running for 6.46)

我可以在网址上做一个请求http://localhost:8888/currency-exchange/master这些是信息:

{
"name": "currency-exchange",
"profiles": [
"master"
],
"label": null,
"version": "7b6626f321d73191ca6cfc55f518f7158e1a2313",
"state": null,
"propertySources": [
{
"name": "https://github.com/...
"source": {
"spring.cloud.config.label": "master",
"spring.cloud.config.uri": "http://localhost:8888",
"spring.cloud.config.username": "gigi",
"spring.cloud.config.password": "test1234",
"spring.datasource.url": "jdbc:mysql://docker-mysql:3306/testdb",
"spring.datasource.username": "root",
"spring.datasource.password": "test1234",
"spring.security.user.name": "admin",
"spring.security.user.password": "$2a$10$QpA9JjOQiciPKokmwlxEYOPtZLIHfTFECvDeL8in.ZGWVUY24Cx/a"
}
}
]
}

之后,我尝试启动其他服务,但连接被拒绝:

$ docker run -p 8000:8000 eveningstar33/mmv2-currency-exchange-service:0.0.1-SNAPSHOT
Setting Active Processor Count to 4
Calculating JVM memory based on 4502728K available memory
`For more information on this calculation, see https://paketo.io/docs/reference/java-reference/#memory-calculator
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx3840722K -XX:MaxMetaspaceSize=150005K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 4502728K, Thread Count: 250, Loaded Class Count: 24070, Headroom: 0%)
Enabling Java Native Memory Tracking
Adding 127 container CA certificates to JVM truststore
Spring Cloud Bindings Enabled
Picked up JAVA_TOOL_OPTIONS: -Djava.security.properties=/layers/paketo-buildpacks_bellsoft-liberica/java-security-properties/java-security.properties -XX:+ExitOnOutOfMemoryError -XX:ActiveProcessorCount=4 -XX:MaxDirectMemorySize=10M -Xmx3840722K -XX:MaxMetaspaceSize=150005K -XX:ReservedCodeCacheSize=240M -Xss1M -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics -Dorg.springframework.cloud.bindings.boot.enable=true

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.7.0)

2022-06-26 15:47:01.483  INFO [currency-exchange,,] 1 --- [           main] g.m.c.CurrencyExchangeServiceApplication : Starting CurrencyExchangeServiceApplication v0.0.1-SNAPSHOT using Java 11.0.15.1 on 08358a26aa24 with PID 1 (/workspace/BOOT-INF/classes started by cnb in /workspace)
2022-06-26 15:47:01.490  INFO [currency-exchange,,] 1 --- [           main] g.m.c.CurrencyExchangeServiceApplication : No active profile set, falling back to 1 default profile: "default"
2022-06-26 15:47:01.591  INFO [currency-exchange,,] 1 --- [           main] o.s.c.c.c.ConfigServerConfigDataLoader   : Fetching config from server at : http://localhost:8888
2022-06-26 15:47:01.592  INFO [currency-exchange,,] 1 --- [           main] o.s.c.c.c.ConfigServerConfigDataLoader   : Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available
2022-06-26 15:47:01.592  WARN [currency-exchange,,] 1 --- [           main] o.s.c.c.c.ConfigServerConfigDataLoader   : Could not locate PropertySource ([ConfigServerConfigDataResource@4aeaadc1 uris = array<String>['http://localhost:8888'], optional = true, profiles = list['default']]): I/O error on GET request for "http://localhost:8888/currency-exchange/default/master": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
2022-06-26 15:47:04.088  INFO [currency-exchange,,] 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-06-26 15:47:04.511  INFO [currency-exchange,,] 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 403 ms. Found 1 JPA repository interfaces.
2022-06-26 15:47:05.655  INFO [currency-exchange,,] 1 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=14f08c66-f514-36a3-965b-ebd56a472fd5
2022-06-26 15:47:07.788  INFO [currency-exchange,,] 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8000 (http)
2022-06-26 15:47:07.814  INFO [currency-exchange,,] 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2022-06-26 15:47:07.816  INFO [currency-exchange,,] 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.63]
2022-06-26 15:47:08.034  INFO [currency-exchange,,] 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2022-06-26 15:47:08.034  INFO [currency-exchange,,] 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 6437 ms
2022-06-26 15:47:08.484 ERROR [currency-exchange,,] 1 --- [           main] o.s.b.web.embedded.tomcat.TomcatStarter  : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'webMvcMetricsFilter' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'webMvcMetricsFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'simpleMeterRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleMetricsExportAutoConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataSourcePoolMetadataMeterBinder' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/jdbc/DataSourcePoolMetricsAutoConfiguration$DataSourcePoolMetadataMetricsConfiguration.class]: Unsatisfied dependency expressed through method 'dataSourcePoolMetadataMeterBinder' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2022-06-26 15:47:08.521  INFO [currency-exchange,,] 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2022-06-26 15:47:08.547  WARN [currency-exchange,,] 1 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2022-06-26 15:47:08.618  INFO [currency-exchange,,] 1 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-06-26 15:47:08.663 ERROR [currency-exchange,,] 1 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
        If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
        If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).


Native Memory Tracking:

Total: reserved=4647673752, committed=360292248
-                 Java Heap (reserved=3934257152, committed=181403648)
                            (mmap: reserved=3934257152, committed=181403648)

-                     Class (reserved=192943772, committed=52971164)
                            (classes #9559)
                            (  instance classes #8950, array classes #609)
                            (malloc=1590940 #24005)
                            (mmap: reserved=191352832, committed=51380224)
                            (  Metadata:   )
                            (    reserved=46137344, committed=44564480)
                            (    used=43492240)
                            (    free=1072240)
                            (    waste=0 =0.00%)
                            (  Class space:)
                            (    reserved=145215488, committed=6815744)
                            (    used=6117872)
                            (    free=697872)
                            (    waste=0 =0.00%)

-                    Thread (reserved=20055984, committed=1083312)
                            (thread #19)
                            (stack: reserved=19968000, committed=995328)
                            (malloc=68136 #116)
                            (arena=19848 #35)

-                      Code (reserved=254867960, committed=18545144)
                            (malloc=1235448 #5350)
                            (mmap: reserved=253632512, committed=17309696)

-                        GC (reserved=190061883, committed=50801979)
                            (malloc=9997627 #7092)
                            (mmap: reserved=180064256, committed=40804352)

-                  Compiler (reserved=11178686, committed=11178686)
                            (malloc=35638 #532)
                            (arena=11143048 #15)

-                  Internal (reserved=389891, committed=389891)
                            (malloc=357123 #1153)
                            (mmap: reserved=32768, committed=32768)

-                    Symbol (reserved=13126528, committed=13126528)
                            (malloc=11383312 #133295)
                            (arena=1743216 #1)

-    Native Memory Tracking (reserved=2835432, committed=2835432)
                            (malloc=8120 #101)
                            (tracking overhead=2827312)

-               Arena Chunk (reserved=27594984, committed=27594984)
                            (malloc=27594984)

-                   Tracing (reserved=97, committed=97)
                            (malloc=97 #5)

-                   Logging (reserved=4572, committed=4572)
                            (malloc=4572 #192)

-                 Arguments (reserved=19067, committed=19067)
                            (malloc=19067 #495)

-                    Module (reserved=172456, committed=172456)
                            (malloc=172456 #1850)

-              Synchronizer (reserved=157096, committed=157096)
                            (malloc=157096 #1302)

-                 Safepoint (reserved=8192, committed=8192)
                            (mmap: reserved=8192, committed=8192)

因此,它无法连接到配置服务器,因此它无法连接到数据库,并且它会崩溃。

currency-exchange service application.yml:
spring:
  application:
    name: currency-exchange
  config:
    import: optional:configserver:http://localhost:8888
  cloud:
    config:
      label: master
      uri: http://localhost:8888
      username: gigi
      password: test1234
  jpa:
    show-sql: true

server:
  port: 8000

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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.0</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.gab.microservices</groupId>
    <artifactId>currency-exchange-service</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>currency-exchange-service</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>11</java.version>
        <spring-cloud.version>2021.0.3</spring-cloud.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-sleuth</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-sleuth-zipkin</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.amqp</groupId>
            <artifactId>spring-rabbit</artifactId>
        </dependency>

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

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

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>

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

        <dependency>
            <groupId>io.github.resilience4j</groupId>
            <artifactId>resilience4j-spring-boot2</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>

<!--        <dependency>-->
<!--            <groupId>com.h2database</groupId>-->
<!--            <artifactId>h2</artifactId>-->
<!--            <scope>runtime</scope>-->
<!--        </dependency>-->

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.24</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <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>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <image>
                        <name>eveningstar33/mmv2-${project.artifactId}:${project.version}</name>
                        <pullPolicy>IF_NOT_PRESENT</pullPolicy>
                    </image>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

任何反馈都将受到重视!非常感谢。

共有1个答案

孟杰
2023-03-14

尝试添加jdbc驱动程序作为pom的依赖项。xml,我在您的依赖项中看不到它。

似乎错误在于在依赖项中找不到驱动程序类,所以我开始查找。

 类似资料:
  • 我正在关注应用程序中的条目。 我有下面的spring云服务器应用程序代码。 我收到以下错误。 启动ApplicationContext时出错。要显示条件报告,请在启用“调试”的情况下重新运行应用程序。2021 02月24日01:39:52.356错误20804---[restartedMain]o.s.b.d.LoggingFailureAnalysisReporter: 应用程序无法启动 描述:

  • 在这里,我使用rancher和docker compose来初始化spring cloud config客户端和服务器,但当spring cloud config server未就绪时,客户端启动失败,需要在服务器就绪时重新启动。我想问,当服务器准备就绪时,是否有任何机制可以让SpringCloudConfig客户端重新加载或重新启动?

  • 当我试图启动SpringBoot主应用程序时,出现以下异常。为什么我会得到这个特例。 异常: Spring boot主java类

  • 我的docker版本是1.13.1。我正试图从我的docker容器连接到redis-server,但我遇到了拒绝连接的错误。详细的日志如下: 原因:redis.clients.jedis.exceptions.jedisconnectionException:java.net.Connection:redis.clients.jedis.Connection(Connection.java:207

  • 当我运行以下命令时,我将得到错误: 检测到体系结构x86-64。将主机名设置为。 正在从随机生成器初始化机器ID。 无法移动剩余的userspace进程,忽略:输入/输出错误

  • 我在连接到存储配置的存储库时,在Spring云配置服务器(Spring引导)日志中看到问题。我不确定它是否由于凭据或其他原因而无法克隆(不允许git-upload-pack)。任何指向此的指针都将很棒。 配置服务器应用程序的Spring启动应用程序属性如下所示 - endpoint返回以下响应: