Quartz job exists even after deleting it? - grails

I was testing a helloworld quartz job. I copied an existing job and pasted it in grails-app/jobs folder. I named it TestJob.groovy. I simply made it to fire every minute with a println message. I had made a mistake in the cron expression. I deleted this job and restarted the app and i get the following error message. The strange thing is looks like the file still exists since the error mentions the error was in the file TestJob.groovy but i had already removed this file. I tried cleaning the project and rebuilding it and i still get the error. I appreciate any help in resolving this error and restarting back the app normally. Thanks!
| Loading Grails 2.2.0
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Compiling 1 source files.....
| Running Grails application
ERROR context.ContextLoader: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
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:745)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
... 4 more
Caused by: java.lang.reflect.InvocationTargetException
... 4 more
Caused by: java.lang.IllegalArgumentException: Cron expression '0 * * * * *' in the job class com.runnercard.RemoveUserCodeJob is not a valid cron expression
at grails.plugins.quartz.config.TriggersConfigBuilder$_prepareCronTriggerAttributes_closure5.doCall(TriggersConfigBuilder.groovy:204)
at grails.plugins.quartz.config.TriggersConfigBuilder$_closure1.doCall(TriggersConfigBuilder.groovy:216)
at grails.plugins.quartz.config.TriggersConfigBuilder.prepareCronTriggerAttributes(TriggersConfigBuilder.groovy:198)
at grails.plugins.quartz.config.TriggersConfigBuilder.createTrigger(TriggersConfigBuilder.groovy:78)
at grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:251)
at grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:244)
at com.runnercard.RemoveUserCodeJob$__clinit__closure1.doCall(TestJob.groovy:14)
at grails.plugins.quartz.config.TriggersConfigBuilder.build(TriggersConfigBuilder.groovy:51)
at grails.plugins.quartz.DefaultGrailsJobClass.evaluateTriggers(DefaultGrailsJobClass.java:57)
at grails.plugins.quartz.DefaultGrailsJobClass.<init>(DefaultGrailsJobClass.java:47)
... 4 more
ERROR context.GrailsContextLoader: Error initializing the application: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
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:745)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class grails.plugins.quartz.DefaultGrailsJobClass
... 4 more
Caused by: java.lang.reflect.InvocationTargetException
... 4 more
Caused by: java.lang.IllegalArgumentException: Cron expression '0 * * * * *' in the job class com.runnercard.RemoveUserCodeJob is not a valid cron expression
at grails.plugins.quartz.config.TriggersConfigBuilder$_prepareCronTriggerAttributes_closure5.doCall(TriggersConfigBuilder.groovy:204)
at grails.plugins.quartz.config.TriggersConfigBuilder$_closure1.doCall(TriggersConfigBuilder.groovy:216)
at grails.plugins.quartz.config.TriggersConfigBuilder.prepareCronTriggerAttributes(TriggersConfigBuilder.groovy:198)
at grails.plugins.quartz.config.TriggersConfigBuilder.createTrigger(TriggersConfigBuilder.groovy:78)
at grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:251)
at grails.plugins.quartz.config.TriggersConfigBuilder.createNode(TriggersConfigBuilder.groovy:244)
at com.runnercard.RemoveUserCodeJob$__clinit__closure1.doCall(TestJob.groovy:14)
at grails.plugins.quartz.config.TriggersConfigBuilder.build(TriggersConfigBuilder.groovy:51)
at grails.plugins.quartz.DefaultGrailsJobClass.evaluateTriggers(DefaultGrailsJobClass.java:57)
at grails.plugins.quartz.DefaultGrailsJobClass.<init>(DefaultGrailsJobClass.java:47)
... 4 more

doing a grails clean and clearing .slcache did it. Maybe the cache is the culprit.

Related

ERROR context.GrailsContextLoader - Error initializing Grails: Error creating bean with name 'grailsApplication'

I use grails 2.3.11 version with JDK 1.8_0_131, my project build correctly in my pc and works also when I deploy to my server, but the problem is the same version I checkout to my another pc, it gives the error when I deploy to my server:
[localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing Grails: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: (class: privateserver/BulkExportService$EmptyResults, method: super$1$stream signature: ()Ljava/util/stream/Stream;) Illegal use of nonvirtual function call
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: (class: privateserver/BulkExportService$EmptyResults, method: super$1$stream signature: ()Ljava/util/stream/Stream;) Illegal use of nonvirtual function call
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.VerifyError: (class: privateserver/BulkExportService$EmptyResults, method: super$1$stream signature: ()Ljava/util/stream/Stream;) Illegal use of nonvirtual function call
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getDeclaredConstructors(Class.java:2020)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
at privateserver.BulkExportService.<clinit>(BulkExportService.groovy:198)
at java.lang.Class.forName(Class.java:348)
... 5 more
any idea what this error means?
I use grails 2.3.11 version with JDK 1.8_0_131
Grails 2.5 is the first version of Grails for which we support Java 1.8.

Error creating bean with name 'defaultKieStatelessSession'

The following error I am getting when deploying the application on AWS. This is working fine when the application is deployed on in house tomcat server. The location of path where it is unable to get byte contains file with proper read permisson. I am using grails drools 1.1.1 plugin with tomcat 7 and grails 2.4.4
Any help will be appreciated.
ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'defaultKieStatelessSession': Cannot resolve reference to bean 'defaultKieBase' while setting bean property 'kBase'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultKieBase': Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to get bytes for: /var/lib/tomcat7/webapps/ROOT/WEB-INF/classes/ScaffoldingGrailsPlugin$_closure2.class
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultKieStatelessSession': Cannot resolve reference to bean 'defaultKieBase' while setting bean property 'kBase'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultKieBase': Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to get bytes for: /var/lib/tomcat7/webapps/ROOT/WEB-INF/classes/ScaffoldingGrailsPlugin$_closure2.class
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
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:748)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultKieBase': Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to get bytes for: /var/lib/tomcat7/webapps/ROOT/WEB-INF/classes/ScaffoldingGrailsPlugin$_closure2.class
... 5 more
Instead of using grails drools plugin, used directly drools package through maven, which took care of this issue.

