Philipp Wandl (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=712020%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMmEyOWQyY2M2...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16701?atlOrigin=eyJpIjoiMmEyOW...
) HHH-16701 (
https://hibernate.atlassian.net/browse/HHH-16701?atlOrigin=eyJpIjoiMmEyOW...
) "persister" is null during validation with lazy collections (
https://hibernate.atlassian.net/browse/HHH-16701?atlOrigin=eyJpIjoiMmEyOW...
)
Issue Type: Bug Affects Versions: 6.2.0 Assignee: Unassigned Created: 25/May/2023 23:44 PM
Priority: Major Reporter: Philipp Wandl (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=712020%...
)
A NullPointerException is thrown during delete when using an entity with lazy collections
and tomcat-embed-el:10.1.8 on the classpath. The issue only occurs when a fresh
entitymanager instance is used to delete the entity.
For a more detailled analysis please have a look at the discussion here:
https://github.com/spring-projects/spring-boot/issues/35617
A sample application showcasing the bug can be found here:
https://github.com/wilkinsona/spring-hibernate-bug-demo/tree/pure-jpa
ay 25, 2023 5:47:45 PM org.hibernate.jpa.internal.util.LogHelper
logPersistenceUnitInformation
INFO: HHH000204: Processing PersistenceUnitInfo [name: test]
May 25, 2023 5:47:46 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate ORM core version 6.2.2.Final
May 25, 2023 5:47:46 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000406: Using bytecode reflection optimizer
May 25, 2023 5:47:46 PM
org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator
initiateService
INFO: HHH000130: Instantiating explicit connection provider:
org.hibernate.hikaricp.internal.HikariCPConnectionProvider
[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
[main] INFO com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Added connection conn0:
url=jdbc:h2:mem:test user=ROOT
[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
May 25, 2023 5:47:46 PM org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl
logSelectedDialect
INFO: HHH035001: Using dialect: org.hibernate.dialect.H2Dialect, version: 2.1.214
May 25, 2023 5:47:46 PM org.hibernate.bytecode.internal.BytecodeProviderInitiator
buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : bytebuddy
May 25, 2023 5:47:46 PM org.hibernate.validator.internal.util.Version <clinit>
INFO: HV000001: Hibernate Validator 8.0.0.Final
May 25, 2023 5:47:47 PM
org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator
initiateService
INFO: HHH000490: Using JtaPlatform implementation:
[org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
Exception in thread "main" jakarta.persistence.RollbackException: Error while
committing the transaction
at
org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:65)
at
org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:104)
at com.example.demo.DemoApplication.deleteUsers(DemoApplication.java:30)
at com.example.demo.DemoApplication.main(DemoApplication.java:20)
Caused by: jakarta.validation.ValidationException: HV000028: Unexpected exception during
isValid call.
at
org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateSingleConstraint(ConstraintTree.java:186)
at
org.hibernate.validator.internal.engine.constraintvalidation.SimpleConstraintTree.validateConstraints(SimpleConstraintTree.java:66)
at
org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:75)
at
org.hibernate.validator.internal.metadata.core.MetaConstraint.doValidateConstraint(MetaConstraint.java:130)
at
org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:123)
at
org.hibernate.validator.internal.engine.ValidatorImpl.validateMetaConstraint(ValidatorImpl.java:555)
at
org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForSingleDefaultGroupElement(ValidatorImpl.java:518)
at
org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:488)
at
org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:450)
at
org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:400)
at
org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:172)
at
org.hibernate.boot.beanvalidation.BeanValidationEventListener.validate(BeanValidationEventListener.java:128)
at
org.hibernate.boot.beanvalidation.BeanValidationEventListener.onPreUpdate(BeanValidationEventListener.java:92)
at
org.hibernate.action.internal.EntityUpdateAction.preUpdate(EntityUpdateAction.java:329)
at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:159)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:618)
at org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:489)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:486)
at
org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:358)
at
org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
at
org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:127)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1412)
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:485)
at
org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:2296)
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:1961)
at
org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:439)
at
org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:169)
at
org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:267)
at
org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:101)
... 2 more
Caused by: java.lang.NullPointerException: Cannot invoke
"org.hibernate.persister.collection.CollectionPersister.isExtraLazy()" because
"persister" is null
at
org.hibernate.collection.spi.AbstractPersistentCollection.lambda$readSize$0(AbstractPersistentCollection.java:155)
at
org.hibernate.collection.spi.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:265)
at
org.hibernate.collection.spi.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:148)
at org.hibernate.collection.spi.PersistentSet.size(PersistentSet.java:151)
at
org.hibernate.validator.internal.constraintvalidators.bv.notempty.NotEmptyValidatorForCollection.isValid(NotEmptyValidatorForCollection.java:37)
at
org.hibernate.validator.internal.constraintvalidators.bv.notempty.NotEmptyValidatorForCollection.isValid(NotEmptyValidatorForCollection.java:22)
at
org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateSingleConstraint(ConstraintTree.java:180)
... 31 more
(
https://hibernate.atlassian.net/browse/HHH-16701#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16701#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:85acc52 )