[JAVA-4505] org.mongodb.driver-core-4.5.0 requires javax.annotation.meta but it could not be found Created: 19/Feb/22 Updated: 28/Oct/23 Resolved: 17/Mar/22 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Packaging |
| Affects Version/s: | 4.5.0 |
| Fix Version/s: | 4.5.1 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Donald Duck | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | external-user | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Not Needed |
| Description |
|
When I upgrade my OSGi target platform so it uses the 4.5.0 Java driver JARs, I get |
| Comments |
| Comment by Jeffrey Yemin [ 23/Mar/22 ] |
|
FYI, 4.5.1 has been released with a fix for this issue. |
| Comment by Donald Duck [ 17/Mar/22 ] |
|
Thx |
| Comment by Githook User [ 17/Mar/22 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Exclude javax.annotation.* from OSGi imports (#895)
|
| Comment by Githook User [ 17/Mar/22 ] |
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Exclude javax.annotation.* from OSGi imports (#895)
|
| Comment by Donald Duck [ 08/Mar/22 ] |
|
java.lang.NullPointerException: while trying to invoke the method java.lang.Object.getClass() of a null object loaded from local variable 'value' The "value" parameter in the DocumentCodec.writeValue(BdonWriter, EncoderContext, Object) method is: ]} |
| Comment by Jeffrey Yemin [ 07/Mar/22 ] |
|
Thanks for the update. Would you mind posting the NPE that you encountered? It's not ringing any bells. |
| Comment by Donald Duck [ 07/Mar/22 ] |
|
Yes, adding the jsr305 jar to our target platform allows us to proceed for now. As usual for many JARs, that JAR from Maven central needs manifest patching to make it into an OSGi bundle. Then, after being able to build again a few tests failed, based on BsonArray instances with null value which seem to have passed through storing without problems in the old version of the driver but now cause an NPE, but that was an easy fix, and I saw that at least the BsonArray constructor with a values array has ever since demanded non-null values only. (Nota bene: throwing an NPE in the BsonArray.add(BsonValue) method would help catch the root cause of such problems with more confidence, I think.) |
| Comment by Jeffrey Yemin [ 07/Mar/22 ] |
|
mongo@homemp3.dyndns.org were you able to work around this or are you blocked from upgrading? |
| Comment by Jeffrey Yemin [ 28/Feb/22 ] |
|
Ah, that makes more sense now. I looked at the 4.3.1 MANIFEST.MF and javax.annotation doesn't appear at all, but in 4.4.0 it does. Looking at the changes in 4.4.0, As a workaround, can you take a dependency on com.google.code.findbugs:jsr305:1.3.9 while we investigate a fix? |
| Comment by Donald Duck [ 28/Feb/22 ] |
|
Sorry, I double-checked, and so far we are using 4.3.1 |
| Comment by Donald Duck [ 28/Feb/22 ] |
|
From 4.4 |
| Comment by Jeffrey Yemin [ 28/Feb/22 ] |
|
The driver takes a compile-only dependency on com.google.code.findbugs:jsr305:1.3.9, which is where the driver finds the javax.annotation.meta classes. I'm not sure why this results an an entry in Import-Package in the manifest, but it's been there for a while. What driver release are you upgrading from? |
| Comment by Donald Duck [ 28/Feb/22 ] |
|
I can't get a Tycho build running with a dependency to this Jar with Java8 because the javax.annotation.meta package cannot be resolved. It is a mandatory dependency of the mongodb jar and I wonder where to satisfy it from under Java8. |
| Comment by Jeffrey Yemin [ 28/Feb/22 ] |
|
mongo@homemp3.dyndns.org, the dependency still exists, as a result of this commit. And I still see it listed in the 4.5 manifest for driver-core. So I'm not sure what the issue is yet. Do you see any issues with the manifest? |
| Comment by Esha Bhargava [ 22/Feb/22 ] |
|
mongo@homemp3.dyndns.org Thank you for reporting this issue! We'll look into it and get back to you soon. |