-
Notifications
You must be signed in to change notification settings - Fork 714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflicting javax.annotation version #451
Comments
Suppose so. Mind pinging someone who has been involved with OSGi related
work here (hint search issues or git history and you should find someone)
|
@adriancole the standard versions that are exported is javax.annotation;version="[1.1,2)" thats the case until JDK 9. So it it OK if I can send a PR with service mix bundle for JSR 305 which adds the right export? |
I'm not the best to decide.. please actively notify the person who setup OSGi. Probably @cschneider and/or @iocanel should be on-board with this, and if they are, I am :) |
I saw the question on stack overflow too. Will help to solve it. |
thanks @adriancole - no worries |
thanks @cschneider #452, thats the smallest of change i did and I see the deployment in to Karaf (Jboss Fuse 6.3) happening smoothly. Any thoughts ? |
@kameshsampath I was not yet able to reproduce the problem. I installed brave core 4.4.1-SNAPSHOT. |
did you try 4.4.0 @cschneider ? |
@cschneider - when I install 4.4.0 i got this error when deploying my feature bnd print -m ~/Downloads/brave-4.4.0.jar
|
I just also tried brave-core 4.4.0. It installed fine on karaf 4.1.1. I do no see any import of javax.annotation. |
@cschneider - you need to be on 2.4.0, which is part of JBoss Fuse 6.3 (https://developers.redhat.com/products/fuse/download/) and here the package exports
|
Ok .. now I got it .. I never installed the module brave .. only brave-core. |
but wondering why "annotations" need to be part of the exports as they are more compile time right ? but as I tried and part of my PR moving to servicemix bundle the problem went away |
jsr305 also causes problems on Java 9 if a project is also using jax-ws:
The problem is that both modules have a package called |
@raphw can we borrow an opinion on this one. We currently use the following for Nullable/ParametersAreNonnullByDefault There's definitely different, possibly valid, alternatives
|
I would suggest you to switch to compile-time only annotations and to not export the bundle. With these annotations being included in so many different packaging formats, they are more trouble than they are worth it. |
I would suggest you to switch to compile-time only annotations and to not
export the bundle. With these annotations being included in so many
different packaging formats, they are more trouble than they are worth it.
Funny, we used to do that, but some concerns about kotlin and intellij led
to a reverse to use standard ones...
|
What concerns did you have? I do not think that this information is normally useful at runtime. Unless you have a good use case, I recommend to get rid of it. |
What concerns did you have? I do not think that this information is
normally useful at runtime. Unless you have a good use case, I recommend to
get rid of it.
This was mainly for IDE code inspection, not particularly for runtime
inspection. Reasons enumerated by @swankjesse
https://medium.com/square-corner-blog/non-null-is-the-default-58ffc0bb9111
If we got rid of it, choices are to revert completely (ex remove all
annotations and replace with comments), make an internal nullable again
(source retention) and/or open an IDEA bug on how to achieve code
inspection without adding a runtime dep.
|
one reasonable option is to remove the nullable thing and punt to docs
both for zipkin and brave. Reason is that these aren't common-use
libraries such as an http library is. optimizing to not taint
classpath could outweigh benefits of null analysis for those
developing tracing libraries...
|
Meh cant simply yank.. need to keep or replace as autovalue reads these to construct null enforcing things |
Before, we optimized to drop our source-retention Nullable in favor of JSR 305. In doing so, we got null analysis from Intellij. However, in doing so, we entered a swamp of dependency conflicts, which started with OSGi (hence switch to service mix bundle) and now with Java 9 (conflict with apps using jax-ws. Since we are a core dependency, and particularly not a user-api, this change caused more problems than it fixed. Hence, this reverts to the safer model of using internal source-retention nullable (which allows things like AutoValue to work, but don't introduce any chance of runtime class conflicts). See #1703 See openzipkin/brave#451
starting to fix this here openzipkin/zipkin#1768 |
Before, we optimized to drop our source-retention Nullable in favor of JSR 305. In doing so, we got null analysis from Intellij. However, in doing so, we entered a swamp of dependency conflicts, which started with OSGi (hence switch to service mix bundle) and now with Java 9 (conflict with apps using jax-ws. Since we are a core dependency, and particularly not a user-api, this change caused more problems than it fixed. Hence, this reverts to the safer model of using internal source-retention nullable (which allows things like AutoValue to work, but don't introduce any chance of runtime class conflicts). See openzipkin/brave#451
openzipkin/zipkin-reporter-java#73 for reporter 2.x |
here's the one here (needs a dependency update) #517 |
Before, we optimized to drop our source-retention Nullable in favor of JSR 305. In doing so, we got null analysis from Intellij. However, in doing so, we entered a swamp of dependency conflicts, which started with OSGi (hence switch to service mix bundle) and now with Java 9 (conflict with apps using jax-ws. Since we are a core dependency, and particularly not a user-api, this change caused more problems than it fixed. Hence, this reverts to the safer model of using internal source-retention nullable (which allows things like AutoValue to work, but don't introduce any chance of runtime class conflicts). See #1703 See openzipkin/brave#451
…a 9 (#73) Before, we optimized to drop our source-retention Nullable in favor of JSR 305. In doing so, we got null analysis from Intellij. However, in doing so, we entered a swamp of dependency conflicts, which started with OSGi (hence switch to service mix bundle) and now with Java 9 (conflict with apps using jax-ws. Since we are a core dependency, and particularly not a user-api, this change caused more problems than it fixed. Hence, this reverts to the safer model of using internal source-retention nullable (which allows things like AutoValue to work, but don't introduce any chance of runtime class conflicts). See openzipkin/brave#451
Before, we optimized to drop our source-retention Nullable in favor of JSR 305. In doing so, we got null analysis from Intellij. However, in doing so, we entered a swamp of dependency conflicts, which started with OSGi (hence switch to service mix bundle) and now with Java 9 (conflict with apps using jax-ws. Since we are a core dependency, and particularly not a user-api, this change caused more problems than it fixed. Hence, this reverts to the safer model of using internal source-retention nullable (which allows things like AutoValue to work, but don't introduce any chance of runtime class conflicts). See #1703 See openzipkin/brave#451
Before, we optimized to drop our source-retention Nullable in favor of JSR 305. In doing so, we got null analysis from Intellij. However, in doing so, we entered a swamp of dependency conflicts, which started with OSGi (hence switch to service mix bundle) and now with Java 9 (conflict with apps using jax-ws. Since we are a core dependency, and particularly not a user-api, this change caused more problems than it fixed. Hence, this reverts to the safer model of using internal source-retention nullable (which allows things like AutoValue to work, but don't introduce any chance of runtime class conflicts). See openzipkin#1703 See openzipkin/brave#451
In relation to the question posted here https://stackoverflow.com/questions/44878002/jsr305-osgi-exports-brave, its observed that brave bundler adds the following export version of the package
javax.annotation;version='[3.0.0,4)'
which causes conflict with most of the OSGi containers - currently using brave with JBoss Fuse 6.3 which has karaf container 2.4.x. After some analaysis i found that the dependency:was adding the
Export-Package
header withjavax.annotation;version='[3.0.0,4)'
.I tried to change the dependency to a servicemix bundle,
Then I saw the header to be
Export-Package
header withjavax.annotation;version="[1.1,2)"
, which is available in most of the containers and brave bundle gets wired properly.Is it possible to update the JSR305 to servicemix dependency bundle ?
What kind of issue is this?
get fixed and stay fixed. If you have a solution in mind, skip raising an issue and open a
pull request instead.
The text was updated successfully, but these errors were encountered: