Hello Paul,
I believe you might face issues with jakarta vs javax namespaces. There is a ongoing move from javax to jakarta and some of well known annotations might be missing at runtime. Please double check if your runtime consist of javax.annotation.security package.

Best,
Łukasz

On 19.01.2024 20:41, Paul Spencer wrote:
Karaf 4.4.5
I am looking to implement security on a REST endpoint

@DeclareRoles("message-view")
@RolesAllowed("message-view")
@Path("/messageLog")
@Component(service = MessageLog.class)
@JaxrsResource
@JaxrsApplicationSelect("(osgi.jaxrs.name=myApi)")
public class MessageLog {
     private static final Logger LOGGER = 
LoggerFactory.getLogger(MessageLog.class);

     @GET
     @Produces(MediaType.APPLICATION_JSON)
     @Path("/")
     public Response getMessageLog() {
...
}

When I added @DeclareRoles("message-view") @RolesAllowed("message-view") 
installing the bundle results in

Error executing command: Unable to resolve com.foo.msg-rest [162](R 162.1): missing requirement 
[foo.bar.msg-rest [162](R 162.1)] osgi.wiring.package; 
(&(osgi.wiring.package=javax.annotation.security)(version>=1.3.0)(!(version>=2.0.0))) 
Unresolved requirements: [[foo.bar.msg-rest [162](R 162.1)] osgi.wiring.package; 
(&(osgi.wiring.package=javax.annotation.security)(version>=1.3.0)(!(version>=2.0.0)))]

I suspect this because I have not installed a required feature or bundle.  What 
is the the required feature or bundle?

Paul Spencer

Reply via email to