karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré ...@nanthrax.net>
Subject Re: [REMINDER] Avoid SNAPSHOT when possible
Date Thu, 05 Jul 2018 19:48:04 GMT
Hi Steinar,

you have to change your import package version range as Karaf 4.2.x now
use Pax Web 7.x.

Your import is:

org.ops4j.pax.web.service;version="[6.0,7)"

it should be:

org.ops4j.pax.web.service;version="[6,8)"

Regards
JB

On 05/07/2018 20:44, Steinar Bang wrote:
>>>>>> Jean-Baptiste Onofré <jb@nanthrax.net>:
> 
>> just a little reminder: when possible, please avoid to use SNAPSHOT in
>> dependency (or only on PR, not merged on master).
> 
>> SNAPSHOT dependencies breaks the build and so Karaf SNAPSHOTs are not
>> deployed anymore.
>> It also block release as we can't release project containing SNAPSHOT
>> dependencies.
> 
>> For instance, we did a commit on master this morning upgrading to
>> Easymock 3.7-SNAPSHOT (to be able to build with Java 10/11), and Jenkins
>> is broken (also local build).
> 
>> I will fix that, but, please, keep in mind to avoid SNAPSHOT
>> dependencies when possible.
> 
> Ah... I tried my app today for the first time on 4.2.0, specifically
> this branch (where all the current work takes place):
>  https://github.com/steinarb/ukelonn/tree/using-react
> 
> The app was built with karaf-maven-plugin 4.1.2, and pax exam karaf
> 4.1.2 integration tests, and running fine on 4.1.5.
> 
> But one of the bundles refused to load on karaf 4.2.0, complaining about
> a missing dependency that already was satisfied for another bundle.
> 
> I'm building with maven version 1.0.0-SNAPSHOT, so I'm wondering if that
> is the reason for the failure?
> 
> Here are the karaf console commads that led up to the error (requires
> cloning and building the above repo):
> 
> karaf@root()> feature:repo-add mvn:no.priv.bang.ukelonn/karaf/LATEST/xml/features
> Adding feature url mvn:no.priv.bang.ukelonn/karaf/LATEST/xml/features
> karaf@root()> feature:install ukelonn-db-derby-test
> karaf@root()> feature:install ukelonn
> org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement
[root] osgi.identity; osgi.identity=ukelonn; type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]";
filter:="(&(osgi.identity=ukelonn)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))"
[caused by: Unable to resolve ukelonn/1.0.0.SNAPSHOT: missing requirement [ukelonn/1.0.0.SNAPSHOT]
osgi.identity; osgi.identity=no.priv.bang.ukelonn; type=osgi.bundle; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]";
resolution:=mandatory [caused by: Unable to resolve no.priv.bang.ukelonn/1.0.0.SNAPSHOT: missing
requirement [no.priv.bang.ukelonn/1.0.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.ops4j.pax.web.service)(version>=6.0.0)(!(version>=7.0.0)))"]]
>         at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)
>         at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:391)
>         at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:377)
>         at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:331)
>         at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:248)
>         at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:388)
>         at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025)
>         at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at java.lang.Thread.run(Thread.java:748)
> Error executing command: Unable to resolve root: missing requirement [root] osgi.identity;
osgi.identity=ukelonn; type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=ukelonn)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))"
[caused by: Unable to resolve ukelonn/1.0.0.SNAPSHOT: missing requirement [ukelonn/1.0.0.SNAPSHOT]
osgi.identity; osgi.identity=no.priv.bang.ukelonn; type=osgi.bundle; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]";
resolution:=mandatory [caused by: Unable to resolve no.priv.bang.ukelonn/1.0.0.SNAPSHOT: missing
requirement [no.priv.bang.ukelonn/1.0.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.ops4j.pax.web.service)(version>=6.0.0)(!(version>=7.0.0)))"]]
> karaf@root()>
> 
> 
> The no.priv.bang.ukelonn package is exported by this bundle:
>  https://github.com/steinarb/ukelonn/tree/using-react/ukelonn.api
> 
> The package is exported with version 1.0.0, in the bundle's manifest.mf:
> 
> Export-Package: no.priv.bang.ukelonn;uses:="org.osgi.service.log";vers
>  ion="1.0.0"
> 
> 
> This bundle doesn't complain about a missing package
>  https://github.com/steinarb/ukelonn/tree/using-react/ukelonn.bundle.db.test
> 
> Here's the import in the bundle's manifest.mf:
> 
> Import-Package: javax.sql,liquibase;version="[3.5,4)",liquibase.change
>  log;version="[3.5,4)",liquibase.database;version="[3.5,4)",liquibase.
>  database.jvm;version="[3.5,4)",liquibase.resource;version="[3.5,4)",n
>  o.priv.bang.ukelonn;version="[1.0,2)",no.priv.bang.ukelonn.bundle.db.
>  liquibase;version="[1.0,2)",org.osgi.service.jdbc;version="[1.0,2)",o
>  rg.osgi.service.log;version="[1.3,2)"
> Provide-Capability: osgi.service;effective:=active;objectClass="no.pri
>  v.bang.ukelonn.UkelonnDatabase",osgi.service;objectClass:List<String>
>  ="no.priv.bang.ukelonn.UkelonnDatabase"
> 
> 
> Here's the bundle that fails to load:
>  https://github.com/steinarb/ukelonn/tree/using-react/ukelonn.bundle
> 
> Here's the import header of the failing bundle's manifest.mf:
> 
> Import-Package: no.priv.bang.ukelonn;version="[1.0,2)",javax.servlet;v
>  ersion="[2.5,4)",javax.servlet.http;version="[2.5,4)",com.fasterxml.j
>  ackson.databind;version="[2.8,3)",org.apache.karaf.shell.api.action;v
>  ersion="[4.1,5)",org.apache.karaf.shell.api.action.lifecycle;version=
>  "[4.1,5)",org.apache.shiro;version="[1.3,2)",org.apache.shiro.authc;v
>  ersion="[1.3,2)",org.apache.shiro.authc.credential;version="[1.3,2)",
>  org.apache.shiro.authz;version="[1.3,2)",org.apache.shiro.config;vers
>  ion="[1.3,2)",org.apache.shiro.crypto;version="[1.3,2)",org.apache.sh
>  iro.crypto.hash;version="[1.3,2)",org.apache.shiro.realm;version="[1.
>  3,2)",org.apache.shiro.subject;version="[1.3,2)",org.apache.shiro.uti
>  l;version="[1.3,2)",org.apache.shiro.web.config;version="[1.3,2)",org
>  .apache.shiro.web.filter.mgt;version="[1.3,2)",org.apache.shiro.web.m
>  gt;version="[1.3,2)",org.apache.shiro.web.servlet;version="[1.3,2)",o
>  rg.osgi.service.http.context;version="[1.0,2)",org.osgi.service.log;v
>  ersion="[1.3,2)",org.osgi.framework;version="[1.0.0,2.0.0)",org.osgi.
>  framework.wiring;version="[1.2,2)",org.osgi.service.http;version="[1.
>  0.0,2.0.0)",org.osgi.util.tracker;version="[1.5,2)",org.ops4j.pax.web
>  .service;version="[6.0,7)"
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Mime
View raw message