![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring boot
石药
Daemon or Demon? Only a nidea !
展开
-
【日常补录】springboot使用spring的AOP实现审计日志功能
背景公司的系统管理项目等需要添加用户对配置信息,组织权限,登录信息等内容做操作记录的登记,用于做审计使用。实现方式直接使用业务代码添加对应代码(太多冗余代码,使用不方便)使用aop切面+注解的方式快捷的记录信息(本文使用的就是这种方式)代码大纲注: gradle或者maven引入springboot的相关包和spring-boot-starter-aop添加类:自定义注解类:AuditLogAspectAOP切面类:VinceAspectj自己的业务类:xxxService自己的c原创 2022-01-19 11:50:00 · 3018 阅读 · 0 评论 -
springboot 启动异常tried to access method org.springframework.core.convert.support.DefaultConversionServ
第一次写文章见谅异常缘由:由于公司项目需要将项目从普通springmvc项目转为spring boot;转换后做了适当配置后在idea上可以运行springboot配置的web项目,但是部署的时候就抛出了版本冲突相关的异常;困扰了好几天,几个同事一起查找问题都没解决;最后老大删除了部分依赖和代码才解决了问题;后面我根据错误提示找到可能冲突的对应的jar包,通过goole发现是项目中的activ原创 2016-10-28 16:28:41 · 12346 阅读 · 1 评论 -
spring转springboot后,使用注解方式配置spring相关配置
spring项目转springboot项目后,一般只需要配置yml相关的属性就可以;当是有时候需要一些比较复杂的配置就需要使用bean注解方式来配置;1.. 将spring相关的xml 中的bean对象进行注入:直接上代码:yml配置就不给出了spring.xml:<beans default-lazy-init="false" xmlns="http://www.原创 2016-12-15 17:04:49 · 7335 阅读 · 0 评论 -
Caused by: java.lang.IllegalArgumentException: At least one JPA metamodel must be present!
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappingContext': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: At原创 2017-06-29 10:35:05 · 3970 阅读 · 1 评论 -
springboot CGLib 方式实现AOP代理问题
在Spring Boot中引入AOP就跟引入其他模块一样,非常简单,只需要在pom.xml中加入如下依赖: org.springframework.boot spring-boot-starter-aop在完成了引入AOP依赖包后,一般来说并不需要去做其他配置而当我们需要使用CGLIB来实现AOP的时候,需要配置spring.aop.proxy-target-原创 2016-12-15 16:46:07 · 24507 阅读 · 5 评论 -
spring-boot 事务异常: because it is a JDK dynamic proxy that implement
使用spring-boot做事务管理时,出现异常:The bean 'xxx' could not be injected as a 'xx.xxxx' because it is a JDK dynamic proxy that implements:搞了半天发现是因为代理的原因;异常信息:Error starting ApplicationContext. To display t原创 2017-08-01 09:40:38 · 27308 阅读 · 5 评论 -
基于springboot2.x 的redis配置及使用
使用背景目前公司使用的都是springboot1.5.x + oauth2 + redis做权限认证服务;鉴于学习oauth2的目的,搭建简单的demo demo工程使用springboot2.0.6 为基础构建问题出现警告:无法连接到redis2018-10-18 12:00:50.136 WARN 1996 --- [io-10110-exec-2] o.s.s.o.pro...原创 2018-10-18 13:50:17 · 7151 阅读 · 0 评论 -
”填坑“ -- springboot 启动报错 “Process finished with exit code 1”
pom文件中一个”0“ 引发的血案背景近期使用spring boot2.0做新项目demo时,发现启动boot项目时,控制台什么错误日志都不显示,显示如下信息:Process finished with exit code 1可能问题启动时存在这种情况时,基本上是以下几种情况导致:1. yml配置文件有特殊字符错误2. pom.xml 文件多了特殊字符3. 其他配...原创 2019-02-18 15:59:00 · 12044 阅读 · 0 评论 -
"填坑" 之 swagger2 页面无法访问:This is common when using dynamic servlet registration or when the API is
错误信息Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway. The base url is the root of where all the swagger resources are served...原创 2019-02-19 09:32:08 · 1904 阅读 · 0 评论