本地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