--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
=Tim=
Here is a sample from my machine.
skot@stump:~/$ netstat -na | grep 27017
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN
unix 2 [ ACC ] STREAM LISTENING 134878414
/tmp/mongodb-27017.sock
Note the two lines, one for the tcp port and one for the unix domain socket.
java.net.UnknownHostException is a checked exception in Java which means you must either explicitly catch it, or declare that you can throw it in your method. Your code can't compile because you aren't handling UnknownHostException. It specifically says "Compilation Error -- Unhandled Exception". If the code was running and failed to connect it would throw an exception like this:
new com.mongodb.Mongo("omg.ponies")
java.net.UnknownHostException: omg.ponies at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:850)
at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1201)
at java.net.InetAddress.getAllByName0(InetAddress.java:1154)
at java.net.InetAddress.getAllByName(InetAddress.java:1084)
at java.net.InetAddress.getAllByName(InetAddress.java:1020)
at com.mongodb.ServerAddress._getAddress(ServerAddress.java:176)
at com.mongodb.ServerAddress.<init>(ServerAddress.java:59)
at com.mongodb.ServerAddress.<init>(ServerAddress.java:38)
at com.mongodb.Mongo.<init>(Mongo.java:92)
--