![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
后端
fly_or
这个作者很懒,什么都没留下…
展开
-
Quartz多应用共用一个数据库,定时任务不执行
Quartz多应用共用一个数据库,定时任务不执行原创 2024-06-05 10:55:49 · 250 阅读 · 0 评论 -
Maven打包时指定配置文件
springboot项目通常会有部署到测试、演示、生产等多个环境,每次打包时都需要修改配置文件或指定配置文件,既麻烦,也不便于war包部署和版本管理。可以在maven打包时指定配置文件,实现打包配置文件零修改。原创 2022-09-14 10:17:44 · 7712 阅读 · 0 评论 -
Springboot集成Neo4j与Shiro冲突
springboot集成neo4j时,由于neo4j与shiro均包含名为"sessionFactory"的bean,项目启动时在生成neo4j的session对象时,createSharedSession方法报类型转换错误,此时需要为neo4j的"sessionFactory"重命名。代码如下:/** * @Author ZDJ * @Date 2022-5-7 8:34 * @Description */import org.neo4j.ogm.session.Sess...原创 2022-05-09 14:15:40 · 475 阅读 · 0 评论 -
No bean of type ‘org.apache.shiro.realm.Realm‘ found
Springboot + Mybatis-plus,集成shiro,启动报错: No bean of type 'org.apache.shiro.realm.Realm' found. Please create bean of type 'Realm' or add a shiro.ini in the root classpath (src/main/resources/shiro.ini) or in the META-INF folder (src/main/resources/META-原创 2022-03-03 14:53:15 · 9433 阅读 · 4 评论 -
Mybatis-plus字段名称有下划线查询为null
在Mybatis-plus中自己写sql查询时,采用 resultType 做字段映射,带下划线的字段值查询不到。 <select id="pageW_XKXMSJLXRSearch" resultType="cjw.nic.niceasy.szyzgts.module.wy_ysgl.wy_01.wy_01_03.entity.W_XKXMSJLXR"> SELECT temp.* FROM ( SELECT t.* from w_xkxmsjlxr t原创 2021-07-27 10:41:16 · 1546 阅读 · 1 评论 -
Springboot打war包Filter依赖注入为null
近期Springboot项目需要在国产Web容器上运行,在打完war包启动后出现Filter中注入的bean为null的错误。 在网上搜了一圈,解决方案如下: public void init(FilterConfig filterConfig) throws ServletException { ServletContext servletContext = filterConfig.getServletContext(); WebA...原创 2021-07-20 17:59:50 · 555 阅读 · 0 评论 -
MyBatis查询结果与数据库直接查询结果不一致
原因就是“事务”原创 2021-05-17 11:10:09 · 1447 阅读 · 0 评论 -
Springboot Controller层@Autowored注入值为null
记录一下自己在项目中遇到的一个很坑爹的问题。现象:随手写了一个controller层的代码,一直报空指针的错误,debug发现@Autowired注入类为null。原因:Controller @Autowired注解 注入值突然为null的问题 具体原因为使用Springboot Aop切片,private修饰的方法无法被代理,该controller类无法被Spring托管,导致bean注入失败,报空指针错误。解决方法:方法修饰符改为public就ok了。...原创 2021-01-19 10:37:49 · 989 阅读 · 0 评论 -
Springboot方法未纳事务管理,导致redis无法缓存
Springboot方法未纳事务管理,导致redis无法缓存背景:springboot项目集成了mybatis-plus,采用redis缓存出现问题:在方法上接入缓存注解,但是redis库中无缓存@Cacheable(cacheNames= CacheConstant.SYS_USERS_CACHE, key="#dlzh") public S_YHRYForLoginVo getUserByDlzh(String dlzh){ //mybatis-plus查询原创 2020-10-14 11:19:45 · 253 阅读 · 0 评论