Grails2.4.3中的MongoDB(3.0.2)NullPointerException
我正在尝试在EC2上安装GrailsWeb应用程序 实例类型:m3 xlarge 从安装的JAVA 版本: java版本“1.7.0_80” Java(TM)SE运行时环境(build 1.7.0_80-b15) Java HotSpot(TM)64位服务器虚拟机(构建24.80-b11,混合模式) (因为Java8有问题:) 从GVMtools安装的Grails 已从安装mongoDB 有版本 MongoDB外壳版本:3.0.2 连接到:测试 我的DataSource.groovy配置是:Grails2.4.3中的MongoDB(3.0.2)NullPointerException,mongodb,grails,amazon-ec2,Mongodb,Grails,Amazon Ec2,我正在尝试在EC2上安装GrailsWeb应用程序 实例类型:m3 xlarge 从安装的JAVA 版本: java版本“1.7.0_80” Java(TM)SE运行时环境(build 1.7.0_80-b15) Java HotSpot(TM)64位服务器虚拟机(构建24.80-b11,混合模式) (因为Java8有问题:) 从GVMtools安装的Grails 已从安装mongoDB 有版本 MongoDB外壳版本:3.0.2 连接到:测试 我的DataSource.groovy配置是:
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具有最新的mongo插件:
compile ":mongodb:3.0.3"
但是在启动服务器之后
grails run-app
打开任何一页我都会看到这个
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:我还尝试创建用户并对其进行身份验证()
使用db.createUser
配置可能有什么问题完全相同的配置在本地计算机上运行正常。我创建了一个具有相同版本的实例,它运行正常。您是否尝试过使用grails clean,然后运行应用程序。这可能没有帮助,但部署时您不会使用spring-loaded,它仅适用于
运行应用程序
。您能在2.4.5或2.5.0中试用吗?在2.4.5中出现同样的错误您的配置看起来很好。您是否尝试过使用旧版本的mongo运行应用程序,如2.6.9
。v3可能与mongodb:3.0.3
存在兼容性问题。是的。2.6.9给出了相同的错误我不确定这是否会对你有所帮助-但谷歌让我找到这个链接:
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