The last packet sent successfully to the server was 0 milliseconds ago 问题研究

应用数据库从MYSQL迁移到XDB

迁移过程中,有一个web后端应用修改数据库配置之后报错

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-10-09 17:12:13,170 ERROR [main] o.s.boot.SpringApplication [SpringApplication.java : 842] Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'RRExceptionHandler': Unsatisfied dependency expressed through field 'XXXXXXX'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXXXXXX': Invocation of init method failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
### The error may exist in xxxxxxxxxxxxxxx.java (best guess)
### The error may involve xxxxxxxxxxxxx.selectList
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

检索此问题,大多指向数据库连接配置文件或者数据库服务端连接配置,但是始终无法解决问题

检查数据库网络连接正常,mysql驱动版本正常,最终发现问题为加密数据库用户名密码所使用的加密组件影响导致,pom配置如下

        <dependency>
            <groupId>com.github.ulisesbocchio</groupId>
            <artifactId>jasypt-spring-boot-starter</artifactId>
            <version>2.1.2</version>
        </dependency>

当不使用此插件后,应用启动正常。至于底层机制上的原因有待进一步研究

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值