Discussion:
upgrade from 2.3 to 2.4, "Context initialization failed"
vtdave
2014-06-02 04:40:33 UTC
Permalink
Hey Everyone,

I was working on a grails 2.3 project and 2.4 came out so I decided I'd
upgrade.

I downloaded grails, blew away my target directory and upgraded my
BuildConfig.groovy. It now looks like this:
....
dependencies {
// specify dependencies here under either 'build', 'compile',
'runtime', 'test' or 'provided' scopes e.g.
runtime 'mysql:mysql-connector-java:5.1.29'
// runtime 'org.postgresql:postgresql:9.3-1100-jdbc41'

compile "org.springframework:spring-orm:$springVersion"
}

plugins {
// plugins for the build system only
build ":tomcat:7.0.52.1"

// plugins for the compile step
compile ":scaffolding:2.1.0"
compile ":cache:1.1.3"
compile ":asset-pipeline:1.8.3"


// plugins needed at runtime but not for compilation
// runtime ":hibernate:3.6.10.7" // or ":hibernate4:4.1.11.6"
runtime ":hibernate4:4.3.5.2" // or ":hibernate:3.6.10.14"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.0.2"
// 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"

compile ":spring-security-core:2.0-RC3"
}
}

When I run grails compile it compiles with no errors, but when I type grails
run-app i get the following exception:

context.ContextLoader Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'grailsApplication' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean
'grailsResourceLoader' while setting bean property 'grailsResourceLoader';
nested exception is
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
class [org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean]
for bean with name 'grailsResourceLoader' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
java.lang.ClassNotFoundException:
org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException:
Cannot find class
[org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean] for
bean with name 'grailsResourceLoader' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
java.lang.ClassNotFoundException:
org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean

Thoughts??



--
View this message in context: http://grails.1312388.n4.nabble.com/upgrade-from-2-3-to-2-4-Context-initialization-failed-tp4657057.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
zyro
2014-06-02 04:46:25 UTC
Permalink
https://groups.google.com/forum/#!forum/grails-dev-discuss please.

(copy over the applicationContext.xml from the 2.4 distro into your
grails app)

-------- Original Message --------
Subject: [grails-user] upgrade from 2.3 to 2.4, "Context initialization
failed"
From: vtdave <***@gmail.com>
To: ***@grails.codehaus.org
Date: Sun, 1 Jun 2014 21:40:33 -0700 (pdt)
Post by vtdave
Hey Everyone,
I was working on a grails 2.3 project and 2.4 came out so I decided I'd
upgrade.
I downloaded grails, blew away my target directory and upgraded my
....
dependencies {
// specify dependencies here under either 'build', 'compile',
'runtime', 'test' or 'provided' scopes e.g.
runtime 'mysql:mysql-connector-java:5.1.29'
// runtime 'org.postgresql:postgresql:9.3-1100-jdbc41'
compile "org.springframework:spring-orm:$springVersion"
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.52.1"
// plugins for the compile step
compile ":scaffolding:2.1.0"
compile ":cache:1.1.3"
compile ":asset-pipeline:1.8.3"
// plugins needed at runtime but not for compilation
// runtime ":hibernate:3.6.10.7" // or ":hibernate4:4.1.11.6"
runtime ":hibernate4:4.3.5.2" // or ":hibernate:3.6.10.14"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.0.2"
// 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"
compile ":spring-security-core:2.0-RC3"
}
}
When I run grails compile it compiles with no errors, but when I type grails
context.ContextLoader Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'grailsApplication' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean
'grailsResourceLoader' while setting bean property 'grailsResourceLoader';
nested exception is
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
class [org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean]
for bean with name 'grailsResourceLoader' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Cannot find class
[org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean] for
bean with name 'grailsResourceLoader' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean
Thoughts??
--
View this message in context: http://grails.1312388.n4.nabble.com/upgrade-from-2-3-to-2-4-Context-initialization-failed-tp4657057.html
Sent from the Grails - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Richard Seldon
2014-06-02 04:47:07 UTC
Permalink
This forum is dead.

Please use StackOverflow,

or/

grails-dev-***@googlegroups.com


