[JAVA-3842] Mac os can connect to remotely Mongo 4.2.9 while Ubuntu can't Created: 14/Sep/20 Updated: 15/Sep/20 Resolved: 15/Sep/20 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Configuration |
| Affects Version/s: | 4.1.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Mohammad Amr | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Mac os -> Catalina 10.150.6 |
||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Documentation Changes: | Needed | ||||
| Description |
|
When I connect my Java Project using the below maven dependencies to Mongo 4.2.9 that was hosted remotely, If I'm using Macos, it will connects successfully.
When I was using Ubuntu, it will fail with the below exception:
But If I changed the dependencies to be like below:
It will fail to connect to Mongo 4.2.9 even on Mac or Ubuntu.
The error on Mac is:
while the error on Ubuntu is:
|
| Comments |
| Comment by Jeffrey Yemin [ 15/Sep/20 ] | ||||||||||||||||||||||
|
Glad you figured it out. | ||||||||||||||||||||||
| Comment by Mohammad Amr [ 15/Sep/20 ] | ||||||||||||||||||||||
|
Dears, the issue has been resolved, it's a mixture of having the valid dependency and removing all old versions from all libraries. Thanks alot for your efforts. I discovered that once I created the Minimal Reproducible project. Nice technique.
Issue closed.
| ||||||||||||||||||||||
| Comment by Mohammad Amr [ 15/Sep/20 ] | ||||||||||||||||||||||
|
@Jeffrey Yemin, I'm preparing this for you | ||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 15/Sep/20 ] | ||||||||||||||||||||||
|
I concur with cstrobl. We need a Minimal Reproducible Example in order to assist you further. | ||||||||||||||||||||||
| Comment by Mohammad Amr [ 15/Sep/20 ] | ||||||||||||||||||||||
|
I update my maven files to just contain these below dependencies that are relevant for mongo
The result, it works for Macos but not for ubuntu. with the same error shown here I'm working on your notes below: " Different OS are also likely to resolve dependencies and load classes in different order, so the issue might also be that there's an old version of the driver somewhere on the path that gets loaded on Ubuntu and not on MacOS. A Minimal Reproducible Example would help spot the issue." | ||||||||||||||||||||||
| Comment by Christoph Strobl [ 15/Sep/20 ] | ||||||||||||||||||||||
|
Spring Data MongoDB (sync) requires the following dependencies:
Please do not use mongodb-driver-legacy. Different OS are also likely to resolve dependencies and load classes in different order, so the issue might also be that there's an old version of the driver somewhere on the path that gets loaded on Ubuntu and not on MacOS. A Minimal Reproducible Example would help spot the issue. | ||||||||||||||||||||||
| Comment by Mohammad Amr [ 15/Sep/20 ] | ||||||||||||||||||||||
|
Even though I have used just
But unfortunately, still it's not working for ubuntu even if I have included some additional libraries like spring-commons. See | ||||||||||||||||||||||
| Comment by Mohammad Amr [ 15/Sep/20 ] | ||||||||||||||||||||||
|
I traced all libraries that should be there, I found that even I removed mongo-java-driver.3.12.7, the application will keep running on Macos but for ubuntu nothing changed.
This is the last configuration I made, it's working on Macos but doesn't on Ubuntu.
| ||||||||||||||||||||||
| Comment by Mohammad Amr [ 14/Sep/20 ] | ||||||||||||||||||||||
|
Dears, Let me update you about the MongoDB 4 upgrade that Pas 3.2.6 is fully I'm doing all that I can to solve this issue as soon as possible and I Action Plan:
On Tue, Sep 15, 2020 at 12:29 AM Jeffrey Yemin (Jira) <jira@mongodb.org> – ___ _ Mohammad Amr Sr.Software Engineer - Java/Python Address: Emaar Towers - Amman, Jordan. Mob: +962 7 8873 1763 www.baaz.com | ||||||||||||||||||||||
| Comment by Mohammad Amr [ 14/Sep/20 ] | ||||||||||||||||||||||
|
If I were only using Spring-Data Dependency as below:
my app would have connected to my localhost database not the remote one which means that it ignores all spring.xml entries I made.
It's so strange and I'm stuck here. Please advise me. | ||||||||||||||||||||||
| Comment by Mohammad Amr [ 14/Sep/20 ] | ||||||||||||||||||||||
|
If I were only using Spring-Data dependency, I would have received an exception like:
| ||||||||||||||||||||||
| Comment by Mohammad Amr [ 14/Sep/20 ] | ||||||||||||||||||||||
|
I'm just using these two lines:
It works for Macos, but not for Ubuntu. Note: JDK is 14 | ||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 14/Sep/20 ] | ||||||||||||||||||||||
|
Yes, that's what I mean. I'm surprised that depending just on spring-data-mongodb is not sufficient. | ||||||||||||||||||||||
| Comment by Mohammad Amr [ 14/Sep/20 ] | ||||||||||||||||||||||
|
Do you mean that only all what I have to use are these below:
I removed everything except these two lines above and still I have the same issue. It's working on Macos but on ubuntu it doesn't. | ||||||||||||||||||||||
| Comment by Mohammad Amr [ 14/Sep/20 ] | ||||||||||||||||||||||
|
I have this maven dependency somewhere
Do you mean this invalid !! | ||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 14/Sep/20 ] | ||||||||||||||||||||||
|
These were methods that were deprecated in a 3.x release of the driver and removed in 4.0.0. The only way I can see this happening is if somehow you are picking up a 3.x driver artifact. Can you check for that possibility? cstrobl any ideas on your end? |