eclipse-osgi-technology / osgi.enroute

The OSGi enRoute project provides a programming model of OSGi applications. This project contains bundles providing the API for the OSGi enRoute base profile and bundles for the OSGi enRoute project. The base profile establishes a runtime that contains a minimal set of services that can be used as a base for applications.
https://enroute.osgi.org/
Apache License 2.0
126 stars 81 forks source link

Microservice example in Adobe experience manager #123

Open mkovacek opened 4 years ago

mkovacek commented 4 years ago

Hi,

a question, which dependencies I should use to be able to use OSGi R7 JAX RS in AEM? I would like to try out this example https://enroute.osgi.org/examples/020-examples-microservice.html

I tried with

org.osgi:osgi.core 7.0.0 org.osgi:osgi.cmpn 7.0.0 org.osgi:osgi.annotation 7.0.0 org.osgi:org.osgi.service.component.annotations 1.4.0 org.osg:org.osgi.service.metatype.annotations 1.4.0 org.osgi.service.component:1.4.0 javax.ws.rs: javax.ws.rs-api 2.1.1

also this combination org.osgi.enroute:osgi-api 7.0.0 org.osgi.enroute:enterprise-api 7.0.0 javax.ws.rs: javax.ws.rs-api 2.1.1

Is it javax.ws.rs code wrapped in some of OSGi dependency or should be added as a separated dependency? When I add it as separated dep. then can't be resolved

mkovacek commented 4 years ago

Some progress when I added org.apache.aries.javax.jax.rs-api

            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>osgi.core</artifactId>
                <version>7.0.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>osgi.cmpn</artifactId>
                <version>7.0.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>osgi.annotation</artifactId>
                <version>7.0.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.service.component.annotations</artifactId>
                <version>1.4.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.service.metatype.annotations</artifactId>
                <version>1.4.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.service.component</artifactId>
                <version>1.4.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.aries.spec</groupId>
                <artifactId>org.apache.aries.javax.jax.rs-api</artifactId>
                <version>1.0.4</version>
                <scope>provided</scope>
            </dependency>

But my bundle can't be started cause of (osgi.implementation=osgi.jaxrs)(version>=1.0.0)(!(version>=2.0.0)))

Cannot start (org.osgi.framework.BundleException: Unable to resolve com.aem.demo.core [603](R 603.11): missing requirement [com.aem.demo.core [603](R 603.11)] osgi.implementation; (&(osgi.implementation=osgi.jaxrs)(version>=1.0.0)(!(version>=2.0.0))) Unresolved requirements: [[com.aem.demo.core [603](R 603.11)] osgi.implementation; (&(osgi.implementation=osgi.jaxrs)(version>=1.0.0)(!(version>=2.0.0)))])
org.osgi.framework.BundleException: Unable to resolve com.aem.demo.core [603](R 603.11): missing requirement [com.aem.demo.core [603](R 603.11)] osgi.implementation; (&(osgi.implementation=osgi.jaxrs)(version>=1.0.0)(!(version>=2.0.0))) Unresolved requirements: [[com.aem.demo.core [603](R 603.11)] osgi.implementation; (&(osgi.implementation=osgi.jaxrs)(version>=1.0.0)(!(version>=2.0.0)))]