请帮我解决这个错误,我是春天的新手。因此,当我尝试在没有 Spring MVC Web 结构的情况下运行测试数据源时,我无法理解此错误cd F:\NetBeansProjects\SpringContactApp; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_131" cmd /c "\"\"C:\\Program Files\\NetBeans 8.0.1\\java\\maven\\bin\\mvn.bat\" -Dexec.args=\"-classpath %classpath in.ezeon.capp.test.TestDataSource\" -Dexec.executable=java -Dexec.classpathScope=test -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.0.1\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\"" Running NetBeans Compile On Save execution. Phase execution is skipped and output directories of dependency projects (with Compile on Save turned on) will be used instead of their jar artifacts. Scanning for projects... ------------------------------------------------------------------------ Building SpringContactApp 1.0-SNAPSHOT ------------------------------------------------------------------------ --- exec-maven-plugin:1.2.1:exec (default-cli) @ SpringContactApp --- Feb 04, 2019 12:15:40 PM org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@531d72ca: startup date [Mon Feb 04 12:15:40 IST 2019]; root of context hierarchy Feb 04, 2019 12:15:40 PM org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor <init> INFO: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring下面的代码是 SpringRootConfig.java 类和 TestDataSource.java 类我使用的是 netbeans 8 和 spring 框架。
2 回答
呼唤远方
TA贡献1856条经验 获得超11个赞
在你的情况下:
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
Could not create connection to database server. Attempted reconnect 3 times. Giving up.
检查您的 jdbc 网址。
检查您的数据库的可用性(在该 url 上,服务器正在运行?端口?数据库?理想情况下,相同的驱动程序,相同的网络 ..eg 使用 Netbeans“服务”选项卡>“数据库”)
检查网络/代理/防火墙,你在里面。
添加回答
举报
0/150
提交
取消