Skip to content

Commit ab48b88

Browse files
committed
Refine BeanValidationBeanRegistrationAotProcessor logging
This commit prints a log message at debug level without a stacktrace for TypeNotPresentException and uses warn level instead of error level for other exceptions since the processing of such bean will just be skipped. Closes gh-31147
1 parent eda35e8 commit ab48b88

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spring-context/src/main/java/org/springframework/validation/beanvalidation/BeanValidationBeanRegistrationAotProcessor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ public static BeanRegistrationAotContribution processAheadOfTime(RegisteredBean
105105
logger.warn("Skipping validation constraint hint inference for bean " + registeredBean.getBeanName() +
106106
" due to an ArrayIndexOutOfBoundsException at validator level");
107107
}
108+
else if (ex instanceof TypeNotPresentException) {
109+
logger.debug("Skipping validation constraint hint inference for bean " +
110+
registeredBean.getBeanName() + " due to a TypeNotPresentException at validator level: " + ex.getMessage());
111+
}
108112
else {
109-
logger.error("Skipping validation constraint hint inference for bean " +
113+
logger.warn("Skipping validation constraint hint inference for bean " +
110114
registeredBean.getBeanName(), ex);
111115
}
112116
return null;

0 commit comments

Comments
 (0)