My Oracle Support Banner

Eclipselink 2.6.4 Of Weblogic Does Not Properly Implement JSR 303 Bean Validations (Doc ID 2401182.1)

Last updated on NOVEMBER 10, 2021

Applies to:

Oracle TopLink - Version and later
Information in this document applies to any platform.


Eclipselink Version 2.6.4 does not always determine when it is appropriate to run JSR validations on a modified bean.
The class org.eclipse.persistence.internal.jpa.metadata.listeners.BeanValidationListener

Its the critical central point to invoke J SR 303 bean validation on an entity.

boolean shouldValidate = noOptimization || beanValidationHelper.isConstrained(source.getClass());
The code above makes perfect logical sense.

The critical issue is the implementation

This implementation is NON RECURSIVE, and it will not detect that a Bean A needs to be validated when the J SR 303 annotation are on its parent:
@MappedSuperclass public abstract DummyParentEntity{
private String someFieldThatMustNotBeNull;

The work-around hack for this bug is to go to the child entity A and add into it
private final char waitForEclipseLinkToFixTheVersion264 = 'a';

With this the following step will be evaluated to true and the J SR 303 validations get called.
boolean shouldValidate = noOptimization || beanValidationHelper.isConstrained(source.getClass());


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.