[JAVA-2494] Connection failure from Android Created: 18/Apr/17 Updated: 29/Oct/23 Resolved: 25/Apr/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | 3.4.2 |
| Fix Version/s: | 3.4.3, 3.5.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Simon | Assignee: | Ross Lawley |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Android 5.0 |
||
| Issue Links: |
|
||||||||
| Description |
|
Java driver 3.3.0 works fine and I tried updating to 3.4.2 but the app crashes with the following exception: java.lang.ExceptionInInitializerError Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.security.CodeSource java.security.ProtectionDomain.getCodeSource()' on a null object reference |
| Comments |
| Comment by Githook User [ 25/Apr/17 ] |
|
Author: {u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}Message: Don't trust the JVM to yield the code source path
|
| Comment by Githook User [ 25/Apr/17 ] |
|
Author: {u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}Message: Don't trust the JVM to yield the code source path
|
| Comment by Ross Lawley [ 25/Apr/17 ] |
| Comment by Jeffrey Yemin [ 18/Apr/17 ] |
|
In this case it's Class#getProtectionDomain that is returning null rather than ProtectionDomain#getCodeSource, so one step earlier in the call chain. |
| Comment by Simon [ 18/Apr/17 ] |
|
I tried the latest snapshot version and it does not fix the problem :/ I understand that it is harder to support Android but I think there are great use cases for mongo on Android (we use it for our storemen to control the warehouse system). Until now every Mongo Java Diver version supported Android. It would be very sad if the platform was dropped now :/ Thanks, Simon |
| Comment by Ross Lawley [ 18/Apr/17 ] |
|
Marking the NPE as fixed. Regarding Android support, the Mongo Java Driver doesn't aim to support Android. This is due to limitations with the Android JRE, where some classes that are used by the driver aren't available. One such example is SCRAM-SHA1 authentication. Ross |
| Comment by Ross Lawley [ 18/Apr/17 ] |
|
I believe this is a duplicate of Until the release snapshots are available from Sonatype. Could you confirm the fix with the latest snapshot? |