[JAVA-2701] ClientMetadataHelper.getDriverVersion throws NullPointerException Created: 12/Dec/17 Updated: 28/Oct/23 Resolved: 18/Dec/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Wire Protocol |
| Affects Version/s: | 3.6.0 |
| Fix Version/s: | 3.6.1 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | akshay mendole | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
I am trying to run a topology code in storm that uses mongoclient. java.lang.NullPointerException Complete stack trace: |
| Comments |
| Comment by akshay mendole [ 26/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
Thanks a lot. This solved the issue. | |||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 20/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
You can find a snapshot build of 3.6.1 here. | |||||||||||||||||||||||||||||||||||||
| Comment by SANDEEP REDDY GUTHA [X] [ 20/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
Hi, I tired with below test but I am getting some errors can't succeeded Build!! Build $ git clone https://github.com/mongodb/mongo-java-driver.git :bson:check Clirr Report Please review C:\Users\Vinayaka\mongo-java-driver\driver\build\reports\clirr\compatibility-report.html for more information com.mongodb.AggregationOptionsSpecification com.mongodb.BasicDBObjectTest com.mongodb.ChangeStreamIterableSpecification | |||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}Message: | |||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}Message: | |||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 14/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
We haven't settled on a release date for 3.6.1 yet, but it's not imminent. You can reasonably expect it in mid-January. If you need something quicker, feel free to patch the driver yourself by adding a null check on the return value of java.util.jar.Manifest#getMainAttributes in ClientMetadataHelper.getDriverVersion. I suspect that will work around the issue. | |||||||||||||||||||||||||||||||||||||
| Comment by akshay mendole [ 14/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
Awesome. Any idea when this will be fixed and released. | |||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 14/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
Maybe, but not sure yet what to ask for. I'm running on OS X with a more recent 1.8 JDK, but otherwise I don't see any differences. But regardless, even without knowing the root cause the fix is obvious, so I'll add this to the 3.6.1 release. | |||||||||||||||||||||||||||||||||||||
| Comment by akshay mendole [ 14/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
Do you need more information for reproducing this? | |||||||||||||||||||||||||||||||||||||
| Comment by akshay mendole [ 13/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
I am running this on Linux platform with java build 1.8.0_25-b17. | |||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 13/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
Interesting, I run the same command with no error:
What's your Java version, and on what platform are you doing this? | |||||||||||||||||||||||||||||||||||||
| Comment by akshay mendole [ 13/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
Interestingly, the issue does not reproduce when I am trying to run this command locally (on my system) but does reproduce when I try to run the command on the cluster (prod environment). This is the output when I run the command in cluster mode.
| |||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 12/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
I attempted to reproduce this and got these results:
Can you suggest what might be different about my invocation? Can you include the full output of the command? | |||||||||||||||||||||||||||||||||||||
| Comment by akshay mendole [ 12/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
This time I wrote a simple main class that does not try to submit any topology to storm. In the previous case, storm would create its own jar and pack all the required classes in stormjar.jar, but now I have simply created a driver class that does nothing but initialised the mongo client. Exception in thread "main" java.lang.ExceptionInInitializerError I have also attached the jar for your reference | |||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 12/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
One of these two methods is returning null:
It looks like the Java driver is being vendored by Storm rather than deployed in its own jar file. Please either attach or let us know where we can download stormjar.jar (referenced in the stack trace above) so that we can investigate further. Update Code inspection reveals that java.util.jar.Manifest#getMainAttributes can never return null, so the only remaining culprit is java.net.JarURLConnection#getManifest | |||||||||||||||||||||||||||||||||||||
| Comment by akshay mendole [ 12/Dec/17 ] | |||||||||||||||||||||||||||||||||||||
|
I saw similar issue |