Using interceptor for request body logging

29 views
Skip to first unread message

Giuseppe Sacco

unread,
Sep 9, 2025, 9:15:09 AMSep 9
to WildFly
Hello,
using WildFly 37, I am creating a REST API with JAX-RS, so that java methods get called with java classes instead of the plain unmarshalled JSON, but I have some problems and I would like to better investigate it reading the complete request body.

I wrote a ReaderInterceptor class, I annoted the it with @Provider, but its aroundReadFrom(ReaderInterceptorContext) is not being called at all.

Is there anything more, beside the annotation, in order to activate the interceptor? Moreover, should I bind it to my resource class?

Thank you,
Giuseppe

Rebecca Searls

unread,
Sep 9, 2025, 2:48:37 PMSep 9
to Giuseppe Sacco, WildFly
Can you confirm the class is being found and loaded.

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wildfly/327ea090-2702-4149-a159-76f04566b980n%40googlegroups.com.

James Perkins

unread,
Sep 9, 2025, 8:28:22 PMSep 9
to WildFly
How do you activate your Jakarta REST endpoints? Do you do it in a web.xml or via a jakarta.ws.rs.core.Application? In either of those case, do you define a collection of resources you want registered?

You can turn on debug logging for RESTEasy with the following CLI commands:
/subsystem=logging/logger=org.jboss.resteasy:add(level=DEBUG)

If you'd like to see the log messages on the console you could also do:
/subsystem=logging/console-handler=CONSOLE:undefine-attribute(name=level)

Giuseppe Sacco

unread,
Sep 10, 2025, 3:07:25 AMSep 10
to WildFly
 I don't know if it is being found and loaded autmatically because of the @Provider annotation, but if I create an instance of that class, the class is found and loaded.

Giuseppe Sacco

unread,
Sep 10, 2025, 3:09:51 AMSep 10
to WildFly
I use the annotation @Application.

I just found something really strange: the interceptor works on a testing standalone wildfly, while it doesn't when using a different development installation, activated via NetBeans. I'll try to get more details about the two different environments.

James Perkins

unread,
Sep 10, 2025, 12:55:56 PMSep 10
to WildFly
Definitely check that it's in what is deployed.
Reply all
Reply to author
Forward
0 new messages