0
我想要一個獨立包,包括Tomcat和我的Grails 2.5應用程序與h2 DB文件。 Config.groovy中我設置加載屬性文件使用h2文件DB部署Grails應用程序時出錯
grails.config.locations = ["classpath:mytool-config.properties"]
在mytool-config.properties我:
dataSource.username = "sa"
dataSource.password = "db!admin"
dataSource.url = "jdbc:h2:file:E:\\MyTool\\db\\MyTool;MVCC=TRUE;LOCK_TIMEOUT=10000"
文件夾E:\ MyTool \分貝當然存在。還嘗試放置已創建的MyTool.h2.db文件。
我DataSources.groovy樣子:
dataSource {
jmxExport = true
driverClassName = "org.h2.Driver"
pooled = true
}
hibernate {
cache.use_second_level_cache = true
cache.region.factory_class = 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory' // Hibernate 4
singleSession = true // configure OSIV singleSession mode
flush.mode = 'manual' // OSIV session flush mode outside of transactional context
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "update"
logSql = false
}
hibernate.cache.use_query_cache = false
}
production {
dataSource {
dbCreate = "update"
logSql = false
}
hibernate.cache.use_query_cache = true
}
}
但啓動tomcat服務的應用程序不tomcat7-stdout.2016-02-09.log工作,我得到:
2016-02-09 11:59:35,797 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool.
java.sql.SQLException: Driver:[email protected] returned null for URL:"jdbc:h2:file:E:\MyTool\db\MyTool;MVCC=TRUE;LOCK_TIMEOUT=10000"
它使用run-app在我的開發機器中正常工作。任何想法有什麼不對?