org.springframework.beans.FatalBeanException type mismatch between read and write methods

I have a web application written using Grails 2.2.4. To this point we have been compiling and running it using the IBM 1.6 JDK on AIX because our AIX version did not support 1.7 or higher.
We recently updated our AIX version so we can now support 1.7 and 1.8. We need to do make use of 1.7 at minimum with our Grails 2.2.4 application so that we can use TLS 1.2.
When we try to use the IBM 1.7 JDK we get errors in some of our unit tests like:
java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
at grails.test.mixin.services.ServiceUnitTestMixin.mockService(ServiceUnitTestMixin.groovy:46)
at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
at org.spockframework.runtime.extension.builtin.JUnitFixtureMethodsExtension$FixtureType$FixtureMethodInterceptor.intercept(JUnitFixtureMethodsExtension.java:145)
at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:84)
at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
at org.spockframework.runtime.extension.MethodInvocation.invokeTargetMethod(MethodInvocation.java:91)
at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:85)
at com.atlassian.clover.recorder.spock.CloverSpockIterationInterceptor.intercept(CloverSpockIterationInterceptor.java:36)
at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:84)
at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
Caused by: java.lang.reflect.InvocationTargetException
... 11 more
Caused by: org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [com.cfglife.agent.AgentContextService]; nested exception is java.beans.IntrospectionException: type mismatch between read and write methods
... 11 more
Caused by: java.beans.IntrospectionException: type mismatch between read and write methods
... 11 more
It happens in 37 of 1272 tests and only when tested under the IBM 1.7 SDK. When run using Oracle or OpenJDK the tests run with no failures.
Does anyone know how to get around this?
On deployment and startup (using Tomcat ) it shows up a little differently.
2017-05-04 11:24:52.782 | ERROR | org.springframework.web.context.ContextLoader | localhost-startStop-1 | Context initialization failed |
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:483)
at java.util.concurrent.FutureTask.run(FutureTask.java:274)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
at java.lang.Thread.run(Thread.java:809)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
... 5 more
Caused by: org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [com.cfglife.agent.AgentContextService]; nested exception is java.beans.IntrospectionException: type mismatch between read and write methods
... 5 more
Caused by: java.beans.IntrospectionException: type mismatch between read and write methods
... 5 more
2017-05-04 11:24:52.790 | ERROR | org.codehaus.groovy.grails.web.context.GrailsContextLoader | localhost-startStop-1 | Error initializing the application: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass |
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:483)
at java.util.concurrent.FutureTask.run(FutureTask.java:274)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
at java.lang.Thread.run(Thread.java:809)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
... 5 more
Caused by: org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [com.cfglife.agent.AgentContextService]; nested exception is java.beans.IntrospectionException: type mismatch between read and write methods
... 5 more
Caused by: java.beans.IntrospectionException: type mismatch between read and write methods
... 5 more
2017-05-04 11:24:52.795 | ERROR | org.codehaus.groovy.grails.web.context.GrailsContextLoader | localhost-startStop-1 | Error initializing Grails: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass |
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:483)
at java.util.concurrent.FutureTask.run(FutureTask.java:274)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
at java.lang.Thread.run(Thread.java:809)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
... 5 more
Caused by: org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [com.cfglife.agent.AgentContextService]; nested exception is java.beans.IntrospectionException: type mismatch between read and write methods
... 5 more
Caused by: java.beans.IntrospectionException: type mismatch between read and write methods
... 5 more

Searchable grails plugin ClassNotFoundException: org.apache.lucene.analysis.Analyzer$TokenStreamComponents

