[Solved] could not open inputstream for https://downloads.mongodb.org/win32/mongodb-win32-x86_64-3.5.5.zip
Table of Contents
What this error says / means:
This is trying to download the embed mongodb server which requires basically for integration behavioural testing using frameworks like cucumber.
But now this is not able to pull the embedded mongodb from the above exception reported url (https://downloads.mongodb.org/win32/mongodb-win32-x86_64-3.5.5.zip) and throws the socket connection timeout exception.
The possible root cause for these are:
- Firewall is blocking this url for downloads
- you may be having temporary internet connectivity issues(if you are keep on getting the same exception even after trying few times, then this wont be the case for you)
Download Embed Mongo:
Link to download Embed Mongo (Download as per the exception / your need)
Time for the solution:
Before spring boot application tries to download the mongodb embed server, first it will check the same in your below windows path.
Windows Path:
C:\users\<YOUR_USER_NAME>\.embeddedmongo\win32\mongodb-win32-x86-3.5.5.zip (or) C:\users\<YOUR_USER_NAME>\.embedmongo\win32\mongodb-win32-x86-3.5.5.zip
Linux Path:
$HOME/.embeddedmongo/linux/mongodb-linux-x86_64-3.5.5.zip (or) $HOME/.embedmongo/linux/mongodb-linux-x86_64-3.5.5.zip
Since you are running it first time in your machine and not able to download the zip this folder will not exist or only the folder alone be exist. So download the zip folder whatever is reported in the exception and just place it in above folder structure in your windows machine.
After placing the same it will create one more folder called extracted inside win32 and does something which we dont want to care about.
Once you are able to see the extracted folders in the above win32 folders then you are good with the embed mongodb connections.
Important Note:
If you would like to have another embed mongo version than it is reported in the exception then you have to add the required version with ths property in your application.yaml or application.properties file
spring.mongodb.embedded.version=3.6.9
It is not mandatory to maintain both the directory structure, for some version it was “.embeddedmongo” and for few it was “.embedmongo”. so check and add in any one structure as per you embed mongodb server expectations.
Just an another simple hint,
you wont be able to create any folder with “.”(dot) in front throught file manager in windows, so plan to create the same with command prompt
mkdir .embedmongo
In some cases you may be getting the similar exception for one more package “mongodb-win32-x86_64-2008plus-ssl-4.0.2.zip” and if so, then repeat the same for this as well meaning just copy paste this zip file also inside the above folder structure, then you are good to proceed with your test cases!
I had to save mongodb-win32-x86_64-2008plus-ssl-3.0.15.zip as mongodb-win32-x86_64-3.0.15.zip in the .embedmongo\win32\ directory and flapdoodle was finally able to find it. Flapdoodle’s proxy support doesn’t meet minimum industry standards.