启动Tomcat,发布项目报错
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: java.net.ConnectException: Connection refused: connect
STACKTRACE:
java.net.SocketException: java.net.ConnectException: Connection refused: connect
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:151)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1765)
at com.mysql.jdbc.Connection.<init>(Connection.java:430)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
......................
严重: Exception sending context initialized event to listener instance of class org.springframework.web.util.Log4jConfigListener
java.lang.IllegalStateException: Web app root system property already set to different value: 'webApp.root' = [C:\apache-tomcat-6.0.35\webapps\myspring\] instead of [C:\apache-tomcat-6.0.35\webapps\springmvc\] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
后来去Tomcat的webapps目录下,发现有一个springmvc的项目,删除。再启动,重新发布就ok了。
出现问题不要急于解决,先认真看下log,仔细分析。否则,很可能白白的浪费时间