- 记录一个练习dubbo时遇到的小问题SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@8c0561] was not registered for synchronization because synchronization is not active
- 刚开始练习dubbo时,消费方报错com.alibaba.dubbo.remoting.TimeoutException: Waiting server-side response timeout by scan timer,起初以为是注册中心的问题,查看zookeeper状态,是正常的,
[root@centos7 bin]# ./zkServer.sh status ZooKeeper JMX enabled by default Using config: /usr/local/zookeeper/zookeeper-3.4.12/bin/../conf/zoo.cfg Mode: standalone
- 后来进入debugger模式,看看控制台信息,发现在连接mysql数据库时,有以下提示SqlSession[org.apache.ibatis.session.defaults.DefaultSqlSession@8c0561] was not registered for synchronization because synchronization is not active
JDBCConnection[com.mchange.v2.c3p0.impl.NewProxyConnection@746e11 [wrapping: com.mysql.jdbc.JDBC4Connection@176eafb]] will not be managed by Spring
连接mysql数据库问题,由于我之前项目还可以跑通,因该不是代码问题,我就查看mysql服务器,发现防火墙阻止了mysql的端口 -
解决办法
添加端口放行
firewall-cmd --zone=public --add-port=3306/tcp --permanent (–permanent永久生效,没有此参数重启后失效)
重启防火墙
systemctl restart firewalld.service