-
Bug
-
Resolution: Done
-
Blocker
-
7.2.0.GA.CR4
-
None
-
Regression
-
-
-
-
-
-
-
https://hibernate.atlassian.net/browse/HV-1684
The value obtained from possibleValueExtractorsByRuntimeType is always re-added later on, wrapped into an immutable set. So after some time this will produce the stack overflow. Instead, the write to the cache should only happen once upon initial retrieval of the value.
java.lang.StackOverflowError at java.util.Collections$UnmodifiableCollection.isEmpty(Collections.java:1031) at java.util.Collections$UnmodifiableCollection.isEmpty(Collections.java:1031) ...... at java.util.Collections$UnmodifiableCollection.isEmpty(Collections.java:1031) at java.util.Collections$UnmodifiableCollection.isEmpty(Collections.java:1031) at java.util.Collections$UnmodifiableCollection.isEmpty(Collections.java:1031) at java.util.Collections$UnmodifiableCollection.isEmpty(Collections.java:1031) at java.util.Collections$UnmodifiableCollection.isEmpty(Collections.java:1031) at java.util.Collections$UnmodifiableCollection.isEmpty(Collections.java:1031) at org.hibernate.validator.internal.engine.valueextraction.ValueExtractorResolver.getRuntimeCompliantValueExtractors(ValueExtractorResolver.java:316) at org.hibernate.validator.internal.engine.valueextraction.ValueExtractorResolver.getValueExtractorCandidatesForContainerDetectionOfGlobalCascadedValidation(ValueExtractorResolver.java:177) at org.hibernate.validator.internal.metadata.aggregated.CascadingMetaDataBuilder.build(CascadingMetaDataBuilder.java:227) at org.hibernate.validator.internal.metadata.aggregated.FieldCascadable$Builder.build(FieldCascadable.java:83) at org.hibernate.validator.internal.metadata.aggregated.FieldCascadable$Builder.build(FieldCascadable.java:64) at org.hibernate.validator.internal.metadata.aggregated.PropertyMetaData$Builder.lambda$build$1(PropertyMetaData.java:347) at org.hibernate.validator.internal.metadata.aggregated.PropertyMetaData$Builder$$Lambda$62/1651906449.apply(Unknown Source) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at org.hibernate.validator.internal.metadata.aggregated.PropertyMetaData$Builder.build(PropertyMetaData.java:348) at org.hibernate.validator.internal.metadata.aggregated.PropertyMetaData$Builder.build(PropertyMetaData.java:151) at org.hibernate.validator.internal.metadata.aggregated.BeanMetaDataImpl$BuilderDelegate.build(BeanMetaDataImpl.java:784) at org.hibernate.validator.internal.metadata.aggregated.BeanMetaDataImpl$BeanMetaDataBuilder.build(BeanMetaDataImpl.java:648) at org.hibernate.validator.internal.metadata.BeanMetaDataManager.createBeanMetaData(BeanMetaDataManager.java:192) at org.hibernate.validator.internal.metadata.BeanMetaDataManager.lambda$getBeanMetaData$0(BeanMetaDataManager.java:160) at org.hibernate.validator.internal.metadata.BeanMetaDataManager$$Lambda$53/253243426.apply(Unknown Source) at java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:324) at org.hibernate.validator.internal.metadata.BeanMetaDataManager.getBeanMetaData(BeanMetaDataManager.java:159) at org.hibernate.validator.internal.engine.ValidationContext$ValidationContextBuilder.forValidate(ValidationContext.java:566) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:155) at com.test.ValidateParameters.validateObject(ValidateParameters.java:31)
The only way to fix it is to restart the app
- clones
-
JBEAP-16095 HV-1684 StackOverflowError with Hibernate Validator when using constraints on Maps
- Closed
- is incorporated by
-
JBEAP-16102 Upgrade to Hibernate Validator 6.0.14
- Closed