项目本地可以运行, 放到线上就启动不了

newlifely 2017-09-12 02:11:22
本地tomcat启动这个war 包,以及在虚拟机上运行可以顺利执行,唯独放到线上就报错,两台服务器都错。

有没有朋友遇到过这样的情况,不知道怎么解决啊。










Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException:

Error creating bean with name 'sqlSessionTemplate' defined in file [/usr/local/apache-tomcat-7.0.79/webapps/xwqb-web/WEB-INF/classes/fbd/web/spring/applicationContext-datasource.xml]:

Cannot resolve reference to bean 'sqlSessionFactory' while setting constructor argument;

nested exception is org.springframework.beans.factory.BeanCreationException:

Error creating bean with name 'sqlSessionFactory' defined in file [/usr/local/apache-tomcat-7.0.79/webapps/xwqb-web/WEB-INF/classes/fbd/web/spring/applicationContext-datasource.xml]:

Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource';

nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in file

[/usr/local/apache-tomcat-7.0.79/webapps/xwqb-web/WEB-INF/classes/fbd/web/spring/applicationContext-datasource.xml]:

Cannot resolve reference to bean 'masterDs' while setting bean property 'targetDataSources' with key [TypedStringValue: value [masterDs], target type [class java.lang.String]];

nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'masterDs' defined in file

[/usr/local/apache-tomcat-7.0.79/webapps/xwqb-web/WEB-INF/classes/fbd/web/spring/applicationContext-datasource.xml]: Invocation of init method failed;

nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
...全文
970 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
newlifely 2017-09-12
  • 打赏
  • 举报
回复
引用 1 楼 u013835778 的回复:
数据库连接错误,数据库配置问题
完全正确,同事把配置配的是虚拟机里的地址。。所以本地和测试环境都ok 唉,折腾了好久
lifewell1 2017-09-12
  • 打赏
  • 举报
回复
数据库连接错误,数据库配置问题

24,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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