-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.4.0
-
Component/s: Monitoring
-
None
-
Environment:java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode, sharing)
Java Driver throws NPE in:
at com.mongodb.connection.ClientMetadataHelper.getDriverVersion(ClientMetadataHelper.java:113) at com.mongodb.connection.ClientMetadataHelper.getDriverInformation(ClientMetadataHelper.java:201) at com.mongodb.connection.ClientMetadataHelper.addDriverInformation(ClientMetadataHelper.java:182) at com.mongodb.connection.ClientMetadataHelper.<clinit>(ClientMetadataHelper.java:64)
We are running the driver in environment where
InternalStreamConnectionInitializer.class.getProtectionDomain().getCodeSource().getLocation()
returns null (some strange classloader)
and it throws in NPE here:
String path = codeSource.getLocation().getPath();
It would be better to check it for nullness and for example set driverVersion = "unknown" (as it is being done in case of other errors).
- duplicates
-
JAVA-2494 Connection failure from Android
- Closed