我已经从Grails 2.2.4切换到Grails 2.4.3并且使用我的IntelliJ IDEA 13.1.4 IDE遇到了问题。
创建一个干净的Grails 2.4.3项目并添加一个干净的控制器类后,我通过IntelliJ IDEA中的“run-app”启动项目。之后我在控制器中更改了一些内容,但我得到以下例外情况:
2014-09-29 18:45:41,801 [Thread-11] ERROR plugins.AbstractGrailsPluginManager - Plugin
[controllers:2.4.3] could not reload changes to file [D:\VS\Eclipse Workspace\xx\grails-app\controllers\com\xx\backoffice\MaintenanceController.groovy]: Cannot get property 'cacheOperationSource' on null object
Message: Cannot get property 'cacheOperationSource' on null object
Line | Method
->> 184 | doCall in CacheGrailsPlugin$_closure4
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
.....................Error
|
2014-09-29 18:45:43,276 [FileSystemWatcher: files=#175 cl=groovy.lang.GroovyClassLoader@177f04d9] ERROR agent.Watcher - FileWatcher caught serious error, see cause
Message: loader (instance of org/springsource/loaded/ChildClassLoader): attempted duplicate class definition for name: "com/xx/MaintenanceController$$DOrGoSVQ"
Line | Method
->> 791 | defineClass in java.lang.ClassLoader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 634 | defineClass in ''
^ 722 | run . . . . in java.lang.Thread
我的BuildConfig.groovy:
grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.work.dir = "target/work"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.reload.enabled = true
forkConfig = [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false]
grails.project.fork = [
// configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required
// compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
// configure settings for the test-app JVM, uses the daemon by default
test: forkConfig,
// configure settings for the run-app JVM
run: forkConfig,
// configure settings for the run-war JVM
war: forkConfig,
// configure settings for the Console UI JVM
console: forkConfig
]
grails.project.dependency.resolver = "maven" // or ivy
grails.dependency.cache.dir = "${userHome}/.m2/repository"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// specify dependency exclusions here; for example, uncomment this to disable ehcache:
// excludes 'ehcache'
}
log "info" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
// uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
// runtime 'mysql:mysql-connector-java:5.1.29'
// runtime 'org.postgresql:postgresql:9.3-1101-jdbc41'
test "org.grails:grails-datastore-test-support:1.0-grails-2.4"
runtime 'mysql:mysql-connector-java:5.1.32'
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.55"
// plugins for the compile step
compile ":scaffolding:2.1.2"
compile ':cache:1.1.8'
compile ":asset-pipeline:1.9.6"
compile ":shiro:1.2.1"
compile ":less-asset-pipeline:1.10.0"
compile ":jquery-ui:1.10.4"
// plugins needed at runtime but not for compilation
runtime ":hibernate4:4.3.5.5" // or
//runtime ":hibernate:3.6.10.17"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
// Uncomment these to enable additional asset-pipeline capabilities
//compile ":sass-asset-pipeline:1.9.0"
//compile ":less-asset-pipeline:1.10.0"
//compile ":coffee-asset-pipeline:1.8.0"
//compile ":handlebars-asset-pipeline:1.3.0.3"
}
}
我做了一些研究,发现我必须禁用分叉模式,因为IDEA有问题。因此,我在BuildConfig.groovy中使用 grails.project.fork = false 选项禁用了此功能。
现在我无法通过“run-app”启动应用程序,原因如下:
2014-09-29 18:48:56,144 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool.
Message: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
Line | Method
->> 1094 | createSQLException in com.mysql.jdbc.SQLError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 997 | createSQLException in ''
| 983 | createSQLException in ''
| 928 | createSQLException in ''
| 959 | createSQLException in ''
| 949 | createSQLException in ''
| 432 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Caused by NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 7467 | realClose in com.mysql.jdbc.ResultSetImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 923 | close in ''
| 801 | convertShowWarningsToSQLWarnings in com.mysql.jdbc.SQLError
| 4445 | scanForAndThrowDataTruncation in com.mysql.jdbc.MysqlIO
| 2923 | sqlQueryDirect . . in ''
| 2820 | execSQL in com.mysql.jdbc.ConnectionImpl
| 2769 | execSQL . . . . . in ''
| 1569 | executeQuery in com.mysql.jdbc.StatementImpl
| 4210 | loadServerVariables in com.mysql.jdbc.ConnectionImpl
| 3604 | initializePropsFromServer in ''
| 2542 | connectOneTryOnly in ''
| 2309 | createNewIO in ''
| 834 | <init> . . . . . . in ''
| 46 | <init> in com.mysql.jdbc.JDBC4Connection
| 408 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Error |
2014-09-29 18:48:56,203 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool.
Message: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
Line | Method
->> 1094 | createSQLException in com.mysql.jdbc.SQLError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 997 | createSQLException in ''
| 983 | createSQLException in ''
| 928 | createSQLException in ''
| 959 | createSQLException in ''
| 949 | createSQLException in ''
| 432 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Caused by NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 7467 | realClose in com.mysql.jdbc.ResultSetImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 923 | close in ''
| 801 | convertShowWarningsToSQLWarnings in com.mysql.jdbc.SQLError
| 4445 | scanForAndThrowDataTruncation in com.mysql.jdbc.MysqlIO
| 2923 | sqlQueryDirect . . in ''
| 2820 | execSQL in com.mysql.jdbc.ConnectionImpl
| 2769 | execSQL . . . . . in ''
| 1569 | executeQuery in com.mysql.jdbc.StatementImpl
| 4210 | loadServerVariables in com.mysql.jdbc.ConnectionImpl
| 3604 | initializePropsFromServer in ''
| 2542 | connectOneTryOnly in ''
| 2309 | createNewIO in ''
| 834 | <init> . . . . . . in ''
| 46 | <init> in com.mysql.jdbc.JDBC4Connection
| 408 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Error |
2014-09-29 18:48:56,251 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool.
Message: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
Line | Method
->> 1094 | createSQLException in com.mysql.jdbc.SQLError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 997 | createSQLException in ''
| 983 | createSQLException in ''
| 928 | createSQLException in ''
| 959 | createSQLException in ''
| 949 | createSQLException in ''
| 432 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Caused by NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 7467 | realClose in com.mysql.jdbc.ResultSetImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 923 | close in ''
| 801 | convertShowWarningsToSQLWarnings in com.mysql.jdbc.SQLError
| 4445 | scanForAndThrowDataTruncation in com.mysql.jdbc.MysqlIO
| 2923 | sqlQueryDirect . . in ''
| 2820 | execSQL in com.mysql.jdbc.ConnectionImpl
| 2769 | execSQL . . . . . in ''
| 1569 | executeQuery in com.mysql.jdbc.StatementImpl
| 4210 | loadServerVariables in com.mysql.jdbc.ConnectionImpl
| 3604 | initializePropsFromServer in ''
| 2542 | connectOneTryOnly in ''
| 2309 | createNewIO in ''
| 834 | <init> . . . . . . in ''
| 46 | <init> in com.mysql.jdbc.JDBC4Connection
| 408 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Error |
2014-09-29 18:48:56,269 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
Line | Method
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 1094 | createSQLException in com.mysql.jdbc.SQLError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 997 | createSQLException in ''
| 983 | createSQLException in ''
| 928 | createSQLException in ''
| 959 | createSQLException in ''
| 949 | createSQLException in ''
| 432 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Caused by NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 7467 | realClose in com.mysql.jdbc.ResultSetImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 923 | close in ''
| 801 | convertShowWarningsToSQLWarnings in com.mysql.jdbc.SQLError
| 4445 | scanForAndThrowDataTruncation in com.mysql.jdbc.MysqlIO
| 2923 | sqlQueryDirect in ''
| 2820 | execSQL in com.mysql.jdbc.ConnectionImpl
| 2769 | execSQL . in ''
| 1569 | executeQuery in com.mysql.jdbc.StatementImpl
| 4210 | loadServerVariables in com.mysql.jdbc.ConnectionImpl
| 3604 | initializePropsFromServer in ''
| 2542 | connectOneTryOnly in ''
| 2309 | createNewIO in ''
| 834 | <init> . in ''
| 46 | <init> in com.mysql.jdbc.JDBC4Connection
| 408 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
我的DataSource.groovy:
dataSource {
pooled = true
jmxExport = true
driverClassName = "com.mysql.jdbc.Driver"
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
// cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
singleSession = true // configure OSIV singleSession mode
flush.mode = 'manual' // OSIV session flush mode outside of transactional context
reload = false
}
// environment specific settings
environments {
development {
dataSource {
pooled = true
dbCreate = "update"
url = "jdbc:mysql://localhost:3306/xxx?autoreconnect=true"
driverClassName = "com.mysql.jdbc.Driver"
properties {
// See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation
jmxEnabled = true
initialSize = 5
maxActive = 50
minIdle = 5
maxIdle = 25
maxWait = 10000
maxAge = 10 * 60000
timeBetweenEvictionRunsMillis = 5000
minEvictableIdleTimeMillis = 60000
validationQuery = "SELECT 1"
validationQueryTimeout = 3
validationInterval = 15000
testOnBorrow = true
testWhileIdle = true
testOnReturn = false
jdbcInterceptors = "ConnectionState"
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
}
username = ""
password = ""
}
}
test {
pooled = true
dbCreate = "update"
url = "jdbc:mysql://localhost:3306/xxx?autoreconnect=true"
driverClassName = "com.mysql.jdbc.Driver"
properties {
// See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation
jmxEnabled = true
initialSize = 5
maxActive = 50
minIdle = 5
maxIdle = 25
maxWait = 10000
maxAge = 10 * 60000
timeBetweenEvictionRunsMillis = 5000
minEvictableIdleTimeMillis = 60000
validationQuery = "SELECT 1"
validationQueryTimeout = 3
validationInterval = 15000
testOnBorrow = true
testWhileIdle = true
testOnReturn = false
jdbcInterceptors = "ConnectionState"
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
}
username = ""
password = ""
}
production {
dataSource {
pooled = true
dbCreate = "update"
url = "jdbc:mysql://localhost:3306/xxx?autoreconnect=true"
driverClassName = "com.mysql.jdbc.Driver"
properties {
// See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation
jmxEnabled = true
initialSize = 5
maxActive = 50
minIdle = 5
maxIdle = 25
maxWait = 10000
maxAge = 10 * 60000
timeBetweenEvictionRunsMillis = 5000
minEvictableIdleTimeMillis = 60000
validationQuery = "SELECT 1"
validationQueryTimeout = 3
validationInterval = 15000
testOnBorrow = true
testWhileIdle = true
testOnReturn = false
jdbcInterceptors = "ConnectionState"
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
}
username = ""
password = ""
}
}
}
知道如何解决这些问题吗?