Error executing Bootstraps in Grails 2.1.1 springSecurity plugin - grails

I am creating an interactive grails application and trying to authenticate through springSecurity plugin in grails 2.1.1. I am using IntelliJ idea IDE. When I run my app, following sequence of exceptions is generated, which I cannot understand.
Error 2013-06-24 13:46:53,524 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'instanceTagLibraryApi': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
Message: Error creating bean with name 'instanceTagLibraryApi': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
Line | Method
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Could not autowire method: public void org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Process finished with exit code 1
Kindly correct me, if there's something wrong. **Below is my BuildConfig.groovy file code...
`
grails.servlet.version = "2.5" // 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.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// specify dependency exclusions here; for example, uncomment this to disable ehcache:
// excludes 'ehcache'
}
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
grailsCentral()
mavenLocal()
mavenCentral()
// uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
//mavenRepo "http://snapshots.repository.codehaus.org"
//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 eg.
// runtime 'mysql:mysql-connector-java:5.1.20'
}
plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.8.0"
runtime ":resources:1.1.6"
// Uncomment these (or add new ones) to enable additional resources capabilities
//runtime ":zipped-resources:1.0"
// runtime ":cached-resources:1.0"
//runtime ":yui-minify-resources:0.1.4"
build ":tomcat:$grailsVersion"
runtime ":database-migration:1.1"
//compile ':cache:1.0.0'
}
}
`**

ClassCastException: com.sun.proxy.$Proxy24 cannot be cast to java.lang.annotation.Annotation
suggests that you are falling foul of GRAILS-9952, which is a problem with the dev-mode reloading agent. The JIRA claims that a fix will be in the next release (2.1.6), or there is a workaround which involves replacing the springloaded JAR file in your current Grails with a newer version and clearing out your ~/.grails/<version>/.slcache directory.

You will go to current user directory then clean/remove these directory file
.grials/2.1.1/.slcache/
OR
.grials/.slcache/

Related

Can not run app with weceem plugin

Hello I'm trying to use weceem plugin but i got error:
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': Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: java.util.Set
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | 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': Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: java.util.Set
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: java.util.Set
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by MappingException: Association references unmapped class: java.util.Set
->> 45 | buildSessionFactory .............................
Every i've configured the plugin like it said on doc: http://jcatalog.github.io/weceem-plugin/guide/2.ConfigurationAndInstallation.html
and i also run the weceemapp demo from :https://github.com/julyantonicheva/weceem-app and it were working well.
So idon't see the unmapped reference class like it says may someone has ever mett this error.
A little precision before plugin the application were running well
Grails 2.4.4
Windows 7
Builconfig (for conflict on plugin eventually)
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.9"
// plugins needed at runtime but not for compilation
// runtime ":hibernate4:4.3.6.1" // or ":hibernate:3.6.10.18"
runtime ":hibernate:3.6.10.19"//for multi tenant
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
//new
compile ":i18n-templates:1.1.0.1"
compile ":ckeditor:4.4.1.0"
// 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"
//security
compile "org.grails.plugins:spring-security-core:2.0.0"
compile "org.grails.plugins:spring-security-ui:1.0-RC3"
compile "org.grails.plugins:mail:1.0.7"
//multi societe0.9.0-SNAPSHOT"
compile "org.grails.plugins:multi-tenant-single-db:0.8.3"
//excel import
compile ":excel-import:2.0.0.BUILD-SNAPSHOT"
//audit log
compile "org.grails.plugins:audit-logging:1.1.1"
//test weceem
compile ':weceem:1.4.1'
compile ":weceem-spring-security:1.4"
}
Tks regards
Finnaly i find the solution.
In fact by updating my user class adding autorities field for weceem.springsecurity.details.mapper it created 2 autorities field one from my class and one from plugin.
I change for my class and put rautorities instead of autorities now it's solved app is running.
tks for viewers

Grails 2.4.3 ERROR context.GrailsContextLoaderListener

