Hi JB,

See PR https://github.com/apache/karaf/pull/3088

A few notes on this PR:

1.) A lot of features were created inside the examples project (hk2,
jersey, jersey-hk2, jakartars-api, etc) and it seems a lot of these
might be better suited in standard than here.
2.) I have features relying on features and I'm not sure if this was
laid out the best way
3.) It uses the OSGi Configurator which is probably unique for a lot of
examples but I opted to use
4.) I wasn't able to get @Path("/booking") to work, so I set the
jersey context path to "/booking" instead. I'm not sure this was really
"correct" though it has the same outcome.

-- 
Chaz

On Thu, Nov 12, 2026 at 05:10:32PM +0100, Jean-Baptiste Onofré wrote:
> Hi Charlie,
> 
> Feel free to open a PR to add the new feature set. I will review it so we
> can include it in release 4.5.0, as I plan to submit 4.5.0 for a vote this
> weekend.
> 
> Regards,
> JB
> 
> 
> On Thu, Nov 12, 2026 at 4:02 PM <[email protected]> wrote:
> 
> > Better features.xml below
> >
> > On Thu, Nov 12, 2026 at 08:04:54AM -0500, apache-karaf-dev.pyr3x.com via
> > dev wrote:
> > > Hi JB,
> > >
> > > Sounds good. I agree this is not something to delay 4.5.0 -- just
> > > something to take note of to see what direction is going forward.
> > >
> > > --
> > > Chaz
> > >
> > > On Thu, Nov 12, 2026 at 05:39:08AM +0100, Jean-Baptiste Onofré wrote:
> > > > Hi Chaz,
> > > >
> > > > We have a few open PRs regarding the Jakarta changes expected for
> > version
> > > > 4.5.0.
> > > >
> > > > I will review them, but I do not want to delay the 4.5.0 release any
> > > > further. Any remaining fixes can be included in subsequent releases
> > (4.5.1,
> > > > 4.5.2, etc.).
> > > >
> > > > I'll check what I can get done for this release and keep you updated.
> > > >
> > > > Regards,
> > > > JB
> > > >
> > > >
> > > > On Wed, Nov 11, 2026 at 7:18 PM apache-karaf-dev.pyr3x.com via dev <
> > > > [email protected]> wrote:
> > > >
> > > > > Hi JB,
> > > > >
> > > > > Well the Karaf examples clearly uses Aries for the whiteboard
> > example.
> > > > > At minimum this is no longer viable.
> > > > >
> > > > >
> > > > >
> > https://github.com/apache/karaf/blob/main/examples/karaf-rest-example/karaf-rest-example-features/src/main/feature/feature.xml
> > > > >
> > > > > So the way I see it is:
> > > > >
> > > > > 1.) Aries updated for CXF 4x (Jakarta) on JAX-RS Whiteboard 2.0 for
> > r8
> > > > > 2.) Switch to the only (known) impl of 2.0 spec based on Jersey
> > > > > https://github.com/eclipse-osgi-technology/jakartarest-osgi and
> > build
> > > > > new features around it.
> > > > > 3.) Drop support and remove the example (hopefully not)
> > > > >
> > > > > I'm leaning towards making features for 2.) and adding a new example
> > > > > using the Jakarta annotations for whiteboard 2.0? Thoughts?
> > > > >
> > > > > --
> > > > > Chaz
> > > > >
> > > > > On Wed, Nov 11, 2026 at 05:19:41PM +0100, Jean-Baptiste Onofré wrote:
> > > > > > Hi,
> > > > > >
> > > > > > I consider this to be an Apache Aries issue rather than an Apache
> > Karaf
> > > > > one.
> > > > > > WDYT?
> > > > > >
> > > > > > Regards,
> > > > > > JB
> > > > > >
> > > > > >
> > > > > > On Wed, Nov 11, 2026 at 1:37 AM apache-karaf-dev.pyr3x.com via
> > dev <
> > > > > > [email protected]> wrote:
> > > > > >
> > > > > > > Hello,
> > > > > > >
> > > > > > > I'm testing out Apache Karaf 4.5.0 on main. I'm currently using
> > Apache
> > > > > > > Aries for the JAX-RS Whiteboard impl. This includes the features:
> > > > > > >
> > > > > > > aries-jax-rs-whiteboard-jackson
> > > > > > > aries-jax-rs-whiteboard-openapi
> > > > > > > aries-jax-rs-whiteboard-shiro
> > > > > > >
> > > > > > > I also have a CXF phase interceptor which will convert the shiro
> > > > > subject
> > > > > > > to a JAAS subject and validate using the Karaf Service Guard
> > (since my
> > > > > > > REST API injects a core where all methods are guarded). This via
> > the
> > > > > > > org.apache.karaf.service.acl.myapi.cfg. This let's my centralize
> > > > > > > authc/authz for both the karaf commands / REST api.
> > > > > > >
> > > > > > > The upgrade in Pax Web means javax.servlet is no longer exported
> > and
> > > > > I'm
> > > > > > > not sure what the future of the whiteboard pattern with aries is
> > here?
> > > > > > >
> > > > > > > I did find this repository:
> > > > > > >
> > > > > > > https://github.com/eclipse-osgi-technology/jakartarest-osgi
> > > > > > >
> > > > > > > samples of what I'm doing below. I moved to Subject.callAs from
> > Java 21
> > > > > > > forward:
> > > > > > >
> > > > > > > @Component(service = Application.class)
> > > > > > > @ApplicationPath(ApiApplication.NAME)
> > > > > > > @JaxrsApplicationBase(ApiApplication.NAME)
> > > > > > > @JaxrsName(ApiApplication.NAME)
> > > > > > >
> > > > > > > ---
> > > > > > >
> > > > > > > @Component(service = ObjectsResource.class, scope =
> > > > > ServiceScope.PROTOTYPE)
> > > > > > > @JaxrsResource
> > > > > > > @JaxrsApplicationSelect(ApiApplication.NAME_FILTER)
> > > > > > > @JSONRequired
> > > > > > >
> > > > > > > ---
> > > > > > >
> > > > > > > @Component(service = Feature.class)
> > > > > > > @Provider
> > > > > > > @JaxrsApplicationSelect(ApiApplication.NAME_FILTER)
> > > > > > > @JaxrsExtension
> > > > > > > public class JaasSubjectDoAsFeature extends AbstractFeature {
> > > > > > >
> > > > > > >   @Override
> > > > > > >   protected void initializeProvider(final InterceptorProvider
> > provider,
> > > > > > > final Bus bus) {
> > > > > > >     provider.getInInterceptors().add(new
> > JaasSubjectDoAsInterceptor());
> > > > > > >   }
> > > > > > > }
> > > > > > >
> > > > > > > ---
> > > > > > >
> > > > > > > public class JaasSubjectDoAsInterceptor extends
> > > > > > > AbstractPhaseInterceptor<Message> {
> > > > > > >
> > > > > > >   public JaasSubjectDoAsInterceptor() {
> > > > > > >     super(Phase.PRE_INVOKE);
> > > > > > >   }
> > > > > > >
> > > > > > >   @Override
> > > > > > >   public void handleMessage(final Message message) {
> > > > > > >     final org.apache.shiro.subject.Subject shiroSubject =
> > > > > > > SecurityUtils.getSubject();
> > > > > > >     if (shiroSubject == null
> > > > > > >         || !(shiroSubject.getPrincipal() instanceof
> > SecurityIdentity
> > > > > > > securityIdentity)) {
> > > > > > >       return;
> > > > > > >     }
> > > > > > >     Subject.callAs(
> > > > > > >         SecurityUtilities.toJaasSubject(securityIdentity),
> > > > > > >         () -> {
> > > > > > >           message.getInterceptorChain().doIntercept(message);
> > > > > > >           return null;
> > > > > > >         });
> > > > > > >   }
> > > > > > > }
> > > > > > >
> > > > > > > --
> > > > > > > Chaz
> > > > > > >
> > > > >
> > >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <features xmlns="http://karaf.apache.org/xmlns/features/v1.6.0";
> >           name="eclipse-jakartars-whiteboard-features">
> >
> >     <repository>
> >
> > mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features
> >     </repository>
> >
> >     <!-- Jakarta REST and OSGi APIs -->
> >
> >     <feature name="jakartars-api" version="1.0.0"
> >              description="Jakarta REST and OSGi Jakarta REST APIs">
> >
> >         <bundle>
> >             mvn:jakarta.ws.rs/jakarta.ws.rs-api/3.1.0
> >         </bundle>
> >         <bundle>
> >             mvn:jakarta.inject/jakarta.inject-api/2.0.1
> >         </bundle>
> >         <bundle>
> >             mvn:jakarta.annotation/jakarta.annotation-api/2.1.1
> >         </bundle>
> >         <bundle>
> >             mvn:jakarta.xml.bind/jakarta.xml.bind-api/4.0.1
> >         </bundle>
> >         <bundle>
> >             mvn:jakarta.validation/jakarta.validation-api/3.0.2
> >         </bundle>
> >
> >         <bundle>
> >             mvn:org.osgi/org.osgi.service.jakartars/2.0.0
> >         </bundle>
> >         <bundle>
> >             mvn:org.osgi/org.osgi.service.condition/1.0.0
> >         </bundle>
> >
> >     </feature>
> >
> >
> >     <!-- HK2 dependency injection framework -->
> >
> >     <feature name="hk2" version="3.0.5"
> >              description="HK2 dependency injection framework">
> >
> >         <bundle>
> >             mvn:org.glassfish.hk2/osgi-resource-locator/1.0.3
> >         </bundle>
> >         <bundle>
> >             mvn:org.glassfish.hk2.external/aopalliance-repackaged/3.0.5
> >         </bundle>
> >         <bundle>
> >             mvn:org.glassfish.hk2/hk2-api/3.0.5
> >         </bundle>
> >         <bundle>
> >             mvn:org.glassfish.hk2/hk2-utils/3.0.5
> >         </bundle>
> >         <bundle>
> >             mvn:org.glassfish.hk2/hk2-locator/3.0.5
> >         </bundle>
> >         <bundle>
> >             mvn:org.javassist/javassist/3.29.2-GA
> >         </bundle>
> >
> >     </feature>
> >
> >
> >     <!-- Jersey HK2 integration -->
> >
> >     <feature name="jersey-hk2" version="3.1.3"
> >              description="Jersey HK2 injection integration">
> >
> >         <feature>jakartars-api</feature>
> >         <feature>hk2</feature>
> >
> >         <bundle>
> >             mvn:org.glassfish.jersey.inject/jersey-hk2/3.1.3
> >         </bundle>
> >
> >     </feature>
> >
> >
> >     <!-- Jersey REST implementation -->
> >
> >     <feature name="jersey" version="3.1.3"
> >              description="Jersey Jakarta REST implementation">
> >
> >         <feature>jakartars-api</feature>
> >         <feature>jersey-hk2</feature>
> >
> >         <bundle>
> >             mvn:org.glassfish.jersey.core/jersey-common/3.1.3
> >         </bundle>
> >         <bundle>
> >             mvn:org.glassfish.jersey.core/jersey-client/3.1.3
> >         </bundle>
> >         <bundle>
> >             mvn:org.glassfish.jersey.core/jersey-server/3.1.3
> >         </bundle>
> >
> >         <bundle>
> >
> > mvn:org.glassfish.jersey.containers/jersey-container-servlet-core/3.1.3
> >         </bundle>
> >         <bundle>
> >
> > mvn:org.glassfish.jersey.containers/jersey-container-servlet/3.1.3
> >         </bundle>
> >
> >         <bundle>
> >             mvn:org.glassfish.jersey.media/jersey-media-jaxb/3.1.3
> >         </bundle>
> >         <bundle>
> >             mvn:org.glassfish.jersey.media/jersey-media-sse/3.1.3
> >         </bundle>
> >
> >         <!-- ASM -->
> >
> >         <bundle>
> >             mvn:org.ow2.asm/asm/9.6
> >         </bundle>
> >         <bundle>
> >             mvn:org.ow2.asm/asm-commons/9.6
> >         </bundle>
> >         <bundle>
> >             mvn:org.ow2.asm/asm-tree/9.6
> >         </bundle>
> >         <bundle>
> >             mvn:org.ow2.asm/asm-analysis/9.6
> >         </bundle>
> >         <bundle>
> >             mvn:org.ow2.asm/asm-util/9.6
> >         </bundle>
> >
> >     </feature>
> >
> >
> >     <!-- Eclipse Jakarta REST Whiteboard implementation -->
> >
> >     <feature name="eclipse-jakartars-whiteboard" version="1.2.3"
> >              description="Eclipse OSGi Jakarta REST Whiteboard
> > implementation">
> >
> >         <feature>http</feature>
> >         <feature>jakartars-api</feature>
> >         <feature>jersey</feature>
> >         <feature>pax-web-jetty</feature>
> >         <feature>pax-web-whiteboard</feature>
> >         <feature>scr</feature>
> >
> >         <bundle>
> >
> > mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.3.7
> >         </bundle>
> >
> >         <bundle>
> >
> > mvn:org.eclipse.osgi-technology.rest/org.eclipse.osgitech.rest/1.2.3
> >         </bundle>
> >         <bundle>
> >
> > mvn:org.eclipse.osgi-technology.rest/org.eclipse.osgitech.rest.config/1.2.3
> >         </bundle>
> >         <bundle>
> >
> > mvn:org.eclipse.osgi-technology.rest/org.eclipse.osgitech.rest.sse/1.2.3
> >         </bundle>
> >         <bundle>
> >
> > mvn:org.eclipse.osgi-technology.rest/org.eclipse.osgitech.rest.servlet.whiteboard/1.2.3
> >         </bundle>
> >
> > </features>
> >
> >

Reply via email to