springboot项目部署docker出错、sqlSessionFactory的类路径中定义的资源、异常是com.mysql.jdbc4通信异常:通信链路失败

守住1份坚持_林 2019-04-18 10:35:55
1.我打的jar包,打包前用docker中的mysql和redis测试过,都OK的,但是把项目部署上去后,访问不到数据,然后我查看日志,出现以下报错:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceAutoConfigure.class]: Invocation of init method failed; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

,哪位大神知道,请告知,谢谢
...全文
189 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
不是这个问题哦,刚刚已找大佬解决,还是谢谢你!
tianfang 2019-04-19
  • 打赏
  • 举报
回复
检查: 资源的在docker中的配置,特别是 ip , 软交换机上的防火墙

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