annotationsatharvard / catcha

Catch-A - Catching Annotation: An annotation backend and API.
http://catcha.readthedocs.io
20 stars 9 forks source link

Class org.springsource.loaded.ri.ReflectiveInterceptor can not access a member of class com.mysql.jdbc.ConnectionPropertiesImpl with modifiers "private" #41

Open jmiranda opened 10 years ago

jmiranda commented 10 years ago

Stacktrace:

$ grails run-app
...
2014-10-07 16:19:12,721 [localhost-startStop-1] DEBUG pool.PooledConnection  - Instantiating driver using class: com.mysql.jdbc.Driver [url=jdbc:mysql://localhost:3306/catch?useUnicode=yes&characterEncoding=UTF-8&autoReconnect=true]
2014-10-07 16:19:12,797 [localhost-startStop-1] DEBUG pool.PooledConnection  - Unable to connect to database.
Message: Unable to initialize driver properties due to java.lang.IllegalAccessException: Class org.springsource.loaded.ri.ReflectiveInterceptor can not access a member of class com.mysql.jdbc.ConnectionPropertiesImpl with modifiers "private"
    Line | Method
->> 1094 | createSQLException         in com.mysql.jdbc.SQLError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    997 | createSQLException         in     ''
|    983 | createSQLException . . . . in     ''
|    928 | createSQLException         in     ''
|   2891 | initializeProperties . . . in com.mysql.jdbc.ConnectionPropertiesImpl
|   3513 | initializeDriverProperties in com.mysql.jdbc.ConnectionImpl
|    823 | <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
|   1146 | runWorker                  in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . . . . . . .  in java.util.concurrent.ThreadPoolExecutor$Worker
^    701 | run                        in java.lang.Thread
2014-10-07 16:19:12,818 [localhost-startStop-1] DEBUG pool.ConnectionPool  - Unable to create a new JDBC connection.
Message: Unable to initialize driver properties due to java.lang.IllegalAccessException: Class org.springsource.loaded.ri.ReflectiveInterceptor can not access a member of class com.mysql.jdbc.ConnectionPropertiesImpl with modifiers "private"
    Line | Method
->> 1094 | createSQLException         in com.mysql.jdbc.SQLError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    997 | createSQLException         in     ''
|    983 | createSQLException . . . . in     ''
|    928 | createSQLException         in     ''
|   2891 | initializeProperties . . . in com.mysql.jdbc.ConnectionPropertiesImpl
|   3513 | initializeDriverProperties in com.mysql.jdbc.ConnectionImpl
|    823 | <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
|   1146 | runWorker                  in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . . . . . . .  in java.util.concurrent.ThreadPoolExecutor$Worker
^    701 | run                        in java.lang.Thread
| Error 2014-10-07 16:19:12,822 [localhost-startStop-1] ERROR pool.ConnectionPool  - Unable to create initial connections of pool.
Message: Unable to initialize driver properties due to java.lang.IllegalAccessException: Class org.springsource.loaded.ri.ReflectiveInterceptor can not access a member of class com.mysql.jdbc.ConnectionPropertiesImpl with modifiers "private"
    Line | Method
->> 1094 | createSQLException         in com.mysql.jdbc.SQLError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    997 | createSQLException         in     ''
|    983 | createSQLException . . . . in     ''
|    928 | createSQLException         in     ''
|   2891 | initializeProperties . . . in com.mysql.jdbc.ConnectionPropertiesImpl
|   3513 | initializeDriverProperties in com.mysql.jdbc.ConnectionImpl
|    823 | <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
|   1146 | runWorker                  in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . . . . . . .  in java.util.concurrent.ThreadPoolExecutor$Worker
^    701 | run                        in java.lang.Thread

Java

$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

Grails

$ gvm current grails
Using grails version 2.2.1
jmiranda commented 10 years ago

See this ticket for more information https://jira.grails.org/browse/GRAILS-10183

jmiranda commented 10 years ago

Either of these workarounds solves the problem:

grails -noreloading run-app

OR

BuildConfig.groovy: grails.project.fork = false
jmiranda commented 10 years ago

Actually, the second solution doesn't work for Grails 2.2.1 because forked execution wasn't introduced until Grails 2.3.x.