SpringCloud微服务踩坑记录分享
SpringCloud微服务踩坑记录
consul
1.nested exception is java.lang.IllegalArgumentException: Consul service ids must not be empty, must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen:null
微服务不能启动,报错,网上修改建议一般是修改配置文件的service-name和instance-id,修改后仍然不好用。
后来解决方式是换了springcloud的版本
2.报错如下
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘configurationPropertiesBeans’ defined in class path resource [org/springframework/cloud/autoconfigure/ConfigurationPropertiesRebinderAutoConfiguration.class]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.context.properties.ConfigurationPropertiesBeans] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.context.properties.ConfigurationPropertiesBeans] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.ConfigurationBeanFactoryMetadata
原因
springboot版本和Spring cloud版本不匹配
后来版本分别选用2.2.5和Hoxton.SR3解决
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.5.RELEASE</version> </parent>
<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <spring-cloud.version>Hoxton.SR3</spring-cloud.version> </properties>
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
java long转String +Codeforces110A案例
这篇文章主要介绍了java long转String +Codeforces110A案例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧2020-09-09mybatis如何通过接口查找对应的mapper.xml及方法执行详解
这篇文章主要给大家介绍了利用mybatis如何通过接口查找对应的mapper.xml及方法执行的相关资料,文中通过示例代码介绍的非常详细,对大家具有一定的参考学习价值,需要的朋友们下面跟着小编一起来学习学习吧。2017-06-06SpringBoot3集成SLF4J+logback进行日志记录的实现
本文主要介绍了SpringBoot3集成SLF4J+logback进行日志记录的实现,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2022-01-01
最新评论