vaadin / vaadin-flow-karaf-example

An example project for an OSGi Vaadin app deployed on Karaf
The Unlicense
7 stars 5 forks source link

Regression: Project does not work in 23.2.3 but does in 23.2.0, osgi error #124

Closed manolo closed 1 year ago

manolo commented 2 years ago

This is an issue in 23.2.3 apparently at some point after 23.2.1

git clone https://github.com/vaadin/vaadin-flow-karaf-example.git
# check that pom.xml version is 23.2.3
cd vaadin-flow-karaf-example
mvn install
mvn -pl main-ui install -Prun

The error is

org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=main-ui; type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=main-ui)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))" [caused by: Unable to resolve main-ui/1.0.0.SNAPSHOT: missing requirement [main-ui/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=com.vaadin.flow.server; type=osgi.bundle; version="[23.2.3,23.2.3]"; resolution:=mandatory [caused by: Unable to resolve com.vaadin.flow.server/23.2.3: missing requirement [com.vaadin.flow.server/23.2.3] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.vaadin.pro.licensechecker)(version>=1.10.0)(!(version>=2.0.0)))"]]
    at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
    at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
    at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
    at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
    at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:256)
    at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
    at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
    at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve main-ui/1.0.0.SNAPSHOT: missing requirement [main-ui/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=com.vaadin.flow.server; type=osgi.bundle; version="[23.2.3,23.2.3]"; resolution:=mandatory [caused by: Unable to resolve com.vaadin.flow.server/23.2.3: missing requirement [com.vaadin.flow.server/23.2.3] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.vaadin.pro.licensechecker)(version>=1.10.0)(!(version>=2.0.0)))"]
    at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
    ... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve com.vaadin.flow.server/23.2.3: missing requirement [com.vaadin.flow.server/23.2.3] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.vaadin.pro.licensechecker)(version>=1.10.0)(!(version>=2.0.0)))"
    at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
    ... 13 more
manolo commented 2 years ago

This is BTW a regression since it works fine in 23.2.0

mvn -B -q versions:set-property -Dproperty=vaadin.version -DnewVersion=23.2.0
mvn clean install
mvn -pl main-ui install -Prun

And it runs fine

ZheSun88 commented 2 years ago

adding the license-checker dependency to the pom.xml under main-ui module can solve the issue. it looks the license-checker version is the cause..

       <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>license-checker</artifactId>
            <version>1.10.0</version>
        </dependency>
manolo commented 2 years ago

Customers should not add that dependency to their projects, it should come transitively somehow

manolo commented 2 years ago

23.2.1 works fine, in 23.2.2 there is no error, but a different problem in browser

HTTP ERROR 404 Not Found

URI: /
Status: 404
Message: Not Found
mcollovati commented 2 years ago

Issue with license-checker seems to be that vaadin osgi 8.0.2 references version 1.4.1

mcollovati commented 2 years ago

Also vaadin-dev-server has a different version of license-checker

NFO] com.example:main-ui:jar:1.0.0-SNAPSHOT
[INFO] +- com.vaadin:flow-osgi:jar:8.0.2:compile
[INFO] |  \- com.vaadin:license-checker:jar:1.9.0:compile (version managed from 1.4.1)
[INFO] \- com.vaadin:vaadin:jar:23.2.3:compile
[INFO]    \- com.vaadin:vaadin-core:jar:23.2.3:compile
[INFO]       \- com.vaadin:vaadin-dev-server:jar:23.2.3:compile
[INFO]          \- (com.vaadin:license-checker:jar:1.9.0:compile - version managed from 1.10.0; omitted for duplicate)
ZheSun88 commented 2 years ago

platform has just upgraded license-checker to 1.10.0. probably that is the place causing version difference.

MarcinVaadin commented 1 year ago

@manolo could you confirm is it still relevant?

manolo commented 1 year ago

not any more