1
我試圖在運行的gradle下面的命令,它給了我下面的錯誤JDBC連接:無法獲得數據源
c:\gsoc\mifosx\mifosng-provider>gradle migrateTenantListDB -PdbName=mifosplatfor
m-tenants
Listening for transport dt_socket at address: 8005
:migrateTenantListDB FAILED
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\gsoc\mifosx\mifosng-provider\build.gradle' line: 357
* What went wrong:
Execution failed for task ':flywayMigrate'.
> Unable to obtain Jdbc connection from DataSource
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 13.843 secs
腳本文件是在這裏,行不。的錯誤顯示爲357,但我不知道它爲什麼會顯示錯誤。它說的是關於不正確配置MySQL服務器,請幫我在這裏: 腳本:
task migrateTenantListDB<<{
description="Migrates a Tenant List DB. Optionally can pass dbName. Defaults to 'mifosplatform-tenants' (Example: -PdbName=someDBname)"
def filePath = "filesystem:$projectDir" + System.properties['file.separator'] + '..' + System.properties['file.separator'] + 'mifosng-db' + System.properties['file.separator'] + 'migrations/list_db'
def tenantsDbName = 'mifosplatform-tenants';
if (rootProject.hasProperty("dbName")) {
tenantsDbName = rootProject.getProperty("dbName")
}
flyway.url= "jdbc:mysql://localhost:3306/$tenantsDbName"
flyway.locations= [filePath]
flywayMigrate.execute()
}
我從來沒有使用gradle,但我會建議您使用--stacktrace重新編譯,就像錯誤消息推薦的一樣,以便您可以獲得關於爲什麼事情沒有編譯的提示。我還建議你指出哪一行是留置權357,以幫助人們開始尋找。 – atk 2013-04-20 07:30:10
不要直接調用任務,嘗試將任務類型設置爲飛行遷移和前期配置。您可能忘記將mysql驅動程序放在類路徑中,因此插件無法加載它 – 2013-04-20 08:02:56