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
Tag: jakarta-ee
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
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
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
Error when adding java agent in VM arguments while using OpenJPA
I found solution for my problem with OpenJPA here: Using TomEE and open JPA, i get the following error: SEVERE: JAVA AGENT NOT INSTALLED, but adding VM parameter as in question answer or documentation …
POIXMLException when updating excel file with apache-poi
When I try overwrite existing excel file, I get this error message: Exception in thread “main” org.apache.poi.ooxml.POIXMLException: OOXML file structure broken/invalid – no core document …
EAP 7.3 JPA+Hibernate REST Serialization of Bidirectional ManyToOne relationship (NOT SPRING)
I come from a Payara/EclipseLink background where this just works out of the box. My contract requires me to use EAP which does not support EclipseLink.persistance and I always prefer the “…
Using Vaadin Flow with Jakarta EE 9
I see that Apache Tomcat 10 (alpha) is now available. The major feature there is support for Jakarta EE 9 where package names for APIs have changed from javax.* to jakarta.*. Jakarta EE 9 now has a …
Package accessible from more than one module:
When trying to register an MBean in JMX Console I’m getting the following error message: The package javax.management is accessible from more than one module: , java.management I’m …
Eclipse irreversible Dynamic Web Module 4.0 selection; Tomcat 9 doesn’t support it
I’m using Eclipse Oxygen.2 (4.7.2) on Windows 10 with Java 8. I have a faceted project I run inside Eclipse using Tomcat. I had been using Tomcat 8.5, but on a new system I upgraded to Tomcat 9. Of course I removed the Tomcat 8.5 server and server runtime within Eclipse, and added back a Tomcat 9 server runtime. Before