亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

線程“主”org.springframework.jdbc.CannotGetJdbcConnec

線程“主”org.springframework.jdbc.CannotGetJdbcConnec

小唯快跑啊 2022-06-04 09:46:17
請幫我解決這個錯誤,我是春天的新手。因此,當我嘗試在沒有 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“服務”選項卡>“數據庫”)

檢查網絡/代理/防火墻,你在里面。


查看完整回答
反對 回復 2022-06-04
?
慕慕森

TA貢獻1856條經驗 獲得超17個贊

該錯誤與數據庫連接有關。檢查您現在使用的數據??赡軟]有創建與您連接的名稱相同的數據庫。



查看完整回答
反對 回復 2022-06-04
  • 2 回答
  • 0 關注
  • 104 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號