[JAVA-2161] com.mongodb.MongoSocketOpenException: Exception opening socket Created: 31/Mar/16 Updated: 11/Sep/19 Resolved: 01/Apr/16 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | 3.2.2 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Junwei Zhuge | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Mac osX, Heroku |
||
| Description |
|
I want to build a web application on Heroku, I can connect to mongodb, because I tried to create a collection in the Main.java, and it worked.
|
| Comments |
| Comment by Junwei Zhuge [ 01/Apr/16 ] |
|
Thank you very much. I have fixed this. It is because a thread is running on port 4567, which is the default port of Jettty. And I added this `port(Integer.valueOf(System.getenv("PORT")));` to make this project run on Port 5000, which is Heroku's port by default. I don't know much about this stuff, but it works. BTW, I also changed java-driver 3.2.2 to 2.7.2, it seems that there is something wrong with "DB", I can only use "MongoDatabase" instead of "DB", but using "MongoDatabase" is not a good idea for my project. |
| Comment by Ross Lawley [ 01/Apr/16 ] |
|
Just to let you know the JAVA project is specifically for driver based bugs or issues. For questions please use the mailing list or stackoverflow as you will reach and help the broader community. I'm closing this ticket but if you do post go on to post to the mailing list or stackoverflow please feel free to post a link in this ticket and I'll review there! Ross |
| Comment by mahdi mallaki [ 01/Apr/16 ] |
|
Is there a MongoDB running at the time when you see the error message? I think it is not a java driver bug! |