You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering a challenging issue with bean validation within a MicroProfile Reactive Messaging application running on OpenLiberty. When invoking a CDI bean method with parameter constraints (e.g., @NotNull) from a Reactive Messaging listener, instead of enforcing the constraint or failing gracefully, it results in a NullPointerException.
Environment:
Application Server: OpenLiberty 24.0.0.2
MicroProfile Version: 6.1
JDK Version: 21
Smallrye Reactive Messaging: 4.17.0
Issue Description:
In my setup, a CDI bean method annotated with bean validation constraints is called within the scope of a Reactive Messaging listener. While I expect the validation to either pass or throw a ConstraintViolationException for violations, it instead crashes with a NullPointerException.
Observed Behavior:
The application throws a NullPointerException when the CDI bean method, which includes a bean validation annotation on its parameters, is called from a Reactive Messaging listener. This occurs even before reaching the validation logic, indicating an issue with context propagation or validation handling in this specific scenario.
[INFO] NullPointerException: Cannot invoke "com.ibm.ws.runtime.metadata.ComponentMetaData.getModuleMetaData()" because the return value of "com.ibm.ws.threadContext.ComponentMetaDataAccessorImpl.getComponentMetaData()" is null
Questions:
Is this behavior indicative of a known issue with context propagation for bean validation in a reactive setting?
Are there any recommended practices or configurations to ensure that bean validation can be properly triggered without resulting in an NPE when used in conjunction with MicroProfile Reactive Messaging?
Could this NPE be related to a specific configuration or limitation within OpenLiberty's implementation of MicroProfile Reactive Messaging and CDI integration?
I appreciate any insights or guidance on resolving this issue to ensure that bean validation works as expected in reactive messaging scenarios.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am encountering a challenging issue with bean validation within a MicroProfile Reactive Messaging application running on OpenLiberty. When invoking a CDI bean method with parameter constraints (e.g.,
@NotNull
) from a Reactive Messaging listener, instead of enforcing the constraint or failing gracefully, it results in aNullPointerException
.Environment:
Issue Description:
In my setup, a CDI bean method annotated with bean validation constraints is called within the scope of a Reactive Messaging listener. While I expect the validation to either pass or throw a
ConstraintViolationException
for violations, it instead crashes with aNullPointerException
.Observed Behavior:
The application throws a
NullPointerException
when the CDI bean method, which includes a bean validation annotation on its parameters, is called from a Reactive Messaging listener. This occurs even before reaching the validation logic, indicating an issue with context propagation or validation handling in this specific scenario.Code Example:
StackTrace Snippet:
Questions:
I appreciate any insights or guidance on resolving this issue to ensure that bean validation works as expected in reactive messaging scenarios.
Beta Was this translation helpful? Give feedback.
All reactions