
spring boot/cloud
王子様~
这个作者很懒,什么都没留下…
展开
-
win版minIO运行、以及与jeecgboot结合使用
minio安装使用原创 2022-09-20 09:24:16 · 968 阅读 · 0 评论 -
springboot枚举工具类
枚举的使用原创 2022-09-19 15:54:09 · 327 阅读 · 0 评论 -
springboot 引入外部jar包,项目打包成war包发布
项目中引入了私jar包,打包成war需要一些插件,不然Linux上会找不到class包的位置pom文件加入依赖 <dependency> <groupId>xxx</groupId> <artifactId>xxx</artifactId> <version>8.5.2</version> <.原创 2021-07-02 13:34:30 · 282 阅读 · 0 评论 -
spring boot 项目打成jar包后读取文件问题
java.io.FileNotFoundException: class path resource [xxx.xls]cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/D:/新建文件夹/xxx.jar!/BOOT-INF/classes!/export/xxx.xlsat org.springframework.util.ResourceUtils.get.原创 2021-06-19 14:00:52 · 952 阅读 · 1 评论 -
springboot 通过注解设置VO字段json序列化
老项目升级,导致许多数据格式出现问题吗,这里需要对返回值做修改,有些字段的返回格式问题导致服务间调用报错,前端也需要修改判断,很麻烦,这里介绍通过注解的方式,来设置某些字段不参与序列化针对某个实体,比如ResultInfo //数据对象 //将该标记放在属性上,如果该属性为NULL则不参与序列化 //如果放在类上边,那对这个类的全部属性起作用 @JsonInclude(JsonInclude.Include.NON_NULL) private T data;其他注解介.原创 2021-06-17 17:53:23 · 1355 阅读 · 0 评论 -
springboot 请求结果json手动转换null
发现springboot框架返回json给前端时,前端要求需要对null等做处理,json版本不同转出的效果不一样,这里手动重写转换字符新增一个配置类,重写json转换null问题 @Configuration public class ResultConfig { @Bean public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() { M.原创 2021-06-11 11:14:51 · 635 阅读 · 2 评论 -
Springboot 项目JSON parse error: Unrecognized field “xxx“错误
遇到一个问题,手动重写json转换后,前端请求参数中的多余字段,导致请求报错,重写前框架自带的方法是不报错的,那只有手动解决了解决前端请求多余字段转换报错问题注解的方式:在实体类加注解 @JsonIgnoreProperties(ignoreUnknown = true) ,这只能解决某个请求重写配置类方式 @Configuration public class MvcConfig implements WebMvcConfigurer { @Bean p.原创 2021-06-11 11:11:06 · 7532 阅读 · 0 评论 -
signing key‘s algorithm ‘AES‘ does not equal a valid HmacSHA
The signing key’s algorithm ‘AES’ does not equal a valid HmacSHA* algorithm name and cannot be used笔者出现如题问题是因为老项目切换时,创建jwt token报此错误,以前的项目是正常的,猜想是项目切换后版本问题解决方法:修改为HmacSHA256 key =new SecretKeySpec(encodedKey, 0, encodedKey.length, "HmacSHA256");.原创 2021-05-28 09:38:02 · 4050 阅读 · 1 评论 -
springboot 项目发现一直连接Redis失败问题
如题,有两种情况:1、自动连接localhost:6379,连接Redis失败,其实并没有配置Redis连接2、自动任务5000ms一次去连接Redis,Connection failure occurred. Restarting subscription task after 5000 ms我们在新建项目时,没有依赖Redis发现会报错,RedisConnectionFactory啥啥的报错,然后依赖后会出现1和2的报错这里介绍解决办法。去除Redis的pom依赖,如果你的项目不需要的.原创 2021-05-19 14:53:34 · 2868 阅读 · 0 评论 -
feign.RetryableException: Read timed out executing 异常
feign.RetryableException: Read timed out executing 异常解决办法这里记录下解决超时问题方法有修改feign配置文件方法1方法2这两者方法,我没试我的办法是修改,配置类的时间(把Options)两个时间值改大: @Bean public IEventUserService userServiceBuildForEvent(){ return Feign.builder() .encoder(ne.原创 2020-06-08 17:53:25 · 1072 阅读 · 0 评论 -
feign.RetryableException: Connection refused (Connection refused) executing GET http://localhost:909
feign远程调用异常问题: feign.RetryableException: Connection refused (Connection refused) executing GET http://localhost:9090/xxat feign.FeignException.errorExecuting(FeignException.java:67)报错如图报错原因是:调用的地址端口有错,修改好端口后重启就ok...原创 2020-06-03 13:52:09 · 7813 阅读 · 0 评论 -
feign No serializer found for class java.io.FileDescriptor and no properties discovered to create Be
No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference ch...原创 2020-04-18 10:59:39 · 23081 阅读 · 3 评论 -
org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column 'xx' from
今天笔者同事遇到一个问题,如题,一看org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column ‘tache_id’ from result set. Cause: java.sql.SQLException: Error;错误很明显啊,在看代码好像也没错,代码还是上次用过的第一反...原创 2020-04-08 13:30:59 · 18853 阅读 · 0 评论 -
org.apache.ibatis.binding.BindingException: Invalid bound statement (not fou
今天遇到mybatis的插入数据方法一直报错,检查了很久,才解决问题原因是读写分离的config配合类里的mapper路径不对.没有写到write下,读写分离是分两个两个文件夹:read、write;在readConfig也是这样的问题,没有写到read文件夹下这个问题估计很多人原因不一样,很难排查,大致原因就是没扫到mapper还有很多网友的问题以及解决解决1解决2解决3......原创 2020-03-19 17:59:29 · 8165 阅读 · 0 评论 -
swagger界面 @RequestBody 参数类错误,变成了其他参数类
遇到一个问题:swagger界面 @RequestBody 参数类错误,变成了其他参数类,不是相应的类,看类写的没错,属性都没错,检查半天结果原因是:有两个类的注解值一样的,这种问题一般是复制问题,或多人开发写的问题两个注解值写的一样,导致一直是前者的属性字段,...原创 2020-03-18 18:53:17 · 2895 阅读 · 2 评论 -
SpringBoot注解验证参数
SpringBoot注解验证参数使用实例 public class Test { @NotNull(message = "ID不能为空") @Range(min = 1, max = 100, message = "ID必须在1到100之间") private Integer id; @NotBlank(message =...原创 2020-03-16 16:00:59 · 192 阅读 · 0 评论 -
Ambiguous mapping. Cannot map 'xxController' method
springboot启动报错:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘documentationPluginsBootstrapper’ defined in URL [jar:file:/D:/mavenlib/repository/io/s...原创 2020-03-14 11:16:26 · 322 阅读 · 0 评论 -
Martin Fowler关于微服务的原文翻译(一)
微服务一个新的架构术语“微服务架构”一词是在过去几年里涌现出来的,它用于描述一种独立部署的软件应用设计方式。这种架构方式并没有非常明确的定义,但有一些共同的特点就是围绕在业务能力、自动化布署、端到端的整合以及语言和数据的分散控制上面。“微服务”- 这是在软件架构领域这个非常拥挤的街道上,冒出的一个新名词而已。虽然我们对这个新出的名词不屑一顾,但是它所描述的软件系统的风格越来越吸引我们的注意...转载 2020-02-10 10:53:12 · 216 阅读 · 0 评论 -
springboot AOP保存日志
这里介绍aop保存日志,重点是切入类介绍,监听service方法调用,新增、修改、删除等@Aspect和@Component首先,这个@Aspect注释告诉Spring这是个切面类,然后@Compoment将转换成Spring容器中的bean或者是代理bean。 总之要写切面这两个注解一起用就是了。既然是切面类,那么肯定是包含PointCut还有Advice两个要素的,下面对几个注解...原创 2019-11-14 10:31:43 · 243 阅读 · 0 评论 -
swagger2使用
作者:LoveEmperor-王子様spring boot项目整合swagger2背景通常同学们采用统一编写word接口文档,但有时在不完善的情况下,几个痛点会让人无语: 接口文档规范问题 文档需要实时更新 接口文档太多,不好管理 基于痛点,我们可以采用自动生成文档模式:swagger2、RAP等简介代码侵入式注解自动生成api文档(swagge...原创 2018-07-05 13:05:10 · 5653 阅读 · 0 评论 -
精选Spring Boot三十五道必知必会知识点!
精选Spring Boot三十五道必知必会知识点! 原文地址:https://mp.weixin.qq.com/s/js2R_ySNp-EMlKcjIsxdMw原创 2018-09-17 10:14:37 · 278 阅读 · 0 评论 -
SpringBoot工作机制概述
原文:https://blog.csdn.net/m0_37962779/article/details/78957309 1 SpringBoot简介SpringBoot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程。该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。通过这种方式,Boo...转载 2018-09-17 21:16:52 · 387 阅读 · 0 评论 -
IOC 之深入理解 Spring IoC
原文: https://blog.csdn.net/chenssy/article/details/82343456 在一开始学习 Spring 的时候,我们就接触 IoC 了,作为 Spring 第一个最核心的概念,我们在解读它源码之前一定需要对其有深入的认识,本篇为【...转载 2018-09-18 11:14:54 · 192 阅读 · 0 评论 -
springboot+Thymeleaf引擎+Vue
原文写在了github上,这里搬过来主要便于搜索,点击下面链接springboot+Thymeleaf引擎+Vue原创 2019-01-28 22:45:27 · 2929 阅读 · 0 评论 -
nested exception is java.lang.IllegalArgumentException: Not a managed type: class
springboot中启动项目报错错误,解决办法在启动类上添加实体包路径添加注解@EntityScan("your.entities.package")截图:原创 2019-04-27 10:33:50 · 6815 阅读 · 0 评论 -
org.hibernate.tool.schema.spi.CommandAcceptanceException:Error executing DDL via JDBC Statement
springboot中使用jpa自动生成表时报错,解决办法配置spring.jpa.database-platform添加配置spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect或者版本不一样可以配置如下中的某个: org.hibernate.dialect.MySQL5Dialect ...原创 2019-04-27 10:43:33 · 780 阅读 · 0 评论 -
spring boot 不配置数据库启动,报错问题
新建一个中间服务不连接数据,不用配置数据库信息等但用spring boot 搭建的项目,在配置文件不配置数据库启动项目会报错。原因在于spring boot默认会加载org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration类,DataSourceAutoConfiguration类使用了@Conf...原创 2019-05-16 19:09:03 · 8663 阅读 · 3 评论 -
Could not extract response: no suitable HttpMessageConverter found for response type [class xx] and
springboot使用RestTemplate报错:Could not extract response: no suitable HttpMessageConverter found for response type [class xx] and …spring boot版本大于1.4的时候,spring boot不会再自动装配定义一个RestTemplate,需要手动创建,用一下代...原创 2019-05-16 20:06:22 · 11628 阅读 · 0 评论 -
springboot 上传文件大小限制的配置
上传文件文件过大时出现如下错误:org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException: The field pic exceeds its maximum permitted size of 1048576 bytes.这是我们配置文件设置问题,调整即可在启动类中加入:...原创 2019-06-03 14:56:11 · 1257 阅读 · 0 评论 -
springboot jpa hikari连接池配置
springboot jpa与hikari连接池配置application.properties文件配置: spring.jpa.hibernate.ddl-auto=update spring.datasource.hikari.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://...原创 2019-06-22 10:27:54 · 5274 阅读 · 0 评论 -
Springboot项目打成war包,部署到tomcat上,正常启动访问报错404
在启动后的项目中放一张图片,图片可访问,说明tomcat没问题,ip、端口没问题,那就是包的问题,但用的maven打包,应该么问题?笔者也是折腾许久。。。解决方法:启动类里重写配置,并继承extends SpringBootServletInitializer /** * 将项目打成war包 * 1:修改启动类,继承SpringBootServletInitial...原创 2019-08-06 15:10:13 · 1516 阅读 · 0 评论 -
Spring Boot项目 整合Swagger2
LoveEmperor-王子様E 转载:https://blog.csdn.net/saytime/article/details/74937664 相信各位在公司写API文档数量应该不少,当然如果你还处在自己一个人开发前后台的年代,当我没说,如今为了前后台更好的对接,还是为了以后交接方便,...转载 2018-07-04 11:20:08 · 552 阅读 · 0 评论