[JAVA-3660] Mongo Driver Socket Connect Exception Created: 12/Mar/20 Updated: 27/Oct/23 Resolved: 12/Mar/20 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | 3.6.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Vijay Babu Batta | Assignee: | Ross Lawley |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux, Mongo Driver version 3.6.2. |
||
| Attachments: |
|
| Description |
|
Hello, When we are creating a MongoClient using the uir, even if the connection is unsuccessful, system is not throwing out the error, however in the log file, it will show the error message as below. I am attaching the file that I have tested with.
Mar 12, 2020 1:24:12 PM com.mongodb.diagnostics.logging.JULLogger log
|
| Comments |
| Comment by Vijay Babu Batta [ 12/Mar/20 ] |
|
Hi Ross, Thank you very much for clarifying. We will see if we can trigger some dummy command and test then. Appreciate your help.
|
| Comment by Ross Lawley [ 12/Mar/20 ] |
|
Hi vijaybabu.batta@sirmaindia.com, That's also to be expected as the driver uses a connection pool in the background and its the monitor thread that is throwing an exception. You would only see an error in your application when calling a command. All the best, Ross |
| Comment by Vijay Babu Batta [ 12/Mar/20 ] |
|
Hi Ross, Thank you for your quick response. My query is related to the issue only. Apologies for not elaborating clearly. I have given localhost1 intentionally so that connection fails. However, in my code, is continues without going into the exception block. After a bit of study, what i have found was that, inside mongo driver code, it is logging the error to the console which is what i have pasted above, but it will not return the error outside. Here, my motive behind this is, If connection is not established to the server, I should know immediately in the code which is not happening. Looking forward for your help. PS: Thank you on pointing me to the community.
|
| Comment by Ross Lawley [ 12/Mar/20 ] |
|
Hi vijaybabu.batta@sirmaindia.com, Please check the cause of the exception: Caused by: java.net.UnknownHostException: localhost1: No address associated with hostname. The error indicates that there is no IP address associated with the host localhost1. I imagine its a typo and the host should be localhost. Just to let you know for future reference, this project is for Java driver bugs or feature requests. The best place for questions regarding MongoDB usage or the Java driver specifics is the mongodb community forum as you will reach a broader audience there. If your business requires an answer from MongoDB within a time frame then we do offer production support. All the best, Ross |