Spring-Cloud
IOT_Elon
这个作者很懒,什么都没留下…
展开
-
SpringCloud-12-解决报错:Error creating bean with name ‘defaultServletHandlerMapping‘ defined in class pa
容器提供的DefaultServlet不再注册。如果应用程序需要要它,需要进行一定的配置。Spring Boot2.4以上版本默认情况下,嵌入式。在配置文件中增加下面的配置。原创 2022-10-17 16:19:19 · 1246 阅读 · 0 评论 -
SpringCloud-11-解决[NACOS HTTP-GET] The maximum number of tolerable server reconnection errors has bee
若仅使用了nacos的发现功能(discovery),则不需要引入配置依赖“spring-cloud-starter-alibaba-nacos-config”,否则将会报错。错误日志显示的是nacos的服务数量已达最大,实际原因是配置中心出问题了。原创 2022-10-17 16:13:18 · 10642 阅读 · 0 评论 -
SpringCloud-10-配置控制台彩色打印、自定义banner
网上很多教程引入了spring-boot-starter-logging这个依赖,其实不用,因为我们本身就是SpringBoot web项目,当我们引入web依赖的时候,就帮我们引入了logging相关的依赖配置了,所以我们不需要再额外引入转载 2022-10-13 13:04:44 · 561 阅读 · 0 评论 -
SpringCloud-9-Invalid bound statement (not found) 终极解决办法
近期将部分service拆分成公共的依赖资源common-service,但是当引用服务debug时发现一直mapper报错,大概意思mapper下的.xml文件与声明的mapper类没有绑定。加载依赖传递过来的jar包中的mapper目录下的xml,bootstrap.yml配置文件中将classpath:mapper/*.xml 修改为classpath*:mapper/*.xml。原创 2022-10-12 09:20:50 · 439 阅读 · 0 评论 -
SpringCloud-8-解决Fegion的feign.codec.DecodeException报错问题
今天把一个微服务模块迁到了另一个系统,结果Fegion调用一直报错,后来发现是由于访问路径不对,被访问服务相比之前的平台多了了一层路径。feign.codec.DecodeException: Error while extracting response for type [class java.lang.Double] and content type [application/json;charset=utf-8]; nested exception is org.springframework原创 2020-10-26 15:56:04 · 3505 阅读 · 0 评论 -
SpringCloud-6-解决Mybatis方法updateById不能更新null字段
在实体类上添加一个注解即可:原创 2020-04-28 17:18:18 · 516 阅读 · 0 评论 -
Intellij idea -1-解决报错:Error executing Maven. The specified user settings file does not exist: C:\Use
之前打包一直报一个错误:Error executing Maven. The specified user settings file does not exist: C:\Users\lhg\.m2\settings.xml解决办法:将setting文件路径切换为相应maven下的路径...原创 2020-01-11 10:47:55 · 5804 阅读 · 0 评论 -
SpringCloud-5-html跳转失败解决办法:Controller类使用@Controller,而不是@RestController
以spring boot框架为基础的app项目配置thymeleaf后,则可以在app项目中编写静态文件然后使用controller访问静态页面。除了最基本的html+css+js的语法使用,thymeleaf模版还提供了很多强大的语法帮助我们更好地编写静态页面。以下在配置文件添加:spring.thymeleaf.suffix=.htmlspring.thymeleaf.cache=...原创 2019-09-17 22:55:45 · 868 阅读 · 0 评论 -
SpringCloud-4-解决feign请求超时报错:java.net.SocketTimeoutException: Read timed out
熔断器默认1秒未请求到结果即为超时,此时,面对网络环境较差情况,则需要调整超时时间。以下是在配置文件设置60秒超时:hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=60000spring.cloud.loadbalancer.retry.enabled=trueribbon.ReadTi...原创 2019-09-17 22:47:04 · 3484 阅读 · 0 评论 -
SpringCloud-3:解决mapper未扫描到xml文件报错问题
若自己写的sql,使用时报未绑定mapper内方法问题,则说明配置有问题解决办法:在配置文件增加mapper扫描配置即可:mybatis-plus.mapper-locations=classpath:mapper/*.xml...原创 2019-08-16 22:19:44 · 1352 阅读 · 0 评论 -
SpringCloud-2:解决Feign访问超时报错问题:Read timed out executing GET http://······
feign默认请求时间仅几秒钟,若其他服务返回比较慢就会造成超时报错问题解决办法:在配置文件中增加超时时间设置:ribbon.ReadTimeout=60000ribbon.ConnectTimeout=60000...原创 2019-08-16 22:16:41 · 5374 阅读 · 1 评论 -
SpringCloud-1:解决报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating
现引进spring cloud将原单机版项目,拆分为10多个微服务方式,目前主要服务基本完成今天部署一个服务时,遇到这样一个报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating原因是:微服务默认去8888端口获取配置文件,或者读取application.properti...原创 2019-07-24 16:49:40 · 6909 阅读 · 0 评论