jbossews登录openshift显示com.mongodb.CommandFailureException:{" serverUsed":" 127.xx2.xxx.xx0:27017"," ok":0.0, " ERRMSG":"未授权"}

时间:2015-04-12 18:43:07

标签: mongodb tomcat openshift hibernate-ogm

jbossews.log段:

  

引起:com.mongodb.CommandFailureException:{" serverUsed" :" 127.xxx.xx3.xx0:27018" ," ok" :0.0," errmsg" :"未经授权的"}       at com.mongodb.CommandResult.getException(CommandResult.java:76)       在com.mongodb.CommandResult.throwOnError(CommandResult.java:131)

mongodb.log段:我认为它给了我以上异常, 因为"命令被拒绝:{listDatabases:1}"线。

  

Sun Apr 12 12:30:24.150 [conn1] authenticate db:admin {authenticate:1,nonce:" #####",user:" admin",关键:" *" }
  Sun Apr 12 12:31:54.580 [conn3] authenticate db:mydb {authenticate:1,user:" admin",nonce:" #######",key :" #######" }
  太阳4月12日12:31:54.582 [conn3]命令被拒绝:{listDatabases:1}
  Sun Apr 12 13:20:14.781 [conn4] authenticate db:admin {authenticate:1,user:" admin",nonce:" ######",key: " #######" }
  Sun Apr 12 13:20:15.031 [conn4]命令mydb。$ cmd命令:{$ eval:CodeWScope(function(){return db.getCollectionNames();},{}),args:{}} ntoreturn:1 keyUpdates :0锁(微)W:223980 reslen:109 224ms
  Sun Apr 12 13:20:15.141 [conn5] authenticate db:admin {authenticate:1,user:" admin",nonce:" ######",key: " #######" }

我错过了什么?任何帮助都将受到高度赞赏。

1 个答案:

答案 0 :(得分:0)

如果使用了mongodb盒式磁带,则您的用户名和密码应与安装盒式磁带安装在环境变量中的用户名和密码相匹配。请使用它们,看看是否收到同样的错误。

以下是验证码的示例 - 你在做类似的事情吗?

https://github.com/thesteve0/javaparks/blob/master/src/main/java/org/openshift/data/DBConnection.java