PlayMorphia with mongoLAB IllegalStateException: Can not call to double-authenticate …

My Play! application has one module, morphia. My DB is mongolab (on AWS). It compiles and runs the first time. Then will throw this DB authenticate exception an all subsequent requests. Does anyone know if playmorphia tries to re-authenticate on every request? Any help much appreciated. Thanks.

Caused by: java.lang.IllegalStateException: can't call authenticate twice on the same DBObject
    at com.mongodb.DB.authenticate(DB.java:437)
    at play.modules.morphia.MorphiaPlugin.initMorphia_(MorphiaPlugin.java:368)
    at play.modules.morphia.MorphiaPlugin.onApplicationStart(MorphiaPlugin.java:444)
    at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:480)
    at play.Play.start(Play.java:515)

Well, db authentication is called on play start. The problem is when you are run in dev mode, play might restart on every code change in your java source and view source.

I’ve never encountered this problem before coz I’ve always using mongodb in a trusted environment
. But this kind of issue should be avoid, probably simply try/catch and ignore. Could you please submit an issue to https://github.com/greenlaw110/play-morphia/issues/new
?

Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 综合编程 » PlayMorphia with mongoLAB IllegalStateException: Can not call to double-authenticate …

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录