-
-
Notifications
You must be signed in to change notification settings - Fork 968
Description
Original Reporter: tim_yates
Environment: Not Specified
Version: 2.3
Migrated From: http://jira.grails.org/browse/GRAILS-10562
If you add {{mysql:mysql-connector-java:5.1.24}} as a runtime dependency, you cannot gain access to {{com.mysql.jdbc.Driver}} from within the Bootstrap
Steps to reproduce:
- Create a new grails project
- Uncomment the line {{runtime 'mysql:mysql-connector-java:5.1.24'}} in {{Build.groovy}}
- Add {{Class.forName( 'com.mysql.jdbc.Driver' )}} to the {{init}} Closure in {{BootStrap.groovy}}
- {{grails run-app}}
It crashes with:
{code}
Error initializing the application: com.mysql.jdbc.Driver
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName(Class.java:190)
at BootStrap$_closure1.doCall(BootStrap.groovy:6)
at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:308)
at grails.util.Environment.executeForEnvironment(Environment.java:301)
at grails.util.Environment.executeForCurrentEnvironment(Environment.java:277)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
{code}