关于`Apache Tomcat存在文件包含漏洞`的整改

刷新依赖,正常情况下,这一步就直接结束了,然而我们项目在仅替换了SpringBoot版本之后出现了问题。。

解决问题

  1. Redis报错
  • Problem:

java.lang.ClassNotFoundException: redis.clients.jedis.util.SafeEncoder

  • Solution:

直接修改jedis版本:<jedis.version>2.9.0</jedis.version> 升级为 <jedis.version>3.1.0</jedis.version>

redis.clients

jedis

${jedis.version}

修改导入:import redis.clients.util.SafeEncoder;改为:import redis.clients.jedis.util.SafeEncoder;

  1. 循环依赖错误

项目启动时出现了两处循环依赖的问题,A依赖B,B又依赖了A。。这类错误会被Spring检测到,如下:

  • Problem:

ERROR org.springframework.boot.SpringApplication - Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘wxOpenidUtil’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name ‘wxOpenidServiceImpl’: Bean with name ‘wxOpenidServiceImpl’ has been injected into other beans [wxOpenidServiceImpl] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final

version of the bean. This is often the result of over-eager type matching - consider using ‘getBeanNamesOfType’ with the ‘allowEagerInit’ flag turned off, for example.

ERROR org.springframework.boot.SpringApplication - Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sysUserService’: Bean with name ‘sysUserService’ has been injected into other beans [sysRoleService] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using ‘getBeanNamesOfType’ with the ‘allowEagerInit’ flag turned off, for example.

  • Solution:
  1. 可在代码层面解决这类问题,即对依赖对象的方法重新在自己的类内实现一遍;

  2. 在B中依赖A的地方使用@Lazy注解,实现Spring注入bean的策略调整;

至此,关于Apache Tomcat存在文件包含漏洞的整改完毕。

  • 整改前

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注Java获取)

img

总结

阿里伤透我心,疯狂复习刷题,终于喜提offer 哈哈~好啦,不闲扯了

image

1、JAVA面试核心知识整理(PDF):包含JVMJAVA集合JAVA多线程并发,JAVA基础,Spring原理微服务,Netty与RPC,网络,日志,ZookeeperKafkaRabbitMQ,Hbase,MongoDB,Cassandra,设计模式负载均衡数据库一致性哈希JAVA算法数据结构,加密算法,分布式缓存,Hadoop,Spark,Storm,YARN,机器学习,云计算共30个章节。

image

2、Redis学习笔记及学习思维脑图

image

3、数据面试必备20题+数据库性能优化的21个最佳实践

image
《一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码》点击传送门即可获取!
链图片转存中…(img-SUElRG2Z-1711890391716)]
《一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码》点击传送门即可获取!

  • 14
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值