I am getting following error when I execute grails run-app, I am trying to run grails-sso-sample application locally but unable to do so
Following is the error from Stacktrace
Stacktrace
| Error 2017-01-19 15:06:29,946 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table account_role drop constraint FK_p2jpuvn8yll7x96rae4hvw3sj if exists
| Error 2017-01-19 15:06:29,966 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Table "ACCOUNT_ROLE" not found; SQL statement:
alter table account_role drop constraint FK_p2jpuvn8yll7x96rae4hvw3sj if exists [42102-176]
| Error 2017-01-19 15:06:29,967 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table account_role drop constraint FK_ibmw1g5w37bmuh5fc0db7wn10 if exists
| Error 2017-01-19 15:06:29,967 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport - Table "ACCOUNT_ROLE" not found; SQL statement:
alter table account_role drop constraint FK_ibmw1g5w37bmuh5fc0db7wn10 if exists [42102-176]
| Error 2017-01-19 15:06:32,648 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'samlIDPDiscovery': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.SAMLDiscovery.setSamlEntryPoint(org.springframework.security.saml.SAMLEntryPoint); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'samlEntryPoint': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.SAMLEntryPoint.setWebSSOprofile(org.springframework.security.saml.websso.WebSSOProfile); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSSOprofile': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.websso.AbstractProfileBase.setProcessor(org.springframework.security.saml.processor.SAMLProcessor); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processor' defined in class path resource [security/springSecuritySamlBeans.xml]: Cannot resolve reference to bean 'postBinding' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'postBinding': Cannot resolve reference to bean 'velocityEngine' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityEngine': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static org.apache.velocity.app.VelocityEngine org.springframework.security.saml.util.VelocityFactory.getEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
Message: Error creating bean with name 'samlIDPDiscovery': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.SAMLDiscovery.setSamlEntryPoint(org.springframework.security.saml.SAMLEntryPoint); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'samlEntryPoint': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.SAMLEntryPoint.setWebSSOprofile(org.springframework.security.saml.websso.WebSSOProfile); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSSOprofile': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.websso.AbstractProfileBase.setProcessor(org.springframework.security.saml.processor.SAMLProcessor); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processor' defined in class path resource [security/springSecuritySamlBeans.xml]: Cannot resolve reference to bean 'postBinding' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'postBinding': Cannot resolve reference to bean 'velocityEngine' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityEngine': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static org.apache.velocity.app.VelocityEngine org.springframework.security.saml.util.VelocityFactory.getEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
Line | Method
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Could not autowire method: public void org.springframework.security.saml.SAMLDiscovery.setSamlEntryPoint(org.springframework.security.saml.SAMLEntryPoint); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'samlEntryPoint': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.SAMLEntryPoint.setWebSSOprofile(org.springframework.security.saml.websso.WebSSOProfile); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSSOprofile': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.websso.AbstractProfileBase.setProcessor(org.springframework.security.saml.processor.SAMLProcessor); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processor' defined in class path resource [security/springSecuritySamlBeans.xml]: Cannot resolve reference to bean 'postBinding' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'postBinding': Cannot resolve reference to bean 'velocityEngine' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityEngine': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static org.apache.velocity.app.VelocityEngine org.springframework.security.saml.util.VelocityFactory.getEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'samlEntryPoint': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.SAMLEntryPoint.setWebSSOprofile(org.springframework.security.saml.websso.WebSSOProfile); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSSOprofile': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.websso.AbstractProfileBase.setProcessor(org.springframework.security.saml.processor.SAMLProcessor); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processor' defined in class path resource [security/springSecuritySamlBeans.xml]: Cannot resolve reference to bean 'postBinding' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'postBinding': Cannot resolve reference to bean 'velocityEngine' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityEngine': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static org.apache.velocity.app.VelocityEngine org.springframework.security.saml.util.VelocityFactory.getEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Could not autowire method: public void org.springframework.security.saml.SAMLEntryPoint.setWebSSOprofile(org.springframework.security.saml.websso.WebSSOProfile); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSSOprofile': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.websso.AbstractProfileBase.setProcessor(org.springframework.security.saml.processor.SAMLProcessor); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processor' defined in class path resource [security/springSecuritySamlBeans.xml]: Cannot resolve reference to bean 'postBinding' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'postBinding': Cannot resolve reference to bean 'velocityEngine' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityEngine': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static org.apache.velocity.app.VelocityEngine org.springframework.security.saml.util.VelocityFactory.getEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'webSSOprofile': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.security.saml.websso.AbstractProfileBase.setProcessor(org.springframework.security.saml.processor.SAMLProcessor); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processor' defined in class path resource [security/springSecuritySamlBeans.xml]: Cannot resolve reference to bean 'postBinding' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'postBinding': Cannot resolve reference to bean 'velocityEngine' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityEngine': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static org.apache.velocity.app.VelocityEngine org.springframework.security.saml.util.VelocityFactory.getEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Could not autowire method: public void org.springframework.security.saml.websso.AbstractProfileBase.setProcessor(org.springframework.security.saml.processor.SAMLProcessor); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processor' defined in class path resource [security/springSecuritySamlBeans.xml]: Cannot resolve reference to bean 'postBinding' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'postBinding': Cannot resolve reference to bean 'velocityEngine' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityEngine': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static org.apache.velocity.app.VelocityEngine org.springframework.security.saml.util.VelocityFactory.getEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'processor' defined in class path resource [security/springSecuritySamlBeans.xml]: Cannot resolve reference to bean 'postBinding' while setting constructor argument with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'postBinding': Cannot resolve reference to bean 'velocityEngine' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityEngine': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static org.apache.velocity.app.VelocityEngine org.springframework.security.saml.util.VelocityFactory.getEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'postBinding': Cannot resolve reference to bean 'velocityEngine' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityEngine': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static org.apache.velocity.app.VelocityEngine org.springframework.security.saml.util.VelocityFactory.getEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'velocityEngine': Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static org.apache.velocity.app.VelocityEngine org.springframework.security.saml.util.VelocityFactory.getEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanDefinitionStoreException: Factory method [public static org.apache.velocity.app.VelocityEngine org.springframework.security.saml.util.VelocityFactory.getEngine()] threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
->> 266 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties
->> 183 | <init> in org.apache.velocity.runtime.RuntimeInstance
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 60 | <init> in org.apache.velocity.app.VelocityEngine
| 266 | run . . . in java.util.concurrent.FutureTask
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by ClassNotFoundException: org.apache.commons.collections.ExtendedProperties
->> 372 | run in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 361 | run in ''
| 360 | findClass in java.net.URLClassLoader
| 424 | loadClass in java.lang.ClassLoader
| 183 | <init> . in org.apache.velocity.runtime.RuntimeInstance
| 60 | <init> in org.apache.velocity.app.VelocityEngine
| 266 | run . . . in java.util.concurrent.FutureTask
| 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 617 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
| Error Forked Grails VM exited with error
Following is my BuildConfig file
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.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: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
// configure settings for the run-app JVM
run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the run-war JVM
war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the Console UI JVM
console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]
grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// specify dependency exclusions here; for example, uncomment this to disable ehcache:
// excludes 'ehcache'
}
log "error" // 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()
mavenRepo "http://repo.spring.io/milestone/"
mavenRepo "http://repo.grails.org/grails/core"
mavenRepo "http://repo.grails.org/grails/plugins/"
// 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.24'
compile('commons-httpclient:commons-httpclient:3.1') {
excludes 'commons-codec', 'commons-logging', 'junit'
}
compile('ca.juliusdavies:not-yet-commons-ssl:0.3.9') {
excludes 'commons-httpclient', 'log4j'
}
compile('org.opensaml:opensaml:2.6.1') {
excludes 'commons-codec', 'commons-collections', 'commons-lang', 'esapi', 'jcip-annotations', 'jcl-over-slf4j', 'joda-time', 'jul-to-slf4j', 'junit', 'log4j-over-slf4j', 'logback-classic', 'openws', 'serializer', 'servlet-api', 'slf4j-api', 'spring-core', 'spring-mock', 'testng', 'velocity', 'xalan', 'xercesImpl', 'xml-apis', 'xml-resolver', 'xmlunit'
}
compile('org.opensaml:xmltooling:1.3.4') {
excludes 'bcprov-jdk15', 'commons-codec', 'jcip-annotations', 'jcl-over-slf4j', 'joda-time', 'jul-to-slf4j', 'junit', 'log4j-over-slf4j', 'logback-classic', 'not-yet-commons-ssl', 'serializer', 'slf4j-api', 'testng', 'xalan', 'xercesImpl', 'xml-apis', 'xml-resolver', 'xmlsec', 'xmlunit'
}
compile('org.apache.velocity:velocity:1.7') {
excludes 'ant', 'commons-collections', 'commons-lang', 'commons-logging', 'hsqldb', 'jdom', 'junit', 'log4j', 'logkit', 'oro', 'servlet-api', 'werken-xpath'
}
compile 'joda-time:joda-time:1.6.2'
compile('org.opensaml:openws:1.4.4') {
excludes 'commons-codec', 'commons-httpclient', 'jcip-annotations', 'jcl-over-slf4j', 'joda-time', 'jul-to-slf4j', 'junit', 'log4j-over-slf4j', 'logback-classic', 'serializer', 'servlet-api', 'slf4j-api', 'spring-core', 'spring-mock', 'testng', 'xalan', 'xercesImpl', 'xml-apis', 'xml-resolver', 'xmltooling', 'xmlunit'
}
compile 'org.bouncycastle:bcprov-jdk15:1.45'
compile 'org.apache.santuario:xmlsec:1.4.4'
compile('org.owasp.esapi:esapi:2.0.1') {
excludes 'antisamy', 'bsh-core', 'commons-beanutils-core', 'commons-collections', 'commons-configuration', 'commons-fileupload', 'commons-io', 'jsp-api', 'junit', 'log4j', 'servlet-api', 'xom'
}
compile('org.springframework.security.extensions:spring-security-saml2-core:1.0.2.RELEASE') {
export = false
excludes 'spring-security-core'
excludes 'spring-security-web'
}
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.47"
// plugins for the compile step
compile ":scaffolding:2.1.0"
//compile ':cache:1.1.1'
//compile 'org.grails.plugins:cache-headers:1.1.7'
compile ':asset-pipeline:1.8.3'
compile ":spring-security-core:2.0.0"
// plugins needed at runtime but not for compilation
runtime ':hibernate4:4.3.5.2' // or ':hibernate:3.6.10.14'
runtime ':database-migration:1.4.0'
runtime ':jquery:1.11.0.2'
runtime ':resources:1.2.14'
// Uncomment these (or add new ones) to enable additional resources capabilities
//runtime ":zipped-resources:1.0.1"
//runtime ":cached-resources:1.1"
//runtime ":yui-minify-resources:0.1.5"
}
}
I can provide more details if you want, can anyone help why is this happening?
The error you are getting is because of java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties. And in your dependencies section you are excluding 'commons-collections'. Make sure you have the correct version of 'commons-collections' in your project. In version 4 there isn't a ExtendedProperties class.

