Hi Richard,

It seems that vaadin.annotations bundle is just wrong as it exports 
javax.annotation whereas it should not.

You have basically three options:
1. Fix vaadin.annotations ;)
2. Wrap vaadin.annotations to remove the “bad” export
3. Don’t use six annotation-api-1.3 and use vaadin.annotations instead but it 
means changing the core features

Regards
JB

> Le 28 sept. 2021 à 17:27, Richard Hierlmeier <[email protected]> a 
> écrit :
> 
> 
> After upgrading  the Vaadin OSGI demo to VAADIN 8.14.0 it tried
> to integrate a jax-rs resource into this application.
> 
> I used the rest whiteboard examples from the Karaf 4.3.3 distribution. It 
> worked in a first step fine.
> 
> Finally I tried to implement a JAX-RS authentication filter for this 
> application.
> 
> I implemented this class: 
> https://github.com/rhierlmeier/vaadin8_karaf_demo/blob/jaxrs-integration/src/main/java/de/rhierlmeier/vaadin8osgi/rest/AuthenticationFilter.java
> 
> I needs the javax.annotation.Priority annotation.
> 
> When I start now the bundle, I get following error:
> 
> Error executing command: Error executing command on bundles:
>         Error starting bundle 148: Uses constraint violation. Unable to 
> resolve resource de.rhierlmeier.vaadin8osgi [de.rhierlmeier.vaadin8osgi 
> [148](R 148.2)] because it is exposed to package 'javax.annotation' from 
> resources org.apache.servicemix.specs.annotation-api-1.3 
> [org.apache.servicemix.specs.annotation-api-1.3 [164](R 164.0)] and 
> org.apache.felix.framework [org.apache.felix.framework [0](R 0)] via two 
> dependency chains.
> 
> Chain 1:
>   de.rhierlmeier.vaadin8osgi [de.rhierlmeier.vaadin8osgi [148](R 148.2)]
>     import: 
> (&(osgi.wiring.package=javax.annotation)(version>=1.3.0)(!(version>=2.0.0)))
>      |
>     export: osgi.wiring.package: javax.annotation
>   org.apache.servicemix.specs.annotation-api-1.3 
> [org.apache.servicemix.specs.annotation-api-1.3 [164](R 164.0)]
> 
> Chain 2:
>   de.rhierlmeier.vaadin8osgi [de.rhierlmeier.vaadin8osgi [148](R 148.2)]
>     import: 
> (&(osgi.wiring.package=com.vaadin.annotations)(version>=8.14.0)(!(version>=9.0.0)))
>      |
>     export: osgi.wiring.package=com.vaadin.annotations; 
> uses:=org.atmosphere.cpr
>   com.vaadin.server [com.vaadin.server [145](R 145.0)]
>     import: 
> (&(osgi.wiring.package=org.atmosphere.cpr)(version>=2.4.30.vaadin4))
>      |
>     export: osgi.wiring.package=org.atmosphere.cpr; uses:=javax.annotation
>   com.vaadin.external.atmosphere.runtime 
> [com.vaadin.external.atmosphere.runtime [141](R 141.0)]
>     import: (osgi.wiring.package=javax.annotation)
>      |
>     export: osgi.wiring.package: javax.annotation
>   org.apache.felix.framework [org.apache.felix.framework [0](R 0)] Unresolved 
> requirements: [[de.rhierlmeier.vaadin8osgi [148](R 148.2)] 
> osgi.wiring.package; 
> (&(osgi.wiring.package=com.vaadin.annotations)(version>=8.14.0)(!(version>=9.0.0)))]
> 
> How can I solve this problem?
> 
> This problem can be reproduced by building and installing this branch:
> 
> https://github.com/rhierlmeier/vaadin8_karaf_demo/tree/jaxrs-integration
> 
> Regards 
> 
>   Richard

Reply via email to