Quantcast

MongoDB Plugin: Can't get run-app to start

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

MongoDB Plugin: Can't get run-app to start

BigGillyStyle
Sigh...I've created a new, bare Grails 2.1.0 app and tried to follow these instructions:


...but when I type "grails run-app" I get the following stack trace:

| Compiling 115 source files.
| Error Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
...

(I could paste the whole stack trace if desired)

I've installed the mongodb plugin and uninstalled the hibernate plugin.  Also, I made the following simple changes to configuration files:

DataSource.groovy:
grails {
    mongo {
        host = "localhost"
        port = 27017
    }
}

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.target.level = 1.7
grails.project.source.level = 1.7
//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://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.7.2"
        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'
        compile ':mongodb:1.0.0.GA'
    }
}

I'm sure there's something fundamental that I'm doing wrong, but as a Grails newbie who has now searched StackOverflow, Google, and the Nabble archives without success I just can't figure this out yet.  Does anyone spot the obvious problem?

Thanks,
Andy Pickler

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: MongoDB Plugin: Can't get run-app to start

jstell
Database migration plugin appears to require hibernate:

Jason

On Sun, Jul 22, 2012 at 8:19 AM, Andy Pickler <[hidden email]> wrote:
Sigh...I've created a new, bare Grails 2.1.0 app and tried to follow these instructions:


...but when I type "grails run-app" I get the following stack trace:

| Compiling 115 source files.
| Error Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
...

(I could paste the whole stack trace if desired)

I've installed the mongodb plugin and uninstalled the hibernate plugin.  Also, I made the following simple changes to configuration files:

DataSource.groovy:
grails {
    mongo {
        host = "localhost"
        port = 27017
    }
}

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.target.level = 1.7
grails.project.source.level = 1.7
//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://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.7.2"
        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'
        compile ':mongodb:1.0.0.GA'
    }
}

I'm sure there's something fundamental that I'm doing wrong, but as a Grails newbie who has now searched StackOverflow, Google, and the Nabble archives without success I just can't figure this out yet.  Does anyone spot the obvious problem?

Thanks,
Andy Pickler


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: MongoDB Plugin: Can't get run-app to start

Graeme Rocher-2
Yeah you need to remove the database migration plugin it seems

-- 
Graeme Rocher

On Sunday, July 22, 2012 at 10:21 PM, Jason Stell wrote:

Database migration plugin appears to require hibernate:

Jason

On Sun, Jul 22, 2012 at 8:19 AM, Andy Pickler <[hidden email]> wrote:
Sigh...I've created a new, bare Grails 2.1.0 app and tried to follow these instructions:


...but when I type "grails run-app" I get the following stack trace:

| Compiling 115 source files.
| Error Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
...

(I could paste the whole stack trace if desired)

I've installed the mongodb plugin and uninstalled the hibernate plugin.  Also, I made the following simple changes to configuration files:

DataSource.groovy:
grails {
    mongo {
        host = "localhost"
        port = 27017
    }
}

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.target.level = 1.7
grails.project.source.level = 1.7
//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://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.7.2"
        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'
        compile ':mongodb:1.0.0.GA'
    }
}

I'm sure there's something fundamental that I'm doing wrong, but as a Grails newbie who has now searched StackOverflow, Google, and the Nabble archives without success I just can't figure this out yet.  Does anyone spot the obvious problem?

Thanks,
Andy Pickler



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: MongoDB Plugin: Can't get run-app to start

Nicholas Wittstruck
If something similar happens again, you can also run dependency-report to get check who relies on the library that can't be found. http://www.grails.org/doc/latest/guide/conf.html#dependencyReports

Nicholas

--

On 23.07.2012, at 10:21, Graeme Rocher wrote:

Yeah you need to remove the database migration plugin it seems

-- 
Graeme Rocher

On Sunday, July 22, 2012 at 10:21 PM, Jason Stell wrote:

Database migration plugin appears to require hibernate:

Jason

On Sun, Jul 22, 2012 at 8:19 AM, Andy Pickler <[hidden email]> wrote:
Sigh...I've created a new, bare Grails 2.1.0 app and tried to follow these instructions:


...but when I type "grails run-app" I get the following stack trace:

| Compiling 115 source files.
| Error Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
...

(I could paste the whole stack trace if desired)

I've installed the mongodb plugin and uninstalled the hibernate plugin.  Also, I made the following simple changes to configuration files:

DataSource.groovy:
grails {
    mongo {
        host = "localhost"
        port = 27017
    }
}

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.target.level = 1.7
grails.project.source.level = 1.7
//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://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.7.2"
        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'
        compile ':mongodb:1.0.0.GA'
    }
}

I'm sure there's something fundamental that I'm doing wrong, but as a Grails newbie who has now searched StackOverflow, Google, and the Nabble archives without success I just can't figure this out yet.  Does anyone spot the obvious problem?

