osgi/osgi.enroute

Quickstart example fails to run

gerry-fisher opened this issue · 1 comments

Hello,

Followed the instructions as https://enroute.osgi.org/tutorial/020-tutorial_qs.html but the application fails to run:

➜ java -jar app/target/app.jar

I'm running openJDK 17.0.1 and Maven 3.8.5 on a CentOS 8 Platform and here are the console outputs:

➜ quickstart git:(main) java -version
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment 21.9 (build 17.0.1+12)
OpenJDK 64-Bit Server VM 21.9 (build 17.0.1+12, mixed mode, sharing)

➜ quickstart git:(main) mvn -version
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /usr/local/maven
Java version: 17.0.1, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-17-openjdk-17.0.1.0.12-3.rolling.el8.x86_64
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "4.18.0-348.2.1.el8_5.x86_64", arch: "amd64", family: "unix"

➜ quickstart git:(main) mvn verify
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] quickstart [pom]
[INFO] rest [jar]
[INFO] app [jar]
[INFO]
[INFO] ----------< org.osgi.enroute.examples.quickstart:quickstart >-----------
[INFO] Building quickstart 0.0.2-SNAPSHOT [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] -------------< org.osgi.enroute.examples.quickstart:rest >--------------
[INFO] Building rest 0.0.2-SNAPSHOT [2/3]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ rest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ rest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- bnd-maven-plugin:6.1.0:bnd-process (default) @ rest ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ rest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/developer/dev/osgi/osgi.enroute/examples/quickstart/rest/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ rest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ rest ---
[INFO] Surefire report directory: /home/developer/dev/osgi/osgi.enroute/examples/quickstart/rest/target/surefire-reports


T E S T S

Running org.osgi.enroute.examples.quickstart.rest.UpperTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ rest ---
[INFO] Building jar: /home/developer/dev/osgi/osgi.enroute/examples/quickstart/rest/target/rest-0.0.2-SNAPSHOT.jar
[INFO]
[INFO] --------------< org.osgi.enroute.examples.quickstart:app >--------------
[INFO] Building app 0.0.2-SNAPSHOT [3/3]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ app ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/developer/dev/osgi/osgi.enroute/examples/quickstart/app/target/classes
[INFO]
[INFO] --- bnd-maven-plugin:6.1.0:bnd-process (default) @ app ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/developer/dev/osgi/osgi.enroute/examples/quickstart/app/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ app ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ app ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ app ---
[INFO] Building jar: /home/developer/dev/osgi/osgi.enroute/examples/quickstart/app/target/app-0.0.2-SNAPSHOT.jar
[INFO]
[INFO] --- bnd-indexer-maven-plugin:6.1.0:index (index) @ app ---
[INFO] The configured deployment repository OSGi Snapshots has the same id as one of the remote artifact repositories. It is assumed that these repositories are the same.
[INFO]
[INFO] --- bnd-indexer-maven-plugin:6.1.0:index (test-index) @ app ---
[INFO] The configured deployment repository OSGi Snapshots has the same id as one of the remote artifact repositories. It is assumed that these repositories are the same.
[INFO]
[INFO] --- bnd-export-maven-plugin:6.1.0:export (default) @ app ---
[INFO] Exporting /home/developer/dev/osgi/osgi.enroute/examples/quickstart/app/app.bndrun:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for quickstart 0.0.2-SNAPSHOT:
[INFO]
[INFO] quickstart ......................................... SUCCESS [ 0.002 s]
[INFO] rest ............................................... SUCCESS [ 1.290 s]
[INFO] app ................................................ SUCCESS [ 1.819 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.206 s
[INFO] Finished at: 2022-04-25T00:05:49+01:00
[INFO] ------------------------------------------------------------------------

➜ quickstart git:(main) java -jar app/target/app.jar
! Failed to start bundle org.apache.aries.javax.jax.rs-api-1.0.4, exception Could not resolve module: org.apache.aries.javax.jax.rs-api [3]
Unresolved requirement: Import-Package: org.apache.geronimo.osgi.registry.api; resolution:="optional"
Unresolved requirement: Import-Package: javax.xml.bind.annotation

org.osgi.framework.BundleException: Could not resolve module: org.apache.aries.javax.jax.rs-api [3]
Unresolved requirement: Import-Package: org.apache.geronimo.osgi.registry.api; resolution:="optional"
Unresolved requirement: Import-Package: javax.xml.bind.annotation

at org.eclipse.osgi.container.Module.start(Module.java:463)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:439)
at aQute.launcher.Launcher.start(Launcher.java:686)
at aQute.launcher.Launcher.startBundles(Launcher.java:666)
at aQute.launcher.Launcher.activate(Launcher.java:572)
at aQute.launcher.Launcher.launch(Launcher.java:402)
at aQute.launcher.Launcher.run(Launcher.java:184)
at aQute.launcher.Launcher.main(Launcher.java:160)
at aQute.launcher.pre.EmbeddedLauncher.executeWithRunPath(EmbeddedLauncher.java:170)
at aQute.launcher.pre.EmbeddedLauncher.findAndExecute(EmbeddedLauncher.java:119)
at aQute.launcher.pre.EmbeddedLauncher.main(EmbeddedLauncher.java:52)

Thanks

For the benefit of anyone reading this issue, the example application will not run with Java 17. I changed to Java 1.8 and can confirm that the application runs correctly.