NutzBoot 如何配置 mongodb ?
14 回复
@wendal 是否和nutz db.js
mongo.host=127.0.0.1
mongo.port=27017
mongo.dbname=cmyg
[INFO ] 11:17:31.069 com.mongodb.diagnostics.logging.SLF4JLogger.info(SLF4JLogger.java:76) - Exception in monitor thread while connecting to server 127.0.0.1:27017
com.mongodb.MongoSocketOpenException: Exception opening socket
at com.mongodb.connection.SocketStream.open(SocketStream.java:63)
at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:114)
at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:128)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.mongodb.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:50)
at com.mongodb.connection.SocketStream.open(SocketStream.java:58)
... 3 more
@wendal 启动的了,原来的nutz项目是可以连接的,不知nutzboot如何配置,能否使用
@Inject
protected ZMongo zMongo; //注意大小写与配置的名字一致
@Inject
protected ZMoDB zMoDB; // 当前数据
@Inject
ZMoCo user; // 按js里面的配置取
@wendal nutzboot是跑起来了,就是不知道怎么连接mongodb。。
@wendal 没有看到。
@wendal 实在没有找到关于mongdb的demo。。 所有reamme。md我都翻了
@wendal 谢谢!
添加回复
请先登陆