THALES GROUP LIMITED DISTRIBUTION to email recipients

Hello everyone,

Any feedback on my issue ?
I can provide test case/sample if required.

Best Regards.

-----Original Message-----
From: COURTAULT Francois
Sent: mardi 3 juin 2025 12:30
To: users@tomee.apache.org
Subject: RE: TomEE 9.1.3 to 10.0.1 issue

Hello Richard,

I think I narrowed down the issue I have but I don't know if it is normal or 
not.

At the class level if I have @RequestScoped and a beans.xml (content below) 
under WEB-INF folder, then the deployment failed.

beans.xml content:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd";
       bean-discovery-mode="all">
</beans>

Is it normal that the deployment fails with the annotation used 
(@RequestScoped) and the beans.xml in the WAR ?

All the tests I made:
   - beans.xml in the war  + @RequestScoped annotation at class level => 
deployment KO
   - no beans.xml in the war  + @RequestScoped annotation at class level => 
deployment KO
   - beans.xml in the war  + no @RequestScoped annotation at class level => 
deployment KO
   - no beans.xml in the war  + no @RequestScoped annotation at class level => 
deployment OK

General question: why all this stuff is working when using TomEE 9.1.3 and not 
working when using TomEE 10.0.1 ?

Best regards.

-----Original Message-----
From: Richard Zowalla <r...@apache.org>
Sent: lundi 2 juin 2025 21:23
To: users@tomee.apache.org
Subject: Re: TomEE 9.1.3 to 10.0.1 issue

Hi,

I think your scenario is available as an example here: 
https://github.com/apache/tomee/tree/main/examples/mp-rest-jwt-principal

Gruß
Richard



> Am 02.06.2025 um 19:08 schrieb COURTAULT Francois 
> <francois.courta...@thalesgroup.com.INVALID>:
>
> THALES GROUP LIMITED DISTRIBUTION to email recipients
>
> Hello everyone,
>
> I want to run one sample app in TomEE Plus 10.0.1.
>
> This app is running fine when using TomEE 9.1.3.
>
> First question is about the pom.xml
> When on TomEE 9.1.3, I have in my pom these dependencies:
> <dependency>
>    <groupId>jakarta.platform</groupId>
>    <artifactId>jakarta.jakartaee-api</artifactId>
>    <version>9.1.0</version>
>    <scope>provided</scope>
> </dependency>
>
> <dependency>
>    <groupId>org.eclipse.microprofile.jwt</groupId>
>    <artifactId>microprofile-jwt-auth-api</artifactId>
>    <version>2.0</version>
>    <scope>provided</scope>
> </dependency>
>
> <dependency>
>    <groupId>org.apache.tomee</groupId>
>    <artifactId>mp-jwt</artifactId>
>    <version>9.1.3</version>
>    <scope>provided</scope>
> </dependency>
>
> So when I switch to TomEE 10.0.1, so from Jakarta 9.1 to 10, do I have to 
> update all these versions ?
>
>  *   from 9.1.0 to 10.0.0 for jakarta.jakartaee-api
>  *   from 2.0 to 2.1 for jwt-auth-api
>  *   from 9.1.3 to 10.0.1 for mp-jwt
>
> Second question, why I got this kind of following errors ?
> 02-Jun-2025 18:54:05.535 SEVERE [main] 
> org.apache.openejb.cdi.OpenEJBLifecycle.startApplication CDI Beans module 
> deployment failed
>        org.apache.webbeans.exception.WebBeansDeploymentException: 
> jakarta.enterprise.inject.UnsatisfiedResolutionException: Api type 
> [org.eclipse.microprofile.jwt.JsonWebToken] is not found with the qualifiers
>
> In my source JAX-RS resource code I have:
>
> import org.eclipse.microprofile.jwt.JsonWebToken;
>
> import jakarta.annotation.security.RolesAllowed;
> import jakarta.enterprise.context.RequestScoped;
>
> import jakarta.inject.Inject;
>
> import jakarta.ws.rs.GET;
> import jakarta.ws.rs.Path;
> import jakarta.ws.rs.core.Response;
>
> @Path("resources")
> @RequestScoped
> public class MPJwtResource {
> @Inject
> private JsonWebToken callerPrincipal;
> ...
>               @GET
>               @RolesAllowed("myrole")
>               public Response test () {
>                              System.out.println("JsonWebToken:" + 
> callerPrincipal + ".");
>                              return Response.ok().build();
>               }
> }
>
> Best Regards.
>
>
>
>


Reply via email to