Thanks,
Andy Pickler




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: MongoDB Plugin: Can't get run-app to start

BigGillyStyle
Hmmm...uninstalling the database-migration plugin didn't solve the problem.  I ran the dependency report, and the database-migration plugin says it's required by org.grails.internal and also reports that it has no dependencies.  I searched for "hibernate" and found:
  1. grails-hibernate: required by org.grails.internal, no dependencies
  2. hibernate-jpa-2.0-api: required by org.grails.internal, no dependencies
Apparently neither of those are plugins, as Grails reports "Warning No plugin [hibernate-jpa-2.0-api] installed, cannot uninstall"

Andy

On Mon, Jul 23, 2012 at 9:22 AM, Nicholas Wittstruck <[hidden email]> wrote:
If something similar happens again, you can also run dependency-report to get check who relies on the library that can't be found. http://www.grails.org/doc/latest/guide/conf.html#dependencyReports

Nicholas

--

On 23.07.2012, at 10:21, Graeme Rocher wrote:

Yeah you need to remove the database migration plugin it seems

-- 
Graeme Rocher

On Sunday, July 22, 2012 at 10:21 PM, Jason Stell wrote:

Database migration plugin appears to require hibernate:

Jason

On Sun, Jul 22, 2012 at 8:19 AM, Andy Pickler <[hidden email]> wrote:
Sigh...I've created a new, bare Grails 2.1.0 app and tried to follow these instructions:


...but when I type "grails run-app" I get the following stack trace:

| Compiling 115 source files.
| Error Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
...

(I could paste the whole stack trace if desired)

I've installed the mongodb plugin and uninstalled the hibernate plugin.  Also, I made the following simple changes to configuration files:

DataSource.groovy:
grails {
    mongo {
        host = "localhost"
        port = 27017
    }
}

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.target.level = 1.7
grails.project.source.level = 1.7
//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://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.7.2"
        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'
        compile ':mongodb:1.0.0.GA'
    }
}

I'm sure there's something fundamental that I'm doing wrong, but as a Grails newbie who has now searched StackOverflow, Google, and the Nabble archives without success I just can't figure this out yet.  Does anyone spot the obvious problem?

Thanks,
Andy Pickler





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: MongoDB Plugin: Can't get run-app to start

BigGillyStyle
Okay, this was a newbie error.  I uninstalled the database-migration plugin by typing "grails uninstall-plugin ..." in a Terminal.  However, I now realize that BuildConfig.groovy is the way to load dependencies, and thus I just needed to comment out this line:

runtime ":database-migration:1.1"

Now my app starts just fine.

Andy

On Mon, Jul 23, 2012 at 7:53 PM, Andy Pickler <[hidden email]> wrote:
Hmmm...uninstalling the database-migration plugin didn't solve the problem.  I ran the dependency report, and the database-migration plugin says it's required by org.grails.internal and also reports that it has no dependencies.  I searched for "hibernate" and found:
  1. grails-hibernate: required by org.grails.internal, no dependencies
  2. hibernate-jpa-2.0-api: required by org.grails.internal, no dependencies
Apparently neither of those are plugins, as Grails reports "Warning No plugin [hibernate-jpa-2.0-api] installed, cannot uninstall"

Andy

On Mon, Jul 23, 2012 at 9:22 AM, Nicholas Wittstruck <[hidden email]> wrote:
If something similar happens again, you can also run dependency-report to get check who relies on the library that can't be found. http://www.grails.org/doc/latest/guide/conf.html#dependencyReports

Nicholas

--

On 23.07.2012, at 10:21, Graeme Rocher wrote:

Yeah you need to remove the database migration plugin it seems

-- 
Graeme Rocher

On Sunday, July 22, 2012 at 10:21 PM, Jason Stell wrote:

Database migration plugin appears to require hibernate:

Jason

On Sun, Jul 22, 2012 at 8:19 AM, Andy Pickler <[hidden email]> wrote:
Sigh...I've created a new, bare Grails 2.1.0 app and tried to follow these instructions:


...but when I type "grails run-app" I get the following stack trace:

| Compiling 115 source files.
| Error Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
...

(I could paste the whole stack trace if desired)

I've installed the mongodb plugin and uninstalled the hibernate plugin.  Also, I made the following simple changes to configuration files:

DataSource.groovy:
grails {
    mongo {
        host = "localhost"
        port = 27017
    }
}

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.target.level = 1.7
grails.project.source.level = 1.7
//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://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.7.2"
        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'
        compile ':mongodb:1.0.0.GA'
    }
}

I'm sure there's something fundamental that I'm doing wrong, but as a Grails newbie who has now searched StackOverflow, Google, and the Nabble archives without success I just can't figure this out yet.  Does anyone spot the obvious problem?

Thanks,
Andy Pickler






Loading...