8

I am trying to setup Grails web Application on EC2

InstanceType: m3 xlarge

installed JAVA from http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html

version : java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

( as JAVA 8 is having issues : https://github.com/spring-projects/spring-loaded/issues/98 )

installed Grails from GVMtools

http://gvmtool.net/

grails version : 2.4.3

installed mongoDB from

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

with version MongoDB shell version: 3.0.2 connecting to: test

my DataSource.groovy config are :

environments {
    development {
        grails {
            mongo {
                host = "localhost"
                port = 27017
                username = "root"
                password = "root"
                databaseName = "someDatabase"
            }
        }
        dataSource {
            dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
            url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
        } 
    }

my Buildconfig.groovy has latest mongo plugin:

compile ":mongodb:3.0.3"

but after starting the server

grails run-app

and opening any page i am getting this

Error:

Stacktrace follows:
Message: null
    Line | Method
->>  833 | executeQuery     in      org.grails.datastore.mapping.mongo.query.MongoQuery
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    542 | list             in org.grails.datastore.mapping.query.Query
|     49 | invokeQuery . .  in org.grails.datastore.gorm.finders.FindAllByFinder
|     43 | doInSession      in org.grails.datastore.gorm.finders.FindAllByFinder$1
|    302 | execute . . . .  in org.grails.datastore.mapping.core.DatastoreUtils
|     41 | execute          in org.grails.datastore.gorm.finders.AbstractFinder
|     40 | doInvokeInternal in org.grails.datastore.gorm.finders.FindAllByFinder
|    152 | invoke           in org.grails.datastore.gorm.finders.DynamicFinder
|    352 | invoke . . . . . in     ''
|    105 | methodMissing    in org.grails.datastore.gorm.GormStaticApi
|     32 | call . . . . . . in org.grails.datastore.gorm.internal.StaticMethodInvokingClosure
|     49 | function    in someDomain
|     25 | listAllResources in in.org.api.APIController
|     16 | index            in     ''
|    198 | doFilter . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
|     63 | doFilter         in grails.plugin.cache.web.filter.AbstractFilter
|     53 | doFilter . . . . in   grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilte r
|     49 | doFilter         in grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter
|     82 | doFilter . . . . in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
|   1145 | runWorker        in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . .  in java.util.concurrent.ThreadPoolExecutor$Worker
     745 | run              in java.lang.Thread

PS: I also tried creating user and authenticating it ( Grails - Connect to a MongoDB database using authentication )

with db.createUser.

What could be wrong with the configuration exact same configuration runs fine on my local machine.

9
  • It's not likely to be helpful, but you won't be using spring-loaded when deployed, it's only for run-app. Could you try it with 2.4.5 or 2.5.0? Apr 21, 2015 at 18:12
  • same error with 2.4.5 Apr 21, 2015 at 18:28
  • Your configuration looks fine. Did you try running your app with older version of mongo like 2.6.9. v3 might have compatibility issues with mongodb:3.0.3. Apr 29, 2015 at 10:01
  • Yeah. 2.6.9 gave the same error Apr 29, 2015 at 10:02
  • im not sure if that will help you - but googling lead me to this link : blog.mongodb.org/post/18510469058/grails-in-the-land-of-mongodb Apr 30, 2015 at 18:58

1 Answer 1

1

I created a instance with the same version and it works fine. Have you tried using grails clean and then run the app.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.