Re: Feature verify error with Karaf 4.2.2

2019-01-03 Thread Jean-Baptiste Onofré
Let me take a look but it sounds weird to me.

Regards
JB

On 03/01/2019 09:42, Matteo Rulli wrote:
> Hello!
> 
> I tried the same verify step on the Karaf 4.2.3-SNAPSHOT version and I
> get the same error. Thus I modified
> the 
> /features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
> class as follows:
> 
> diff --git
> a/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
> b/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
> index f2eb18f00a..ac43a72ea1 100644
> ---
> a/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
> +++
> b/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
> @@ -767,7 +767,11 @@ public class Deployer {
>                  Deployer.RegionDeployment regionDeployment =
> entry.getValue();
>                  for (Bundle bundle : regionDeployment.toDelete) {
>                      print("  " + bundle.getSymbolicName() + "/" +
> bundle.getVersion(), verbose);
> -                    callback.uninstall(bundle);
> +                    try {
> +                    callback.uninstall(bundle);
> +                    } catch(Exception e) { 
> +                    print("   Cannot uninstall " +
> bundle.getSymbolicName() + "/" + bundle.getVersion(), verbose);
> +                    }
>                      removeFromMapSet(managedBundles, name,
> bundle.getBundleId());
>                  }
>              }
> 
> and as a result the feature verify completes successfully. From what I
> see, the Deployer is trying to uninstall the “system folder”
> bundle org.apache.servicemix.specs.activation-api-1.1/2.5.0 which is
> something odd, isn’t it?
> 
> What do you think?
> 
> Thanks,
> Matteo
> 
>> On 28 Dec 2018, at 12:30, Matteo Rulli > > wrote:
>>
>> Hi,
>>
>> The full error trace is below. If I read it properly, the
>> UnsupportedOperationException is triggered by
>> the org.apache.karaf.features.internal.service.StaticInstallSupport.uninstall
>> method.
>>
>> BTW, even if I get rid of effective:=active in
>> the  directives the error still happens.
>>
>> Thank you for your help with this, I really cannot understand what is
>> going on here…
>>
>> Matteo
>>
>> [DEBUG] Selected bundles
>> [org.apache.servicemix.specs.activation-api-1.1/2.5.0] for destroy (no
>> services in use)
>> [WARNING] 
>> org.apache.maven.plugin.MojoExecutionException: Feature resolution
>> failed for [flairkit-devman-aws-rest/1.1.0.SNAPSHOT]
>> Message: java.lang.UnsupportedOperationException
>> Repositories: {
>> file:/Users/matteorulli/git/flairbit/iot/flairkit-develop/device.management/device.management.feature/target/classes/feature.xml
>> mvn:com.flairbit.iot.security.x509/security.x509.feature/1.1.0-SNAPSHOT/xml/features
>> mvn:com.flairbit.iot.support/resolver.awsiot.feature/1.3.0/xml/features
>> mvn:com.flairbit.iot/features.devicehub/1.1.0-SNAPSHOT/xml/features
>> mvn:com.flairbit.iot/features.oauth/1.1.0-SNAPSHOT/xml/features
>> mvn:com.flairbit.iot/features/1.1.0-SNAPSHOT/xml/features
>> mvn:org.apache.aries.jpa/jpa-features/2.7.0/xml/features
>> mvn:org.apache.cxf.karaf/apache-cxf/3.1.12/xml/features
>> mvn:org.apache.karaf.features/enterprise/4.2.2/xml/features
>> mvn:org.apache.karaf.features/framework/4.2.2/xml/features
>> mvn:org.apache.karaf.features/standard/4.2.2/xml/features
>> mvn:org.apache.openjpa/openjpa-features/3.0.0/xml/features
>> mvn:org.hibernate.validator/hibernate-validator-osgi-karaf-features/6.0.13.Final/xml/features
>> mvn:org.hibernate/hibernate-osgi/5.2.9.Final/xml/karaf
>> mvn:org.ops4j.pax.cdi/pax-cdi-features/1.0.0/xml/features
>> mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.3.1/xml/features
>> mvn:org.ops4j.pax.jms/pax-jms-features/1.0.2/xml/features
>> mvn:org.ops4j.pax.transx/pax-transx-features/0.3.0/xml/features
>> mvn:org.ops4j.pax.transx/pax-transx-features/0.4.0/xml/features
>> mvn:org.ops4j.pax.web/pax-web-features/7.2.5/xml/features
>> }
>> Resources: {
>> mvn:com.amazonaws/aws-java-sdk-osgi/1.11.354
>> mvn:com.fasterxml.jackson.core/jackson-annotations/2.8.6
>> mvn:com.fasterxml.jackson.core/jackson-core/2.8.6
>> mvn:com.fasterxml.jackson.core/jackson-databind/2.8.6
>> mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/2.6.7
>> mvn:com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.8.6
>> mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.8.6
>> mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.8.6
>> mvn:com.flairbit.iot.core/core.paging/1.1.0-SNAPSHOT
>> mvn:com.flairbit.iot.devman.rest/device.management.rest.impl/1.1.0-SNAPSHOT
>> mvn:com.flairbit.iot.devman/device.management.api/1.1.0-SNAPSHOT
>> mvn:com.flairbit.iot.security.x509/security.x509.api/1.1.0-SNAPSHOT
>> mvn:com.flairbit.iot.security.x509/security.x509.impl/1.1.0-SNAPSHOT
>> mvn:com.flairbit.iot.support/flairkit.sc.servlet/1.1.0-SNAPSHOT
>> mvn:com.flairbit.iot/com.flairbit.access.authe

Re: Feature verify error with Karaf 4.2.2

2019-01-03 Thread Jean-Baptiste Onofré
Hi Matteo,

any chance to share with me your features XML and the pom ?

I'm not able to reproduce the issue for now.

Regards
JB

On 03/01/2019 09:42, Matteo Rulli wrote:
> Hello!
> 
> I tried the same verify step on the Karaf 4.2.3-SNAPSHOT version and I
> get the same error. Thus I modified
> the 
> /features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
> class as follows:
> 
> diff --git
> a/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
> b/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
> index f2eb18f00a..ac43a72ea1 100644
> ---
> a/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
> +++
> b/features/core/src/main/java/org/apache/karaf/features/internal/service/Deployer.java
> @@ -767,7 +767,11 @@ public class Deployer {
>                  Deployer.RegionDeployment regionDeployment =
> entry.getValue();
>                  for (Bundle bundle : regionDeployment.toDelete) {
>                      print("  " + bundle.getSymbolicName() + "/" +
> bundle.getVersion(), verbose);
> -                    callback.uninstall(bundle);
> +                    try {
> +                    callback.uninstall(bundle);
> +                    } catch(Exception e) { 
> +                    print("   Cannot uninstall " +
> bundle.getSymbolicName() + "/" + bundle.getVersion(), verbose);
> +                    }
>                      removeFromMapSet(managedBundles, name,
> bundle.getBundleId());
>                  }
>              }
> 
> and as a result the feature verify completes successfully. From what I
> see, the Deployer is trying to uninstall the “system folder”
> bundle org.apache.servicemix.specs.activation-api-1.1/2.5.0 which is
> something odd, isn’t it?
> 
> What do you think?
> 
> Thanks,
> Matteo
> 
>> On 28 Dec 2018, at 12:30, Matteo Rulli > > wrote:
>>
>> Hi,
>>
>> The full error trace is below. If I read it properly, the
>> UnsupportedOperationException is triggered by
>> the org.apache.karaf.features.internal.service.StaticInstallSupport.uninstall
>> method.
>>
>> BTW, even if I get rid of effective:=active in
>> the  directives the error still happens.
>>
>> Thank you for your help with this, I really cannot understand what is
>> going on here…
>>
>> Matteo
>>
>> [DEBUG] Selected bundles
>> [org.apache.servicemix.specs.activation-api-1.1/2.5.0] for destroy (no
>> services in use)
>> [WARNING] 
>> org.apache.maven.plugin.MojoExecutionException: Feature resolution
>> failed for [flairkit-devman-aws-rest/1.1.0.SNAPSHOT]
>> Message: java.lang.UnsupportedOperationException
>> Repositories: {
>> file:/Users/matteorulli/git/flairbit/iot/flairkit-develop/device.management/device.management.feature/target/classes/feature.xml
>> mvn:com.flairbit.iot.security.x509/security.x509.feature/1.1.0-SNAPSHOT/xml/features
>> mvn:com.flairbit.iot.support/resolver.awsiot.feature/1.3.0/xml/features
>> mvn:com.flairbit.iot/features.devicehub/1.1.0-SNAPSHOT/xml/features
>> mvn:com.flairbit.iot/features.oauth/1.1.0-SNAPSHOT/xml/features
>> mvn:com.flairbit.iot/features/1.1.0-SNAPSHOT/xml/features
>> mvn:org.apache.aries.jpa/jpa-features/2.7.0/xml/features
>> mvn:org.apache.cxf.karaf/apache-cxf/3.1.12/xml/features
>> mvn:org.apache.karaf.features/enterprise/4.2.2/xml/features
>> mvn:org.apache.karaf.features/framework/4.2.2/xml/features
>> mvn:org.apache.karaf.features/standard/4.2.2/xml/features
>> mvn:org.apache.openjpa/openjpa-features/3.0.0/xml/features
>> mvn:org.hibernate.validator/hibernate-validator-osgi-karaf-features/6.0.13.Final/xml/features
>> mvn:org.hibernate/hibernate-osgi/5.2.9.Final/xml/karaf
>> mvn:org.ops4j.pax.cdi/pax-cdi-features/1.0.0/xml/features
>> mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.3.1/xml/features
>> mvn:org.ops4j.pax.jms/pax-jms-features/1.0.2/xml/features
>> mvn:org.ops4j.pax.transx/pax-transx-features/0.3.0/xml/features
>> mvn:org.ops4j.pax.transx/pax-transx-features/0.4.0/xml/features
>> mvn:org.ops4j.pax.web/pax-web-features/7.2.5/xml/features
>> }
>> Resources: {
>> mvn:com.amazonaws/aws-java-sdk-osgi/1.11.354
>> mvn:com.fasterxml.jackson.core/jackson-annotations/2.8.6
>> mvn:com.fasterxml.jackson.core/jackson-core/2.8.6
>> mvn:com.fasterxml.jackson.core/jackson-databind/2.8.6
>> mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/2.6.7
>> mvn:com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.8.6
>> mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.8.6
>> mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.8.6
>> mvn:com.flairbit.iot.core/core.paging/1.1.0-SNAPSHOT
>> mvn:com.flairbit.iot.devman.rest/device.management.rest.impl/1.1.0-SNAPSHOT
>> mvn:com.flairbit.iot.devman/device.management.api/1.1.0-SNAPSHOT
>> mvn:com.flairbit.iot.security.x509/security.x509.api/1.1.0-SNAPSHOT
>> mvn:com.flairbit.iot.security.x509/security.x509.impl/1.1.0-SNAPSHOT
>> mvn:com.flairbit.iot.support/flairkit.sc.

Re: Feature verify error with Karaf 4.2.2

2019-01-03 Thread Jean-Baptiste Onofré
Great, thanks !

Let me try to reproduce and check your features.

Regards
JB

On 03/01/2019 11:58, Matteo Rulli wrote:
> Hello,
> Thank you for your support on this. Please find the pom and feature file
> attached below. It is disappointing that I have many other features with
> the same structure that “verify" just fine. I really don’t know why this
> one in particular triggers the uninstall of the
> org.apache.servicemix.specs.activation-api-1.1 bundle. 
> 
> I’m afraid that without the other dependencies, the feature and pom
> files below will not be very useful: I’ll try to carve out a stand-alone
> project that reproduces the issue but I’m afraid that will be quite hard. 
> 
> Just to understand a little bit better what is going on here… why Karaf
> is trying to uninstall the activation-api bundle?
> 
> Thank you very much,
> Matteo
> 
> The pom: 
> 
> 
> http://maven.apache.org/POM/4.0.0"/
> xmlns:xsi=/"http://www.w3.org/2001/XMLSchema-instance"/
> xsi:schemaLocation=/"http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd"/>
> 4.0.0
> 
> com.flairbit.iot.devman
> device.management
> 1.1.0-SNAPSHOT
> ../pom.xml
> 
> device.management.feature
> pom
> 
> FlairKit :: Device Management :: Feature
> 
> 
> 
> org.apache.karaf.features
> framework
> kar
> provided
> 
> 
> org.apache.karaf.features
> standard
> features
> xml
> provided
> 
> 
> com.flairbit.iot.security.x509
> security.x509.feature
> features
> xml
> provided
> 
> 
> com.flairbit.iot
> features.devicehub
> pom
> 
> 
> com.flairbit.iot.security.x509
> security.x509.api
> 
> 
> com.flairbit.iot.security.x509
> security.x509.store.impl
> 
> 
> com.flairbit.iot.devman
> device.management.aws.impl
> 
> 
> com.flairbit.iot.devman.store
> device.management.store.impl
> 
> 
> com.flairbit.iot.devman.rest
> device.management.rest.impl
> 
> 
> 
> 
> 
> 
> src/main/feature
> true
> 
> 
> src/main/resources
> true
> 
> 
> 
> 
> org.apache.maven.plugins
> maven-resources-plugin
> 
> 
> filter
> generate-resources
> 
> resources
> 
> 
> 
> 
> 
> org.codehaus.mojo
> build-helper-maven-plugin
> 
> 
> attach-artifacts
> package
> 
> attach-artifact
> 
> 
> 
> 
> target/classes/feature.xml
> xml
> features
> 
> 
> 
> 
> 
> 
> 
> org.apache.karaf.tooling
> karaf-maven-plugin
> 
> 
> verify
> process-resources
> 
> verify
> 
> 
> 
> mvn:org.apache.karaf.features/framework/${karaf.version}/xml/features
> mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features
> file:${project.build.directory}/classes/feature.xml
> 
> org.apache.karaf.features:framework
> ${java.specification.version}
> 
> framework
> 
> 
> flairkit|flairkit-(?!(test))*
> 
> false
> true
> file://${project.build.directory}/classes/config.properties
> 
> 
> 
> 
> 
> 
> 
> 
> 
> And the feature file:
> 
> 
>  xmlns=/"http://karaf.apache.org/xmlns/features/v1.4.0"/>
> 
>                 
> 
> mvn:com.flairbit.iot/features.devicehub/${project.version}/xml/features
> mvn:com.flairbit.iot.support/resolver.awsiot.feature/${resolver.awsiot.feature.version}/xml/features
> mvn:com.flairbit.iot.security.x509/security.x509.feature/${project.version}/xml/features
> mvn:com.flairbit.iot/features/${project.version}/xml/features
> 
> 
> scr
> flairkit-jackson
> flairkit-x509-feature
> flairkit-awsiot
> 
> 
> osgi.service;effective:=active;objectClass=com.flairbit.iot.security.x509.api.X509StoreService
> osgi.service;effective:=active;objectClass=com.flairbit.iot.devman.api.SubscriptionStoreService
> 
>  
> 
>  dependency=/"true"/>mvn:com.flairbit.iot.core/core.paging/${project.version}
>  dependency=/"true"/>mvn:com.flairbit.iot.security.x509/security.x509.api/${project.version}
>  dependency=/"true"/>mvn:com.flairbit.iot.devman/device.management.api/${project.version}
>  dependency=/"true"/>mvn:com.flairbit.iot.devman/device.management.aws.impl/${project.version}
> 
> 
> osgi.service;effective:=active;objectClass=javax.persistence.EntityManager
> 
> 
> aries-blueprint
> pax-jdbc-postgresql
>  dependency=/"true"/>mvn:org.apache.xbean/xbean-asm6-shaded/4.10
> 
> openjpa
> pax-jdbc-config
> pax-jdbc
> pax-jdbc-pool-dbcp2
> jpa
> transaction
> 
> 
> flairkit-x509-store
> 
> 
>  dependency=/"true"/>mvn:com.flairbit.iot.security.x509/security.x509.store.impl/${project.version}
>  dependency=/"true"/>mvn:com.flairbit.iot.devman.store/device.management.store.impl/${project.version}
> 
> 
> 
> 
> 
> 
> pool=dbcp2
> xa=true
> osgi.jdbc.driver.name=PostgreSQL JDBC Driver
> osgi.jdbc.driver.class=org.postgresql.Driver
> serverName=${com.flairbit.iot.datasource.postgres.servername}
> portNumber=${com.flairbit.iot.datasource.postgres.portno}
> databaseName=${com.flairbit.iot.datasource.postgres.dbname}
> user=${com.flairbit.iot.datasource.postgres.username}
> password=${com.flairbit.iot.datasource.postgres.password}
> dataSourceName=com.flairbit.iot.devman.store
> ssl=${com.flairbit.iot.datasource.postgres.ssl}
> 
> 
> 
> 
> flairkit-devicehub
> flairkit-devman-aws
> mvn:com.flairbit.io

Re: JAX-RS Whiteboard and CXF Mechanics

2019-01-03 Thread Tim Ward
I know that the JAX-RS whiteboard spec took a while to become a reality, but 
I’m really glad to hear that it is working well for you, and that it has helped 
to clean things up. 

Best Regards,

Tim

> On 2 Jan 2019, at 21:35, Oliver Schweitzer  wrote:
> 
> Hi,
> 
> Ok, thanks to the hints itt I have solved my two most pressing issues, with 
> some links/insights below. 
> 
> JAAS:
> 
> This helped me immensely to bridge JAAS and JAX-RS: 
> https://github.com/andyphillips404/awplab-core/blob/master/rest/service/src/main/java/com/awplab/core/rest/service/security/BasicAuthKarafSecurityRequestFilter.java
>  
> 
>  
> The Cxf JAASLoginInterceptor and the Filter that uses it have issues (for me) 
> I didn’t want to solve for my new Jax-Rs only setup, as illustrated by this 
> thread: 
> http://karaf.922171.n3.nabble.com/Security-Subject-from-AccessControlContext-is-null-when-using-JAAS-and-CXF-JAASAuthenticationFilter-td4037821.html
>  
> 
> 
> Cors:
> 
> This here helped me understand how to do Cors correctly including Preflight: 
> https://github.com/resteasy/Resteasy/blob/master/resteasy-core/src/main/java/org/jboss/resteasy/plugins/interceptors/CorsFilter.java
>  
> 
> 
> I just added (JAX-RS)Features and ConfigAdmin, some DS and Jax-rs Whiteboard 
> annotations (the spec really helps), and am now in happy component land. 
> 
> So it really looks like that the new Jax-rs stuff in R7 helps me with cleaner 
> code, dependency streamlining and modularity.
> 
> Thanks, especially to Tim for the original pointer to the Aries 
> implementation and a happy new year.
> 
> Best regards,
> 
> Oliver
> 
> 
> Le 2 janv. 2019 à 13:13, Tim Ward  > a écrit :
> 
 1. Some of the providers I configure programmatically implement JAX-RS
 interfaces and are provided by CXF or other frameworks,
 e.g. CrossOriginResourceSharingFilter, MultipartProvider, 
 JacksonJsonProvider, WebApplicationExceptionMapper.
 How do I make these known to my JAX-RS Whiteboard  (Whiteboard service)
 ?Just derive a new class, annotate as a Component and JaxrsExtension?
>> 
>> You have several options here, some of which have already been described, 
>> but there are some which have been overlooked.
>> 
>> Some extensions (such as support for Jackson’s JSON) are already available 
>> for the whiteboard. For example this integration project comes from Aries 
>> .
>> You can make use of the JAX-RS whiteboard’s dependency system to build your 
>> own JAX-RS feature which you then rely on.
>> 
>> For example:
>> 
>> @Component
>> @JaxrsName(“myFeature")
>> @JaxrsExtension
>> public class MyFeature implements Feature {
>> 
>> @Override
>> public boolean configure(FeatureContext fc) {
>> fc.register(CrossOriginResourceSharingFilter.class);
>> }
>> 
>> } 
>> 
>> You can then add requirements for this feature to your resources (ideally 
>> using config admin) using the osgi.jaxrs.extension.select property described 
>> in 
>> https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#service.jaxrs.common.properties
>>  
>> 
>> 
>> 
 2. Swagger2Feature, JAASLoginInterceptor, FastInfosetFeature, GZIPFeature, 
 CORSPreflightInterceptor (my
 code, extends AbstractPhaseInterceptor) are provided by CXF and
 implement CXF interfaces. I gather I can't use these directly with the
 Whiteboard? What do I do with those?  Reimplement/port to JAX-RS?
>> 
>> There are ways to make these existing features work, but it is a much better 
>> idea to port to the standard JAX-RS APIs, otherwise you’ll end up coupled to 
>> CXF unnecessarily.
>> 
>> Best Regards,
>> 
>> Tim
>> 
>> 
>>> On 28 Dec 2018, at 17:51, Jean-Baptiste Onofré >> > wrote:
>>> 
>>> Hi,
>>> 
>>> you can take a look on the Karaf JAXRS Whiteboard sample:
>>> 
>>> https://github.com/apache/karaf/pull/697 
>>> 
>>> 
>>> I gonna merge it tonight or tomorrow morning.
>>> 
>>> Regards
>>> JB
>>> 
>>> On 28/12/2018 16:23, Oliver Schweitzer wrote:
 Hi,
 
 I have an existing REST JAX-RS Application based on CXF mechanics. that
 is the Resources are lifecycle managed by a programmatically setup
 JAXRSServerFactoryBean, which itself gets started and stopped by an
 immediate @Component
 
 Now I want to bui

Re: JAX-RS Whiteboard and CXF Mechanics

2019-01-03 Thread Jean-Baptiste Onofré
By the way, the Karaf full example is here:

https://github.com/apache/karaf/tree/master/examples/karaf-rest-example/karaf-rest-example-whiteboard

Regards
JB

On 03/01/2019 16:38, Tim Ward wrote:
> I know that the JAX-RS whiteboard spec took a while to become a reality,
> but I’m really glad to hear that it is working well for you, and that it
> has helped to clean things up. 
> 
> Best Regards,
> 
> Tim
> 
>> On 2 Jan 2019, at 21:35, Oliver Schweitzer > > wrote:
>>
>> Hi,
>>
>> Ok, thanks to the hints itt I have solved my two most pressing issues,
>> with some links/insights below. 
>>
>> JAAS:
>>
>> This helped me immensely to bridge JAAS and
>> JAX-RS: 
>> https://github.com/andyphillips404/awplab-core/blob/master/rest/service/src/main/java/com/awplab/core/rest/service/security/BasicAuthKarafSecurityRequestFilter.java
>>  
>> The Cxf JAASLoginInterceptor and the Filter that uses it have issues
>> (for me) I didn’t want to solve for my new Jax-Rs only setup, as
>> illustrated by this
>> thread: 
>> http://karaf.922171.n3.nabble.com/Security-Subject-from-AccessControlContext-is-null-when-using-JAAS-and-CXF-JAASAuthenticationFilter-td4037821.html
>>
>> Cors:
>>
>> This here helped me understand how to do Cors correctly including
>> Preflight: 
>> https://github.com/resteasy/Resteasy/blob/master/resteasy-core/src/main/java/org/jboss/resteasy/plugins/interceptors/CorsFilter.java
>>
>> I just added (JAX-RS)Features and ConfigAdmin, some DS and Jax-rs
>> Whiteboard annotations (the spec really helps), and am now in happy
>> component land. 
>>
>> So it really looks like that the new Jax-rs stuff in R7 helps me with
>> cleaner code, dependency streamlining and modularity.
>>
>> Thanks, especially to Tim for the original pointer to the Aries
>> implementation and a happy new year.
>>
>> Best regards,
>>
>> Oliver
>>
>>
>> Le 2 janv. 2019 à 13:13, Tim Ward > > a écrit :
>>
> 1. Some of the providers I configure programmatically implement JAX-RS
> interfaces and are provided by CXF or other frameworks,
> e.g. CrossOriginResourceSharingFilter, MultipartProvider, 
> JacksonJsonProvider, WebApplicationExceptionMapper.
> How do I make these known to my JAX-RS Whiteboard  (Whiteboard service)
> ?Just derive a new class, annotate as a Component and JaxrsExtension?
>>>
>>> You have several options here, some of which have already been
>>> described, but there are some which have been overlooked.
>>>
>>>   * Some extensions (such as support for Jackson’s JSON) are already
>>> available for the whiteboard. For example this integration
>>> project comes from Aries
>>> 
>>> .
>>>   * You can make use of the JAX-RS whiteboard’s dependency system to
>>> build your own JAX-RS feature which you then rely on.
>>>
>>>
>>> For example:
>>>
>>> @Component@JaxrsName(“myFeature") @JaxrsExtensionpublicclass
>>> MyFeature implements Feature {
>>>
>>> @Override
>>>     public boolean configure(FeatureContext fc) {
>>> fc.register(CrossOriginResourceSharingFilter.class);
>>> }
>>>
>>> } 
>>>
>>> You can then add requirements for this feature to your resources
>>> (ideally using config admin) using the osgi.jaxrs.extension.select
>>> property described
>>> in 
>>> https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#service.jaxrs.common.properties
>>>
>>>
> 2. Swagger2Feature, JAASLoginInterceptor, FastInfosetFeature, 
> GZIPFeature, CORSPreflightInterceptor (my
> code, extends AbstractPhaseInterceptor) are provided by
> CXF and
> implement CXF interfaces. I gather I can't use these directly with the
> Whiteboard? What do I do with those?  Reimplement/port to JAX-RS?
>>>
>>> There are ways to make these existing features work, but it is a much
>>> better idea to port to the standard JAX-RS APIs, otherwise you’ll end
>>> up coupled to CXF unnecessarily.
>>>
>>> Best Regards,
>>>
>>> Tim
>>>
>>>
 On 28 Dec 2018, at 17:51, Jean-Baptiste Onofré >>> > wrote:

 Hi,

 you can take a look on the Karaf JAXRS Whiteboard sample:

 https://github.com/apache/karaf/pull/697

 I gonna merge it tonight or tomorrow morning.

 Regards
 JB

 On 28/12/2018 16:23, Oliver Schweitzer wrote:
> Hi,
>
> I have an existing REST JAX-RS Application based on CXF mechanics. that
> is the Resources are lifecycle managed by a programmatically setup
> JAXRSServerFactoryBean, which itself gets started and stopped by an
> immediate @Component
>
> Now I want to build new entrypoints (and eventually migrate old ones)
> using the JAX-RS whiteboard, as discussed e.g.
> here 
> http://karaf.922171.n3.nabble.com/Aries-JAX-RS-Whiteboard-td4054440.html,
> and go full dynamically discovered declarative services with my
> REST API
> an