In Payara 5, Jakarta EE 8, I try to inject all the qualified beans and then select a specific one using a qualifier as shown right below: The abstract class which extends the interface along with an implementer: And the qualifier The result is unsatisfied dependencies error. The same code works on JavaEE 7 application server. I could not find
Tag: jakarta-ee
Run task asynchronously: ManagedExcecutorService vs Microprofile fault tolerance @Asynchronous
I want to run an asynchronous task in a JavaEE openliberty environment. Ideally the task has to run at startup, but I don’t want that it blocks the startup of the WAR module itself. Also, I don’t want that on failure it prevents the whole application from starting up. So I guess that the solution is to run the task
How to activate my own Jakarta HttpAuthenticationMechanism implementation in Jakarta EE app
I am creating an simple Jakarta EE 9 app. Because of my own reason, I have to implement my own HttpAuthenticationMechanism (I am not using built-in HttpAuthenticationMechanism CDI beans). I am having an issue with activating my own HttpAuthenticationMechanism. In my login servlet, I try to call SecurityContext.authenticate(request, response, AuthenticationParameters) to process a login manually, but my own HttpAuthenticationMechanism never
Is there an elegant way to exit ClientRequestFilter?
I implemented a ClientRequestFilter. But one call of a client should not be filtered, which means if the request comes from this class (in my case the class is called TokenClient) the method should just return. Right now as you can see I check the path and if it contains /token it will return. But I would rather check if
What is the name of the design pattern where I dynamically pick the correct implementation based on data?
Originally I picked the correct User implementation, based on domain and realm data from the Java EE server. However that was company code, so I had to rewrite the example with numbers. I hope the underlying pattern is still understandable though. For those unfamiliar with CDI, @Inject Instance allows you to iterate through all implementations of an interface. Answer I
Using GraalVM (scripting) within Wildfly/JBoss
I want to use GraalVM (version 22.0.0.2 with Java 17.0.2) to execute JavaScripts within Wildfly (version 26.0). If I do have the following code: then my JSE unit test, started from Eclise, works fine. But if I call the same code within my EAR within Wildfly, I get an What’s wrong? How can I inform Wildfly that the org.graalvm classes
OpenLiberty JakartaEE 9: access TransactionManager
On Docker Image open-liberty:22.0.0.1-full-java17-openj9 with the following activated features: and the javax namespace, it was possible to create an TransactionManager via the api dependency in the following way: We are moving to JakartaEE9 and this one API dependency seems not to have an equivalent for the jakarta.* namespace, so that this is not compiling: In the openliberty zip, see https://repo1.maven.org/maven2/io/openliberty/openliberty-runtime/22.0.0.1/openliberty-runtime-22.0.0.1.zip
Session created by Tomcat
I am learning session with servlets and i read in the book that to create a session we need to call as below. HttpSession session = request.getSession() This causes the web container to create a session ID and send it back to client so that client can attach it with every subsequent request to the server. When i open developer
Getting javax.servlet.ServletException: javax.naming.NamingException: Lookup failed for ‘java:global/ShoppingCart-1.0-SNAPSHOT/ShoppingCartRemote’
I am new to JAVA EE. I am trying to implement stateful session Bean via IntelliJ IDEA and glassfish server 4.0 while running the code getting below exception. Attaching the code and glassfish configuration as well. Error is coming as the lookup has been failed. Can anyone help regarding the lookup? Glassfish Configuration Remote Interface Stateful Session Bean JSP Code
How to unit test methods together with its constraint validators (which some should be mocked out)?
My app has a service layer which is composed by CDI applications scoped beans: When a method gets called, an interceptor (in my case BValInterceptor.class from Apache BVal) checks if the method contract is respected by checking the annotations and validating the parameters accordingly. As you can see, there are some custom constraints like @SectionExists, @PostExists that may hit the