i'm using the searchable 0.6.9 plugin with grails 2.4.4 and on my development machine (Windows/IntelliJ IDEA) everything works fine. Deploying it on my Tomcat on linux, however, gives me the following error:
...
2014-12-01 10:20:46,066 [localhost-startStop-1] ERROR StackTrace - Full Stack Trace:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grails.plugin.searchable.SearchableController': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchableService': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compass': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/apache/lucene/analysis/Analyzer$TokenStreamComponents
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
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:744)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchableService': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compass': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/apache/lucene/analysis/Analyzer$TokenStreamComponents
... 5 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compass': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/apache/lucene/analysis/Analyzer$TokenStreamComponents
... 5 more
Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/Analyzer$TokenStreamComponents
at org.compass.core.lucene.engine.analyzer.CoreAnalyzerBuilderDelegate.buildAnalyzer(CoreAnalyzerBuilderDelegate.java:47)
at org.compass.core.lucene.engine.analyzer.DefaultLuceneAnalyzerFactory.createAnalyzer(DefaultLuceneAnalyzerFactory.java:81)
at org.compass.core.lucene.engine.analyzer.LuceneAnalyzerManager.buildAnalyzer(LuceneAnalyzerManager.java:225)
at org.compass.core.lucene.engine.analyzer.LuceneAnalyzerManager.buildAnalyzers(LuceneAnalyzerManager.java:133)
at org.compass.core.lucene.engine.analyzer.LuceneAnalyzerManager.<init>(LuceneAnalyzerManager.java:67)
at org.compass.core.lucene.engine.LuceneSearchEngineFactory.<init>(LuceneSearchEngineFactory.java:119)
at org.compass.core.impl.DefaultCompass.<init>(DefaultCompass.java:124)
at org.compass.core.impl.DefaultCompass.<init>(DefaultCompass.java:117)
at org.compass.core.config.CompassConfiguration.buildCompass(CompassConfiguration.java:288)
at grails.plugin.searchable.internal.compass.spring.SearchableCompassFactoryBean.buildCompass(SearchableCompassFactoryBean.java:95)
at grails.plugin.searchable.internal.compass.spring.SearchableCompassFactoryBean.getObject(SearchableCompassFactoryBean.java:58)
at grails.plugin.searchable.internal.compass.spring.SearchableCompassFactoryBean.getObject(SearchableCompassFactoryBean.java:41)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.Analyzer$TokenStreamComponents
... 17 more
It seems as if the org.apache.lucene.analysis.Analyzer class does not contain TokenStreamComponents in lucene 2.4.1 (which is a dependency of searchable 0.6.9). But as I wrote, it works fine on my development machine.
PS: On Linux the war file is built by hudson.
UPDATE:
On my dev machine it does not run as war either but run-app does. I have no clue why it tries to use a method that is not present when running as a war file.
Thanks for your help in advance.
SOLVED:
Unfortunately the solution was simple: I had the Jasper plugin installed as well and it loads lucene 4.5.1 as dependency.
By excluding it with
compile (":jasper:1.10.0") {
excludes 'org.apache.lucene:lucene-core:4.5.1'
excludes 'org.apache.lucene:lucene-analyzers-common:4.5.1'
excludes 'org.apache.lucene:lucene-queryparser:4.5.1'
}
everything works as expected.

grails run-app randomly throws: java.lang.NoClassDefFoundError: Lorg/codehaus/groovy/grails/plugins/web/async/api/ControllersAsyncApi

When starting my grails 2.2.0 app, I am randomly getting the error message as below, but it also randomly succeeds starting the up without an error.
No changes to the code, I just try to run the grails dev run-app multiple times.
$ grails dev run-app
I also tried a grails clean before, but that makes no difference; the error still randomly occurs.
Errors on startup:
| Packaging Grails application.....
webxml.WebxmlGrailsPlugin Loading default config file: class DefaultWebXmlConfig
webxml.WebxmlGrailsPlugin Did not find application config file: WebXmlConfig
webxml.WebxmlGrailsPlugin Loading default config file: class DefaultWebXmlConfig
| Running Grails application
context.GrailsContextLoader [GrailsContextLoader] Loading context. Creating parent application context
context.ContextLoader Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
... 5 more
Caused by: java.lang.NoClassDefFoundError: Lorg/codehaus/groovy/grails/plugins/web/async/api/ControllersAsyncApi;
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredFields(Class.java:1743)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.grails.plugins.web.async.api.ControllersAsyncApi
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 7 more
context.GrailsContextLoader Error initializing the application: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsControllerClass
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
... 5 more
Caused by: java.lang.NoClassDefFoundError: Lorg/codehaus/groovy/grails/plugins/web/async/api/ControllersAsyncApi;
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredFields(Class.java:1743)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.grails.plugins.web.async.api.ControllersAsyncApi
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 7 more
Environment:
Mac OS X Lion
JDK 1.6.0_31
Similar post, but still different, as I'm not running Tomcat:
Grails application running on Tomcat6 - Context initialization failed
After changing servlets version from 3.0 to 2.5 (and vice versa) and this exception appeared.
I have resolved this problem by typing:
grails clean
grails clean-all
The dependencies has been fetched again and application began running.
Try to mark your servlet version as v3.0. I had the same sporadic issue and solved it by moving to v.3.0
File: BuildConfig.groovy
grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0)
After that grails-plugin-async-2.2.0.jar appeared on classpath:
%HOME%.grails\ivy-cache\org.grails\grails-plugin-async\jars\
Try to remove target manually in case the clean do not work.

Resources