Fetching config from server at : http://localhost:8888

本文详细介绍了Spring Cloud配置中心的使用方法,包括如何在本地开发环境中通过配置避免连接超时的问题,以及如何在服务器上运行配置中心,以便本地开发能够获取到所需的配置。文章还提到了使用spring.cloud.config属性进行配置的细节。
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency> 

 

2018-12-28 20:37:43.157  INFO 21172 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2018-12-28 20:37:43.353  INFO 21172 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$1f04b1d0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

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

2018-12-28 20:37:45.789  INFO 21172 --- [  restartedMain] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://localhost:8888
2018-12-28 20:37:46.889  INFO 21172 --- [  restartedMain] c.c.c.ConfigServicePropertySourceLocator : Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available
2018-12-28 20:37:46.889  WARN 21172 --- [  restartedMain] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/product/default": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
2018-12-28 20:37:46.891  INFO 21172 --- [  restartedMain] a.k.KitchenProductServerApplication      : The following profiles are active: dev

 

 

添加配置    spring.cloud.config =false 

 

还有种场景是  Fetching config from server at : http://192.1.1.133:8888  这里的192.1.1.133是指镜像布置后自键overlay类型网段下的ip ,与本地开发机网不通,所以可以将config 以jar形式允行在服务器上 这样 本地开发就可拿到配置了

转载于:https://www.cnblogs.com/nhz-M/p/10192708.html

H:\jdk\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" "-javaagent:D:\IDEA\IntelliJ IDEA 2023.1\lib\idea_rt.jar=60134:D:\IDEA\IntelliJ IDEA 2023.1\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\admins\AppData\Local\Temp\classpath402152749.jar com.OaApplication SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/H:/MVN/apache-maven-3.6.1/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/H:/MVN/apache-maven-3.6.1/org/apache/logging/log4j/log4j-slf4j-impl/2.13.3/log4j-slf4j-impl-2.13.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder] 2025-03-27 15:46:59.821 INFO 24032 - [background-preinit] [o.h.validator.internal.util.Version,<clinit>,21] : HV000001: Hibernate Validator 6.1.7.Final 2025-03-27 15:46:59.927 INFO 24032 - [restartedMain] [o.s.b.d.e.DevToolsPropertyDefaultsPostProcessor,logTo,225] : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.3.12.RELEASE) 2025-03-27 15:47:01.949 INFO 24032 - [restartedMain] [o.s.c.c.c.ConfigServicePropertySourceLocator,getRemoteEnvironment,257] : Fetching config from server at : http://localhost:8888 2025-03-27 15:47:04.138 INFO 24032 - [restartedMain] [o.s.c.c.c.ConfigServicePropertySourceLocator,getRemoteEnvir
03-28
21:52:18.428 [Thread-0] DEBUG org.springframework.boot.devtools.restart.classloader.RestartClassLoader - Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@3410cfae . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.7.0) 2025-06-11 21:52:19.426 INFO [,,] 23176 --- [ restartedMain] com.hospital.LxjApplication : Starting LxjApplication using Java 19 on DESKTOP-1QAH2DU with PID 23176 (E:\2025年文件\医疗系统\hospital_infront\target\classes started by dell in E:\2025年文件\医疗系统\hospital_infront) 2025-06-11 21:52:19.427 INFO [,,] 23176 --- [ restartedMain] com.hospital.LxjApplication : No active profile set, falling back to 1 default profile: "default" 2025-06-11 21:52:19.473 INFO [,,] 23176 --- [ restartedMain] o.s.c.c.c.ConfigServerConfigDataLoader : Fetching config from server at : http://localhost:8888 2025-06-11 21:52:19.473 INFO [,,] 23176 --- [ restartedMain] o.s.c.c.c.ConfigServerConfigDataLoader : Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available 2025-06-11 21:52:19.473 WARN [,,] 23176 --- [ restartedMain] o.s.c.c.c.ConfigServerConfigDataLoader : Could not locate PropertySource ([ConfigServerConfigDataResource@2941e75 uris = array<String>['http://localhost:8888'], optional = true, profiles = list['default']]): I/O error on GET request for "http://localhost:8888/application/default": Connection refused: no further information; nested exception is java.net.ConnectException: Connection refused: no further information 2025-06-11 21:52:19.474 INFO [,,] 23176 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2025-06-11 21:52:19.474 INFO [,,] 23176 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2025-06-11 21:52:20.168 INFO [,,] 23176 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2025-06-11 21:52:20.344 INFO [,,] 23176 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 169 ms. Found 10 JPA repository interfaces. 2025-06-11 21:52:20.934 INFO [,,] 23176 --- [ restartedMain] o.s.cloud.context.scope.GenericScope : BeanFactory id=0d55cccc-710b-3b96-99af-97eae531b364 2025-06-11 21:52:21.751 INFO [,,] 23176 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2025-06-11 21:52:21.761 INFO [,,] 23176 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2025-06-11 21:52:21.761 INFO [,,] 23176 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.63] 2025-06-11 21:52:21.850 INFO [,,] 23176 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2025-06-11 21:52:21.851 INFO [,,] 23176 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2376 ms 2025-06-11 21:52:22.211 INFO [,,] 23176 --- [ restartedMain] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource 2025-06-11 21:52:22.388 INFO [,,] 23176 --- [ restartedMain] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited 2025-06-11 21:52:22.662 ERROR [,,] 23176 --- [eate-1539298006] com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: jdbc:mysql://localhost:3306/hosp_infront?serverTimezone=UTC&&characterEncoding=utf-8, errorCode 1049, state 42000 java.sql.SQLSyntaxErrorException: Unknown database 'hosp_infront' at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.28.jar:8.0.28] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.28.jar:8.0.28] at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:829) ~[mysql-connector-java-8.0.28.jar:8.0.28] at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:449) ~[mysql-connector-java-8.0.28.jar:8.0.28] at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:242) ~[mysql-connector-java-8.0.28.jar:8.0.28] at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[mysql-connector-java-8.0.28.jar:8.0.28] at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:149) ~[druid-1.1.9.jar:1.1.9] at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:218) ~[druid-1.1.9.jar:1.1.9] at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:143) ~[druid-1.1.9.jar:1.1.9] at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1515) ~[druid-1.1.9.jar:1.1.9] at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1578) ~[druid-1.1.9.jar:1.1.9] at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466) ~[druid-1.1.9.jar:1.1.9] 2025-06-11 21:52:22.677 ERROR [,,] 23176 --- [eate-1539298006] com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: jdbc:mysql://localhost:3306/hosp_infront?serverTimezone=UTC&&characterEncoding=utf-8, errorCode 1049, state 42000 java.sql.SQLSyntaxErrorException: Unknown database 'hosp_infront'
最新发布
06-12
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值