In summary, if upgrading from 2.3 to 2.4 perhaps your best bet is first to ensure you have 2.4 working correctly with correct versions of Groovy, and Grails installed - GVM tool can help here.

Create a vanilla 2.4 project, and ensure that is working correctly with default build config. Then potentially, build up from there by bring across artefacts from old project to new one, testing as you go.

The upgrade is obviously a full dot upgrade, the docs on the Grails site should provide some guidance on upgrading reqs.

Best of luck.
Post by vtdave
Hey Everyone,
I was working on a grails 2.3 project and 2.4 came out so I decided I'd
upgrade.
I downloaded grails, blew away my target directory and upgraded my
....
dependencies {
// specify dependencies here under either 'build', 'compile',
'runtime', 'test' or 'provided' scopes e.g.
runtime 'mysql:mysql-connector-java:5.1.29'
// runtime 'org.postgresql:postgresql:9.3-1100-jdbc41'
compile "org.springframework:spring-orm:$springVersion"
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.52.1"
// plugins for the compile step
compile ":scaffolding:2.1.0"
compile ":cache:1.1.3"
compile ":asset-pipeline:1.8.3"
// plugins needed at runtime but not for compilation
// runtime ":hibernate:3.6.10.7" // or ":hibernate4:4.1.11.6"
runtime ":hibernate4:4.3.5.2" // or ":hibernate:3.6.10.14"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.0.2"
// 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"
compile ":spring-security-core:2.0-RC3"
}
}
When I run grails compile it compiles with no errors, but when I type grails
context.ContextLoader Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'grailsApplication' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean
'grailsResourceLoader' while setting bean property 'grailsResourceLoader';
nested exception is
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
class [org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean]
for bean with name 'grailsResourceLoader' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Cannot find class
[org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean] for
bean with name 'grailsResourceLoader' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean
Thoughts??
--
View this message in context: http://grails.1312388.n4.nabble.com/upgrade-from-2-3-to-2-4-Context-initialization-failed-tp4657057.html
Sent from the Grails - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Graeme Rocher
2014-06-02 08:06:52 UTC
Permalink
As mentioned by others please use Stack Overflow / the new mailing
list. However in this case please see:

http://grails.org/doc/2.4.x/guide/upgradingFrom23.html

Section "Changes to applicationContext.xml"

Cheers
Post by vtdave
Hey Everyone,
I was working on a grails 2.3 project and 2.4 came out so I decided I'd
upgrade.
I downloaded grails, blew away my target directory and upgraded my
....
dependencies {
// specify dependencies here under either 'build', 'compile',
'runtime', 'test' or 'provided' scopes e.g.
runtime 'mysql:mysql-connector-java:5.1.29'
// runtime 'org.postgresql:postgresql:9.3-1100-jdbc41'
compile "org.springframework:spring-orm:$springVersion"
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.52.1"
// plugins for the compile step
compile ":scaffolding:2.1.0"
compile ":cache:1.1.3"
compile ":asset-pipeline:1.8.3"
// plugins needed at runtime but not for compilation
// runtime ":hibernate:3.6.10.7" // or ":hibernate4:4.1.11.6"
runtime ":hibernate4:4.3.5.2" // or ":hibernate:3.6.10.14"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.0.2"
// 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"
compile ":spring-security-core:2.0-RC3"
}
}
When I run grails compile it compiles with no errors, but when I type grails
context.ContextLoader Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'grailsApplication' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean
'grailsResourceLoader' while setting bean property 'grailsResourceLoader';
nested exception is
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
class [org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean]
for bean with name 'grailsResourceLoader' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Cannot find class
[org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean] for
bean with name 'grailsResourceLoader' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]; nested exception is
org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean
Thoughts??
--
View this message in context: http://grails.1312388.n4.nabble.com/upgrade-from-2-3-to-2-4-Context-initialization-failed-tp4657057.html
Sent from the Grails - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
--
Graeme Rocher
Grails Project Lead
SpringSource

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Continue reading on narkive:
Search results for 'upgrade from 2.3 to 2.4, "Context initialization failed"' (Questions and Answers)
12
replies
what the hell is this?
started 2008-03-02 19:49:11 UTC
computers & internet
Loading...