upgrade from 2.3 to 2.4, "Context initialization failed"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

upgrade from 2.3 to 2.4, "Context initialization failed"

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 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??
Reply | Threaded
Open this post in threaded view
|

Re: upgrade from 2.3 to 2.4, "Context initialization failed"

zyro
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 <[hidden email]>
To: [hidden email]
Date: Sun, 1 Jun 2014 21:40:33 -0700 (pdt)

> 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
>
>

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: upgrade from 2.3 to 2.4, "Context initialization failed"

arcseldon
In reply to this post by vtdave

This forum is dead.

Please use StackOverflow,

or/

[hidden email]


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.



On 2 Jun 2014, at 13:40, vtdave <[hidden email]> wrote:

> 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
>
>


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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: upgrade from 2.3 to 2.4, "Context initialization failed"

Graeme Rocher-2
In reply to this post by vtdave
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

On Mon, Jun 2, 2014 at 6:40 AM, vtdave <[hidden email]> wrote:

> 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
>
>



--
Graeme Rocher
Grails Project Lead
SpringSource

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

    http://xircles.codehaus.org/manage_email