![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
spring-boot
spring框架
lx6766
这个作者很懒,什么都没留下…
展开
-
springboot依赖冲突解决
1 spring-boot-starter-parent: 2.3.2->2.3.4 升级到遇到的问题1 jedis报错:NoClassDefFoundError: redis/clients/jedis/util/SafeEncoder原创 2021-06-10 17:11:30 · 1264 阅读 · 0 评论 -
springboot中的access-log
在现在一个项目中,我们对于接口请求日志有自己的格式输出要求,所以就没有使用tomcat自带的access-log。两者本质是相同的,都是为了接口统计。所以如果工作中没有明确需求,可以直接使用tomcat自带的配置实现。springboot中,关于access log的配置# tomcatserver.tomcat.accept-count=1000 server.tomcat.max-connections=12000server.tomcat.min-spare-threads=167原创 2021-01-05 16:51:35 · 2456 阅读 · 0 评论 -
在拦截器里注入对象为空:因为interceptor比applicaitonContext早加载
原因: applicaitionContext在拦截器之后才完成注入处理:@Configurationpublic class WebAppConfigurer implements WebMvcConfigurer{ @Bean public LoginInterceptor loginInterceptor(){ return new LoginInte...原创 2020-02-10 23:46:20 · 478 阅读 · 0 评论 -
全局异常捕获封装的返回类报错HttpMessageNotWritableException: No converter found for return value of type xxx
springboot项目,没有做xml json转换类配置org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class com.xxx.base.NewJson 错误原因,返回类没有写get ,set方法...原创 2019-11-13 19:41:47 · 196 阅读 · 0 评论 -
springboot xml配置方式转为bean注解方式
xml配置:1wm-bean.xml<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xm...原创 2019-09-27 19:13:44 · 4175 阅读 · 0 评论 -
利用maven的多个插件完成自动打包关系,想要什么就指定什么,一切依赖类路径classpath,配置文件内外分profile分别指定
项目通过idea工具进行,执行方式有很多: 1 直接通过idea运行main方法, 2 mvn命名打jar包直接运行jar, 在生成jar的target目录下 java -jar xxx.jar -Dlogpath=D://logs --server.port=8083 3 springboot也有提供启动命令 spring-boot:run1如果想...原创 2019-09-14 16:55:18 · 387 阅读 · 0 评论 -
idea maven项目打包方式:1直接idea build project生成artifact 2 maven命令方式
1方式一:使用project structure---artifacts,但我的springboot使用这种方式,jar包执行有问题jar所在目录 :artifacts2方式二:使用maven命令:可以直接在idea的terminal出执行mvn clean package -DskipTests=true或者在cmd到pom.xml的目录下执行mvn命令jar所...原创 2019-09-13 21:26:44 · 4699 阅读 · 2 评论 -
spring-boot actuator
参考博客https://bigjar.github.io/2018/08/19/Spring-Boot-Metrics%E7%9B%91%E6%8E%A7%E4%B9%8BPrometheus-Grafana/spring-boot 提供了actuator,可通过http 接口请求查看,但更方便的,是通过连接外部的可视化工具,并对项目的一些基本情况做监控,在异常时邮件提醒Spring-...原创 2019-08-30 19:13:36 · 126 阅读 · 0 评论