Grails cannot load oracle.jdbc.driver.OracleDriver and --refresh-dependencies does not work

I get ClassNotFoundException: oracle.jdbc.OracleDriver any time I do a grails run-app without having done --refresh-dependencies immediately prior (I have the oracle driver .jar in my project /lib).
I have seen similar questions here and elsewhere, and the answer always seems to be to run --refresh-depdencies
However, I find that doing this only works for exactly one time after --refresh-dependencies is run. Any subsequent time I do run-app I get the ClassNotFoundException: oracle.jdbc.OracleDriver again, until I once again run --refresh-dependencies. By running --refresh-dependencies every time I am about to run-app I can still function, but it is quite annoying.
I am running grails 2.3.0.
grails output without having done --refresh-dependencies immediately prior to run-app:
| Loading Grails 2.3.0
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Running Grails application
Configuring Spring Security Core ...
... finished configuring Spring Security Core
Configuring Spring Security LDAP ...
... finished configuring Spring Security LDAP
Configuring Spring Security CAS ...
... finished configuring Spring Security CAS
| Error 2014-01-14 15:15:14,235 [localhost-startStop-1] ERROR context.GrailsContextLoader - 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: oracle.jdbc.OracleDriver
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: oracle.jdbc.OracleDriver
Line | Method
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | 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: oracle.jdbc.OracleDriver
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | 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: oracle.jdbc.OracleDriver
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | 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: oracle.jdbc.OracleDriver
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | 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: oracle.jdbc.OracleDriver
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | 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: oracle.jdbc.OracleDriver
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by SQLException: oracle.jdbc.OracleDriver
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by ClassNotFoundException: oracle.jdbc.OracleDriver
->> 175 | findClass in org.codehaus.groovy.tools.RootLoader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 423 | loadClass in java.lang.ClassLoader
| 147 | loadClass in org.codehaus.groovy.tools.RootLoader
| 356 | loadClass in java.lang.ClassLoader
| 266 | forName . in java.lang.Class
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
and right after doing --refresh-dependencies:
| Loading Grails 2.3.0
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Running Grails application
Configuring Spring Security Core ...
... finished configuring Spring Security Core
Configuring Spring Security LDAP ...
... finished configuring Spring Security LDAP
Configuring Spring Security CAS ...
... finished configuring Spring Security CAS
| Server running. Browse to http://localhost:8080/loggity-rest
I do not consider this to be an "answer" to my own question, but I am posting it here as a possible workaround solution in case anyone else is experiencing this issue.
I was able to get this problem to stop happening by pulling my oracle driver in through BuildConfig.groovy rather than using the /lib folder.
The reason I do not consider this a solution is that in order to do this you need a repository where the oracle driver artifact can be found, and it is not in any public repositories nor allowed to be due to "stinginess" on the part of oracle.
My company has a private repository that I am able to use that is shared by our CI server, and this solution would work only for those that have access to a private repository of some kind. What I put into my BuildConfig.groovy is pretty much what you might expect:
runtime "com.oracle:ojdbc6:11.2.0.1.0"
Those that cannot use this solution due to not having a repository available with the oracle driver jar in it will still need a solution to the issue that arises when using /lib.
I was having similar problem where one time it would run app fine but as soon as I restart it will throw "pool connection" exception.
Adding the following line in BuildConfig.groovy fixed my problem. Not sure why it was missing to begin with.
grails.project.dependency.resolver = "maven" // or ivy
This looks like an issue with the new Aether dependency manager that's used by default in 2.3. It's a lot faster than and in general works better than Ivy, but there are a handful of Ivy features that aren't supported.
I was able to get this working by changing from Aether to Ivy in BuildConfig.groovy:
grails.project.dependency.resolver = "ivy"
Changing the line in my BuildConfig from this:
runtime "com.oracle:ojdbc6:11.2.0.1.0"
to this (leaving out com.):
runtime "oracle:ojdbc6:11.2.0.1.0"
worked for me.

