Grails Version: 3.0.9
Groovy Version: 2.4.5
JVM Version: 1.8.0_60
I'm following the simple instructions to install the Grails Asynchronous Mail plugin but I'm getting the following error message on start up.
http://grails.org/plugins.html#plugin/asynchronous-mail
Can't seem to find a solution to this no matter how much I google and trawl the web.
I'd be very grateful for any insight.
ERROR grails.boot.GrailsApp - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplicationPostProcessor' defined in mchq.admin.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is grails.plugins.exceptions.PluginException: Failed to initialize class [grails.plugin.asyncmail.AsynchronousMailAttachment] from plugin [asynchronousMail] : grails/gorm/Entity
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1119) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1014) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:116) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686) ~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) ~[spring-boot-1.2.5.RELEASE.jar:1.2.5.RELEASE]
at grails.boot.GrailsApp.run(GrailsApp.groovy:52) [grails-core-3.0.7.jar:3.0.7]
at grails.boot.GrailsApp.run(GrailsApp.groovy:330) [grails-core-3.0.7.jar:3.0.7]
at grails.boot.GrailsApp.run(GrailsApp.groovy:319) [grails-core-3.0.7.jar:3.0.7]
at grails.boot.GrailsApp$run.call(Unknown Source) [grails-core-3.0.7.jar:3.0.7]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) [groovy-2.4.4.jar:2.4.4]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) [groovy-2.4.4.jar:2.4.4]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133) [groovy-2.4.4.jar:2.4.4]
at mchq.admin.Application.main(Application.groovy:8) [main/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is grails.plugins.exceptions.PluginException: Failed to initialize class [grails.plugin.asyncmail.AsynchronousMailAttachment] from plugin [asynchronousMail] : grails/gorm/Entity
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
... 22 common frames omitted
Caused by: grails.plugins.exceptions.PluginException: Failed to initialize class [grails.plugin.asyncmail.AsynchronousMailAttachment] from plugin [asynchronousMail] : grails/gorm/Entity
at org.grails.plugins.BinaryGrailsPlugin.initializeProvidedArtefacts(BinaryGrailsPlugin.java:133) ~[grails-core-3.0.7.jar:3.0.7]
at org.grails.plugins.BinaryGrailsPlugin.<init>(BinaryGrailsPlugin.java:66) ~[grails-core-3.0.7.jar:3.0.7]
at grails.plugins.DefaultGrailsPluginManager.createBinaryGrailsPlugin(DefaultGrailsPluginManager.java:390) ~[grails-core-3.0.7.jar:3.0.7]
at grails.plugins.DefaultGrailsPluginManager.findCorePlugins(DefaultGrailsPluginManager.java:377) ~[grails-core-3.0.7.jar:3.0.7]
at grails.plugins.DefaultGrailsPluginManager.attemptLoadPlugins(DefaultGrailsPluginManager.java:329) ~[grails-core-3.0.7.jar:3.0.7]
at grails.plugins.DefaultGrailsPluginManager.loadPlugins(DefaultGrailsPluginManager.java:239) ~[grails-core-3.0.7.jar:3.0.7]
at grails.boot.config.GrailsApplicationPostProcessor.initializeGrailsApplication(GrailsApplicationPostProcessor.groovy:87) ~[grails-core-3.0.7.jar:3.0.7]
at grails.boot.config.GrailsApplicationPostProcessor.<init>(GrailsApplicationPostProcessor.groovy:78) ~[grails-core-3.0.7.jar:3.0.7]
at grails.boot.config.GrailsAutoConfiguration.grailsApplicationPostProcessor(GrailsAutoConfiguration.groovy:59) ~[grails-core-3.0.7.jar:3.0.7]
at mchq.admin.Application.grailsApplicationPostProcessor(Application.groovy) [main/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426) ~[springloaded-1.2.4.RELEASE.jar:1.2.4.RELEASE]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE]
... 23 common frames omitted
Caused by: java.lang.NoClassDefFoundError: grails/gorm/Entity
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_60]
at java.lang.ClassLoader.defineClass(ClassLoader.java:760) ~[na:1.8.0_60]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_60]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_60]
at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_60]
at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_60]
at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_60]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_60]
at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_60]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_60]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_60]
at java.lang.ClassLoader.loadClass(ClassLoader.java:411) ~[na:1.8.0_60]
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:677) ~[groovy-2.4.4.jar:2.4.4]
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:787) ~[groovy-2.4.4.jar:2.4.4]
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:775) ~[groovy-2.4.4.jar:2.4.4]
at org.grails.plugins.BinaryGrailsPlugin.initializeProvidedArtefacts(BinaryGrailsPlugin.java:131) ~[grails-core-3.0.7.jar:3.0.7]
... 38 common frames omitted
Caused by: java.lang.ClassNotFoundException: grails.gorm.Entity
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_60]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_60]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_60]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_60]
... 54 common frames omitted
FAILURE: Build failed with an exception.
Here is a full list of dependencies :
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-autoconfigure"
provided "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:scaffolding"
compile 'org.grails.plugins:spring-security-core:3.0.0.M1'
compile "org.grails.plugins:mail:2.0.0.RC2"
compile 'org.grails.plugins:asynchronous-mail:2.0.0.RC2'
compile "org.grails.plugins:grails-cloudinary:0.3"
compile 'org.joda:joda-money:0.10.0'
compile "org.grails.plugins:taggable:2.0.0-SNAPSHOT"
compile 'org.grails.plugins:geocode:0.3'
runtime 'mysql:mysql-connector-java:5.1.37'
runtime "org.grails.plugins:asset-pipeline"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
runtime 'com.bertramlabs.plugins:less-asset-pipeline:2.6.7'
testRuntime 'org.seleniumhq.selenium:selenium-htmlunit-driver:2.44.0'
console "org.grails:grails-console"
}
There isn't a hibernate plugin for Grails 3.x.x. You have to use hibernate3, hibernate4 or hibernate5. I've just tested with hibernate4. Also in my applications there is grails-core dependency.
compile "org.grails.plugins:hibernate4"
instead of
compile "org.grails.plugins:hibernate"
Related
I am running Grails 3.3.8 and spring-security-core:3.2.3 and unable to run/startup my application. I only have on additional bean defined in the resources.groovy and not much custom within the application.
Here is the stacktrace that I am getting, what could be causing this?
Caused by: grails.plugins.exceptions.PluginException: Failed to initialize class [grails.plugin.springsecurity.LoginController] from plugin [springSecurityCore] : org/grails/compiler/web/converters/RenderConverterTrait
at org.grails.plugins.BinaryGrailsPlugin.initializeProvidedArtefacts(BinaryGrailsPlugin.java:175)
at org.grails.plugins.BinaryGrailsPlugin.<init>(BinaryGrailsPlugin.java:104)
at grails.plugins.DefaultGrailsPluginManager.createBinaryGrailsPlugin(DefaultGrailsPluginManager.java:375)
at grails.plugins.DefaultGrailsPluginManager.findCorePlugins(DefaultGrailsPluginManager.java:362)
at grails.plugins.DefaultGrailsPluginManager.attemptLoadPlugins(DefaultGrailsPluginManager.java:314)
at grails.plugins.DefaultGrailsPluginManager.loadPlugins(DefaultGrailsPluginManager.java:224)
at grails.boot.config.GrailsApplicationPostProcessor.initializeGrailsApplication(GrailsApplicationPostProcessor.groovy:89)
at grails.boot.config.GrailsApplicationPostProcessor.setApplicationContext(GrailsApplicationPostProcessor.groovy:225)
at grails.boot.config.GrailsApplicationPostProcessor.<init>(GrailsApplicationPostProcessor.groovy:77)
at grails.boot.config.GrailsAutoConfiguration.grailsApplicationPostProcessor(GrailsAutoConfiguration.groovy:68)
at greenfield.Application.grailsApplicationPostProcessor(Application.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 24 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/grails/compiler/web/converters/RenderConverterTrait
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:677)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:787)
at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:775)
at org.grails.plugins.BinaryGrailsPlugin.initializeProvidedArtefacts(BinaryGrailsPlugin.java:173)
... 40 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.grails.compiler.web.converters.RenderConverterTrait
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 56 common frames omitted
I am using grails application. Recently we are trying to update java version from 1.6 to 1.7. If I run the application with java 1.6 application working. when I have changed the java version to java 1.7.0_60 then I getting below error message:
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.DefaultGrailsServiceClass
at java.security.AccessController.doPrivileged(Native Method)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy:145)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:274)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:137)
at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:104)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:58)
at RunApp$_run_closure1.doCall(RunApp:33)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
... 23 more
Caused by: java.lang.reflect.InvocationTargetException
... 23 more
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [com.basf.bdw.services.CustomerService]!
... 23 more
Caused by: java.lang.TypeNotPresentException: Type CustomerEnrollment not present
at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:387)
at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:114)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:72)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:56)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1149)
at java.beans.Introspector.getBeanInfo(Introspector.java:416)
at java.beans.Introspector.getBeanInfo(Introspector.java:163)
at java.security.AccessController.doPrivileged(Native Method)
at com.basf.bdw.services.CustomerService.$getStaticMetaClass(CustomerService.groovy)
at com.basf.bdw.services.BaseService.<init>(BaseService.groovy)
at com.basf.bdw.services.CustomerService.<init>(CustomerService.groovy)
... 23 more
Caused by: java.lang.ClassNotFoundException: CustomerEnrollment
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
... 34 more
mortbay.log Failed startup of context org.mortbay.jetty.webapp.WebAppContext#6a8c67f9{/BASF_bdw,C:\Workspace_1\BDW_FE_Old/web-app}
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.security.AccessController.doPrivileged(Native Method)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy:145)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:274)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:137)
at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:104)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:58)
at RunApp$_run_closure1.doCall(RunApp:33)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
... 23 more
Caused by: java.lang.reflect.InvocationTargetException
... 23 more
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [com.basf.bdw.services.CustomerService]!
... 23 more
Caused by: java.lang.TypeNotPresentException: Type CustomerEnrollment not present
at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:387)
at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:114)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:72)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:56)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1149)
at java.beans.Introspector.getBeanInfo(Introspector.java:416)
at java.beans.Introspector.getBeanInfo(Introspector.java:163)
at java.security.AccessController.doPrivileged(Native Method)
at com.basf.bdw.services.CustomerService.$getStaticMetaClass(CustomerService.groovy)
at com.basf.bdw.services.BaseService.<init>(BaseService.groovy)
at com.basf.bdw.services.CustomerService.<init>(CustomerService.groovy)
... 23 more
Caused by: java.lang.ClassNotFoundException: CustomerEnrollment
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
... 34 more
mortbay.log Nested in 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:
java.lang.ClassNotFoundException: CustomerEnrollment
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:387)
at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:114)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:72)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:56)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1149)
at java.beans.Introspector.getBeanInfo(Introspector.java:416)
at java.beans.Introspector.getBeanInfo(Introspector.java:163)
at java.security.AccessController.doPrivileged(Native Method)
at com.basf.bdw.services.CustomerService.$getStaticMetaClass(CustomerService.groovy)
at com.basf.bdw.services.BaseService.<init>(BaseService.groovy)
at com.basf.bdw.services.CustomerService.<init>(CustomerService.groovy)
at java.security.AccessController.doPrivileged(Native Method)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy:145)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:274)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:137)
at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:104)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:58)
at RunApp$_run_closure1.doCall(RunApp:33)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)
My application environment details:
Grails 1.1.1
Groovy 1.5.6
Java 1.6.0_17(Old)
Java 1.7.0_60(New)
web sphere 8.5.5
Oracle 12C
Below are the jars which I am using in my application:
Jar files in my application
I'm trying to create an Spring Boot application that uses as user management the Stormpath API.
Here is the Gradle dependency block:
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-data-jpa:' + springBootVersion
compile group: 'org.springframework.boot', name: 'spring-boot-devtools', version: springBootVersion
compile group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: springBootVersion
compile group: 'com.stormpath.spring', name: 'stormpath-default-spring-boot-starter', version: stormpathVersion
compile 'org.projectlombok:lombok:1.16.10'
compile 'org.springframework.boot:spring-boot-starter-thymeleaf:' + springBootVersion
compile 'org.yaml:snakeyaml'
compile 'org.hsqldb:hsqldb:2.0.0'
compile 'com.stormpath.sdk:stormpath-sdk-api:1.1.1'
compile group: 'com.stormpath.sdk', name: 'stormpath-sdk-httpclient', version: '1.1.1'
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'junit:junit'
}
And here is the configuration for Stormpath with Spring security enabled:
#Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
#Override
protected void configure(HttpSecurity http) throws Exception {
http
.apply(stormpath())
.and()
.authorizeRequests()
.antMatchers("/", "/public").permitAll();
}
}
At this state, using stormpath.client.cacheManager.enabled: false, it gives me:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.stormpath.sdk.servlet.filter.FilterChainManager]: Factory method 'stormpathFilterChainManager' threw exception; nested exception is java.lang.NoClassDefFoundError: com/stormpath/sdk/schema/Schema
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 71 common frames omitted
Caused by: java.lang.NoClassDefFoundError: com/stormpath/sdk/schema/Schema
at com.stormpath.sdk.impl.directory.DefaultDirectory.<clinit>(DefaultDirectory.java:71) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_111]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_111]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_111]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_111]
at com.stormpath.sdk.lang.Classes.instantiate(Classes.java:188) ~[stormpath-sdk-api-1.1.1.jar:1.1.1]
at com.stormpath.sdk.impl.ds.DefaultResourceFactory.instantiate(DefaultResourceFactory.java:65) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.SubtypeDispatchingResourceFactory.instantiate(SubtypeDispatchingResourceFactory.java:80) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.DefaultDataStore.instantiate(DefaultDataStore.java:216) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.DefaultDataStore.getResource(DefaultDataStore.java:249) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.DefaultDataStore.getResource(DefaultDataStore.java:236) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.application.AbstractAccountStoreMapping.getAccountStore(AbstractAccountStoreMapping.java:55) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.application.DefaultApplication.getDefaultAccountStore(DefaultApplication.java:475) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.servlet.config.RegisterEnabledPredicate.test(RegisterEnabledPredicate.java:23) ~[stormpath-sdk-servlet-1.1.4.jar:1.1.4]
at com.stormpath.sdk.servlet.config.RegisterEnabledPredicate.test(RegisterEnabledPredicate.java:11) ~[stormpath-sdk-servlet-1.1.4.jar:1.1.4]
at com.stormpath.spring.config.AbstractStormpathWebMvcConfiguration.addRoutes(AbstractStormpathWebMvcConfiguration.java:464) ~[stormpath-spring-webmvc-1.1.4.jar:1.1.4]
at com.stormpath.spring.config.AbstractStormpathWebMvcConfiguration.stormpathFilterChainManager(AbstractStormpathWebMvcConfiguration.java:1357) ~[stormpath-spring-webmvc-1.1.4.jar:1.1.4]
at com.stormpath.spring.boot.autoconfigure.StormpathWebMvcAutoConfiguration.stormpathFilterChainManager(StormpathWebMvcAutoConfiguration.java:564) ~[stormpath-webmvc-spring-boot-starter-1.1.4.jar:1.1.4]
at com.stormpath.spring.boot.autoconfigure.StormpathWebMvcAutoConfiguration$$EnhancerBySpringCGLIB$$f4e52d73.CGLIB$stormpathFilterChainManager$71(<generated>) ~[stormpath-webmvc-spring-boot-starter-1.1.4.jar:1.1.4]
at com.stormpath.spring.boot.autoconfigure.StormpathWebMvcAutoConfiguration$$EnhancerBySpringCGLIB$$f4e52d73$$FastClassBySpringCGLIB$$de2b4e13.invoke(<generated>) ~[stormpath-webmvc-spring-boot-starter-1.1.4.jar:1.1.4]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356) ~[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at com.stormpath.spring.boot.autoconfigure.StormpathWebMvcAutoConfiguration$$EnhancerBySpringCGLIB$$f4e52d73.stormpathFilterChainManager(<generated>) ~[stormpath-webmvc-spring-boot-starter-1.1.4.jar:1.1.4]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 72 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.stormpath.sdk.schema.Schema
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_111]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_111]
If I set the cacheManager.enabled: true the error changes to:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.stormpath.sdk.application.Application]: Factory method 'stormpathApplication' threw exception; nested exception is java.lang.NoClassDefFoundError: com/stormpath/sdk/account/EmailVerificationStatus
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 48 common frames omitted
Caused by: java.lang.NoClassDefFoundError: com/stormpath/sdk/account/EmailVerificationStatus
at com.stormpath.sdk.impl.account.DefaultAccount.<clinit>(DefaultAccount.java:68) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.cache.WriteCacheFilter.cache(WriteCacheFilter.java:282) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.cache.WriteCacheFilter.filter(WriteCacheFilter.java:69) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.DefaultFilterChain.filter(DefaultFilterChain.java:52) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.cache.ReadCacheFilter.filter(ReadCacheFilter.java:66) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.DefaultFilterChain.filter(DefaultFilterChain.java:52) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.api.DecryptApiKeySecretFilter.filter(DecryptApiKeySecretFilter.java:63) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.DefaultFilterChain.filter(DefaultFilterChain.java:52) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.EnlistmentFilter.filter(EnlistmentFilter.java:42) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.DefaultFilterChain.filter(DefaultFilterChain.java:52) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.DefaultDataStore.getResourceData(DefaultDataStore.java:333) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.DefaultDataStore.getResource(DefaultDataStore.java:248) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.ds.DefaultDataStore.getResource(DefaultDataStore.java:236) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.client.DefaultClient.getCurrentTenant(DefaultClient.java:111) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.sdk.impl.client.DefaultClient.getApplications(DefaultClient.java:228) ~[stormpath-sdk-impl-1.1.4.jar:1.1.4]
at com.stormpath.spring.config.AbstractStormpathConfiguration.stormpathApplication(AbstractStormpathConfiguration.java:134) ~[stormpath-spring-1.1.4.jar:1.1.4]
at com.stormpath.spring.boot.autoconfigure.StormpathAutoConfiguration.stormpathApplication(StormpathAutoConfiguration.java:44) ~[stormpath-spring-boot-starter-1.1.4.jar:1.1.4]
at com.stormpath.spring.boot.autoconfigure.StormpathAutoConfiguration$$EnhancerBySpringCGLIB$$2b9aeaeb.CGLIB$stormpathApplication$0(<generated>) ~[stormpath-spring-boot-starter-1.1.4.jar:1.1.4]
at com.stormpath.spring.boot.autoconfigure.StormpathAutoConfiguration$$EnhancerBySpringCGLIB$$2b9aeaeb$$FastClassBySpringCGLIB$$50955372.invoke(<generated>) ~[stormpath-spring-boot-starter-1.1.4.jar:1.1.4]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356) ~[spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at com.stormpath.spring.boot.autoconfigure.StormpathAutoConfiguration$$EnhancerBySpringCGLIB$$2b9aeaeb.stormpathApplication(<generated>) ~[stormpath-spring-boot-starter-1.1.4.jar:1.1.4]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 49 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.stormpath.sdk.account.EmailVerificationStatus
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_111]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_111]
I'm following the tutorial from their official page: official page
UPDATE: The below problem with unknown host is unrelated to this question
">>Also, at random startings, it gives me that api.stormpath.com is an unknown host. But this I think is a separate issue.<<"
Any suggestion is welcomed. Thanks!
You are using stormpath-sdk-api:1.1.1 and stormpath-sdk-impl:1.1.4
stormpath-sdk-api:1.1.1 and stormpath-sdk-api:1.1.2 do not include the missing classes.
You can find the missing classes in 1.1.4. EmailVerificationStatus and Schema
Use version 1.1.4 for both instead.
Per the tutorial, use the latest stable stormpath-default-spring-boot-starter, which is version 1.1.4 at the time of this writing. Also, you do not need to include the following dependencies:
compile 'com.stormpath.sdk:stormpath-sdk-api'
compile group: 'com.stormpath.sdk', name: 'stormpath-sdk-httpclient'
These two are automatically included when you reference the stormpath-default-spring-boot-starter.
I am getting this unexpected exception while running application on grails. I have done clean, compile and run-app many times but nothing happens. It cleans and compiled successfully but when I do run-app this exception occurs:
java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira
at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:110)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.addIfMatching(ResolverUtil.java:390)
at org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.loadImplementationsInDirectory(ResolverUtil.java:292)
at org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.loadImplementationsInDirectory(ResolverUtil.java:290)
at org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.loadImplementationsInDirectory(ResolverUtil.java:290)
at org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.findInPackage(ResolverUtil.java:204)
at org.apache.logging.log4j.core.config.plugins.util.PluginRegistry.loadFromPackage(PluginRegistry.java:222)
at org.apache.logging.log4j.core.config.plugins.util.PluginManager.collectPlugins(PluginManager.java:152)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:144)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:361)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:426)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:442)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:138)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:147)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:41)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:175)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:426)
at com.asklytics.provisioning.TenantProvisioningManagerService.<clinit>(TenantProvisioningManagerService.java:35)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrConstructorNewInstance(ReflectiveInterceptor.java:1075)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
at org.grails.spring.beans.factory.OptimizedAutowireCapableBeanFactory$1.instantiate(OptimizedAutowireCapableBeanFactory.java:89)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1098)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:1244)
at org.grails.spring.beans.factory.OptimizedAutowireCapableBeanFactory.autowireByName(OptimizedAutowireCapableBeanFactory.java:160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1194)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:1244)
at org.grails.spring.beans.factory.OptimizedAutowireCapableBeanFactory.autowireByName(OptimizedAutowireCapableBeanFactory.java:160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1194)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at grails.boot.GrailsApp.run(GrailsApp.groovy:51)
at grails.boot.GrailsApp.run(GrailsApp.groovy:335)
at grails.boot.GrailsApp.run(GrailsApp.groovy:324)
at grails.boot.GrailsApp$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at analyticsapplication.Application.main(Application.groovy:8)
Caused by: org.springsource.loaded.ReloadException: Problem defining class com..analytic.services.ELBService$_stub_closure1__I
at org.springsource.loaded.TypeRegistry.defineClass(TypeRegistry.java:1306)
at org.springsource.loaded.ReloadableType.rewriteCallSitesAndDefine(ReloadableType.java:939)
at org.springsource.loaded.ReloadableType.<init>(ReloadableType.java:173)
at org.springsource.loaded.TypeRegistry.addType(TypeRegistry.java:1104)
at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:335)
at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:107)
... 79 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springsource.loaded.TypeRegistry.defineClass(TypeRegistry.java:1298)
... 84 more
Caused by: java.lang.NoClassDefFoundError: com//analytic/services/ELBService$_stub_closure1__I (wrong name: com/analytic/services/ELBService$_stub_closure1__I)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
... 88 more
I am not sure why the name of class is ending with $_stub_clouser1__I? Any one please help me out.
Hmm, looks like you might have a bad package declaration in your file:
check the "package" line in the file ELBService.groovy
it might have an extra period in there: com..analytic.services
Problem probably is connected with TenantProvisioningManagerService.java line 35. Please check it out.
Moreover did you try to update Grails for example to 3.0.16? Did you check also package naming in tests files with injected service?
I'm using AvroCoder.class to serialize my data structure. My code looks like:
#DefaultCoder(AvroCoder.class)
public class LogEntry {
public String sessionId;
public String status;
// time of the log entry.
public long timeStamp;
public LogEntry() {
}
}
When I try to run my pipeline I get the exception below:
java.lang.RuntimeException: Failed to construct instance from factory method com.google.cloud.dataflow.sdk.coders.AvroCoder#of
at com.google.cloud.dataflow.sdk.util.InstanceBuilder.buildFromMethod(InstanceBuilder.java:226)
at com.google.cloud.dataflow.sdk.util.InstanceBuilder.build(InstanceBuilder.java:159)
at com.google.cloud.dataflow.sdk.coders.CoderRegistry.getDefaultCoder(CoderRegistry.java:605)
at com.google.cloud.dataflow.sdk.coders.CoderRegistry.getDefaultCoder(CoderRegistry.java:575)
at com.google.cloud.dataflow.sdk.coders.CoderRegistry.getDefaultCoder(CoderRegistry.java:556)
at com.google.cloud.dataflow.sdk.coders.CoderRegistry.getDefaultCoder(CoderRegistry.java:230)
at com.google.cloud.dataflow.sdk.transforms.Create.getElementCoder(Create.java:286)
at com.google.cloud.dataflow.sdk.transforms.Create.getDefaultOutputCoder(Create.java:308)
at com.google.cloud.dataflow.sdk.transforms.PTransform.getDefaultOutputCoder(PTransform.java:389)
at com.google.cloud.dataflow.sdk.values.TypedPValue.inferCoderOrFail(TypedPValue.java:149)
at com.google.cloud.dataflow.sdk.values.TypedPValue.getCoder(TypedPValue.java:44)
at com.google.cloud.dataflow.sdk.values.PCollection.getCoder(PCollection.java:105)
at com.google.cloud.dataflow.sdk.runners.DirectPipelineRunner$Evaluator.ensureElementEncodable(DirectPipelineRunner.java:789)
at com.google.cloud.dataflow.sdk.transforms.Create.evaluateHelper(Create.java:384)
at com.google.cloud.dataflow.sdk.transforms.Create.access$200(Create.java:89)
at com.google.cloud.dataflow.sdk.transforms.Create$2.evaluate(Create.java:367)
at com.google.cloud.dataflow.sdk.transforms.Create$2.evaluate(Create.java:362)
at com.google.cloud.dataflow.sdk.runners.DirectPipelineRunner$Evaluator.visitTransform(DirectPipelineRunner.java:619)
at com.google.cloud.dataflow.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:200)
at com.google.cloud.dataflow.sdk.runners.TransformTreeNode.visit(TransformTreeNode.java:196)
at com.google.cloud.dataflow.sdk.runners.TransformHierarchy.visit(TransformHierarchy.java:109)
at com.google.cloud.dataflow.sdk.Pipeline.traverseTopologically(Pipeline.java:204)
at com.google.cloud.dataflow.sdk.runners.DirectPipelineRunner$Evaluator.run(DirectPipelineRunner.java:592)
at com.google.cloud.dataflow.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:328)
at com.google.cloud.dataflow.sdk.runners.DirectPipelineRunner.run(DirectPipelineRunner.java:70)
at com.google.cloud.dataflow.sdk.Pipeline.run(Pipeline.java:145)
at sessions.SessionsDataflowTest.testComputeSessions(SessionsDataflowTest.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.google.cloud.dataflow.sdk.util.InstanceBuilder.buildFromMethod(InstanceBuilder.java:219)
... 49 more
Caused by: java.lang.NoClassDefFoundError: org/apache/avro/reflect/AvroSchema
at com.google.cloud.dataflow.sdk.coders.AvroCoder$AvroDeterminismChecker.recurse(AvroCoder.java:354)
at com.google.cloud.dataflow.sdk.coders.AvroCoder$AvroDeterminismChecker.check(AvroCoder.java:347)
at com.google.cloud.dataflow.sdk.coders.AvroCoder.<init>(AvroCoder.java:164)
at com.google.cloud.dataflow.sdk.coders.AvroCoder.of(AvroCoder.java:117)
... 54 more
Caused by: java.lang.ClassNotFoundException: org.apache.avro.reflect.AvroSchema
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 58 more
How can I fix this exception? I'm trying to run my pipeline in a test. I'm using TestPipeline to create and run my test.
The problem was that I was using an old version of Avro (1.7.3) that conflicted with the version of Avro used by Dataflow. I upgraded the version of Avro in my pipeline to the latest version by changing my pom file to:
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>[1.7.7,)</version>
</dependency>