- 博客(18)
- 收藏
- 关注
原创 SpringBoot如何在新建Bean的时候给其属性赋值
第三种方法:使用Spring Boot的CommandLineRunner或ApplicationRunner。第二种方法:实现InitializingBean接口的afterPropertiesSet方法。第一种方法:使用@PostConstruct注解。
2024-12-10 21:26:42
314
原创 spring boot+spring security认证authorities反序列化失败的错误,SimpleGrantedAuthority`cannot deserialize Object
在实体类user中只有userid,Uusername, Ppassword,role这四个属性都有get,set方法,但是其他方法有返回值,所以在序列化时,其他方法返回的值也会被序列化存在缓存中,此时不会出错,但是从缓存中反序列化时就因为有些值没有set方法,所以会出错。但有时会碰到必须要有有返回值的其他方法,例如在整合security时自定义登录认证和权限认证时需要继承UserDetail,就必须有其他方法,这时候可以RedisTemplate的设置里加。
2024-08-19 00:59:06
710
原创 maven配置报错:The JAVA_HOME environment variable is not defined correctly
解决jdk17中的maven3.8.8配置报错:The JAVA_HOME environment variable is not defined correctly
2024-08-17 12:03:18
473
原创 【报错】Error creating bean with name ‘persistenceExceptionTranslationPostProcessor‘ defined,Invalidname
解决办法将spring-boot-starter-parent这里我的版本是3.3.2版本降低成如下版本。
2024-08-16 12:48:20
470
原创 【报错】Unsatisfied dependency expressed through field ‘driverInfoService‘,Property ‘sqlSessionFactory‘
小结:我这里用到的 spring-boot-starter-parent和mybatis-plus-boot-starter的相关版本如下。先检查在Mapper接口上加。再添加pom.xml依赖。
2024-08-16 12:36:22
558
原创 Spring整合mybatis的applicationContext.xml配置文件
spring整合mybatis中resource下面的配置文件
2022-02-26 22:38:44
480
原创 Rbac-manager权限管理项目
一、RBAC-MANAGER(用户权限管理)1.pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http...
2021-10-14 22:28:14
243
原创 springmvc.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" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc=".
2021-09-15 19:43:29
108
原创 Spring.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" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc=".
2021-09-15 19:32:15
92
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人