Grails 2.3.4 not working running the app

I created a new project with
Grails 2.3.4
Java JDK 1.7.0_45
ubuntu 13.10 64 bits
2gb ram
When I run the command:
grails run-app
see the following errors:
| Error 2014-01-11 10:49:49,007 [localhost-startStop-1] ERROR context.GrailsContextLoader - 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.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
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.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
Line | Method
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | 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.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | 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.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | 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.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | run . . . in java.lang.Thread
Caused by CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | run . . . in java.lang.Thread
| Error Forked Grails VM exited with error
i dont know whats happen with this...please help
Make sure you are using JAVA_HOME set to oracle jdk and not to open jdk. I'm working with your same enviroment and i have no problem. Probably this post stackoverflow.com/questions/17293763 even if grails is a bit older than grails 2.3.4.
Problem:
Could not determine Hibernate dialect for database name [H2]! # or PostgresSQL if postgres is used
check out :
Grails suddenly throws error Could not determine Hibernate dialect for database name
Replacing OpenJDK 1.7.x with OpenJDK 1.6.x seems to have solved it for me (Ubuntu 13.04).
How do I avoid 'Could not determine Hibernate dialect for database name [H2]!'?
My solution is, in your DataSource.groovy, use this
dialect='org.hibernate.dialect.H2DialectPatch'

Unable to run Grails project using Spring Security Core in GGTS on Windows 7

I’m new to Grails and I’m trying desperately to get the Spring Security plugin to run. I added the following line to my project’s BuildConfig.groovy:
plugins{
...
compile ":spring-security-core:1.2.7.3"
...
}
Then I tried to install the plugin via the install-plugin command. No matter which way I choose, I cannot launch the project now that I’ve run the s2-quickstart script (which creates the Spring Security domain classes and controllers).
I’m using PostgreSQL as a database and running Groovy/Grails Tool Suite on Windows 7, with Grails version 2.2.1.
This is the error message:
| Loading Grails 2.2.1
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application....
| Compiling 7 source files.....
| Running Grails application
Configuring Spring Security Core ...
... finished configuring Spring Security Core
| Error 2013-03-29 22:15:17,677 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: Error creating bean with name 'instanceTagLibraryApi': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy26 cannot be cast to java.lang.annotation.Annotation
Message: Error creating bean with name 'instanceTagLibraryApi': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy26 cannot be cast to java.lang.annotation.Annotation
Line | Method
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Could not autowire method: public void org.codehaus.groovy.grails.plugins.web.api.TagLibraryApi.setGspTagLibraryLookup(org.codehaus.groovy.grails.web.pages.TagLibraryLookup); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy26 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'gspTagLibraryLookup': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy26 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy26 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Could not autowire field: private org.codehaus.groovy.grails.web.mapping.LinkGenerator org.codehaus.groovy.grails.plugins.web.taglib.ApplicationTagLib.linkGenerator; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy26 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'grailsLinkGenerator': Post-processing failed of bean type [class org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator] failed; nested exception is java.lang.ClassCastException: com.sun.proxy.$Proxy26 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by ClassCastException: com.sun.proxy.$Proxy26 cannot be cast to java.lang.annotation.Annotation
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
EDIT:
Running the app using run-app --verbose --stacktrace results in a successful server launch, but the process does not finish in the background. After a short time, the server shuts down with an error:
run-app --verbose --stacktrace encountered a problem
timelimit was exceeded.
EDIT 2:
grails -noreload run-app and grails clean followed by a grails run-app both cause the server to launch properly, but then the the server shuts down after a short time (as I explained in my first edit):
grails -noreload run-app encountered a problem
The same happens when I delete the Ivy cache in $USER/.grails/.
The information on this error is a copy of the console output:
| Loading Grails 2.2.1
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application....
| Compiling 1 source files
[groovyc] Compiling 1 source file to C:\Grails\test\target\classes
| Compiling 1 source files.....
| Running Grails application
Configuring Spring Security Core ...
... finished configuring Spring Security Core
| Server running. Browse to http://localhost:9000/test
Does the app start up with reloading (spring-loaded agent) disabled?
grails -noreloading run-app
A similar problem has been reported to Grails Jira as GRAILS-9952. It would help fixing the problem if you can provide an test app that reproduces the problem. Please attach that to the jira issue.
I solved the problem by my own. when i ran the app out of cmd it seemed to work. the reason for this was a missmatch between the groovy compilers i installed and GGTS was using.

Resources