Error on delete entity


#1

I have an error when I want to delete indexed Entity from dataBase. can this error related to hibernateSearch?

........
org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:565)\r\n\t
at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:247)\r\n\t
at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:561)\r\n\t
at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:132)\r\n\t
at org.hibernate.collection.internal.PersistentBag.iterator(PersistentBag.java:277)\r\n\t
at org.hibernate.search.engine.spi.AbstractDocumentBuilder.appendContainedInWorkForInstance(AbstractDocumentBuilder.java:214)\r\n\t
at org.hibernate.search.engine.impl.WorkPlan$PerEntityWork.processContainedIn(WorkPlan.java:548)\r\n\t
at org.hibernate.search.engine.impl.WorkPlan$PerClassWork.processContainedInAndPrepareExecution(WorkPlan.java:309)\r\n\t
at org.hibernate.search.engine.impl.WorkPlan.processContainedInAndPrepareExecution(WorkPlan.java:136)\r\n\tat org.hibernate.search.backend.impl.WorkQueue.prepareWorkPlan(WorkQueue.java:113)\r\n\t
at org.hibernate.search.backend.impl.BatchedQueueingProcessor.prepareWorks(BatchedQueueingProcessor.java:54)\r\n\t
at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.beforeCompletion(PostTransactionWorkQueueSynchronization.java:66)\r\n\t
at org.hibernate.search.event.impl.EventSourceTransactionContext$DelegateToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTransactionContext.java:169)\r\n\t
at org.hibernate.engine.spi.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:932)\r\n\t
at org.hibernate.engine.spi.ActionQueue.beforeTransactionCompletion(ActionQueue.java:507)\r\n\t
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2405)\r\n\tat org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:467)\r\n\t
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:146)\r\n\t
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100
.....

#2

Having the error message would help.

The Hibernate ORM and Hibernate Search versions are of interest too.


#6

hibernate-version : 5.2.8.Final
hibernateSearch-version: 5.8.2.Final

{"id":4801,"customExceptionDetailModelList":[{"id":5111,"message":{"error":"Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction"},"stackTrace":"org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction\r\n\t
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:526)\r\n\t
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)\r\n\t
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)\r\n\t
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:504)\r\n\t
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:292)\r\n\t
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)\r\n\t
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\r\n\t
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)\r\n\t
at org.org.ServiceImpl$$EnhancerBySpringCGLIB$$504cee0e.delete(<generated>)\r\n\t
at org.org.Delete(ServiceImpl.java:1249)\r\n\t
at org.org.Controller.delete(Controller.java:215)\r\n\t
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\t
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\t
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\t
at java.lang.reflect.Method.invoke(Method.java:483)\r\n\t
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)\r\n\t
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)\r\n\t
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)\r\n\t
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)\r\n\t
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)\r\n\t
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)\r\n\t
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)\r\n\t
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)\r\n\t
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)\r\n\t
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)\r\n\t
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)\r\n\t
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)\r\n\t
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\t
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)\r\n\t
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\t
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)\r\n\t
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)\r\n\t
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:176)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)\r\n\t
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)\r\n\t
at org.springframework.web.filter.OncePerRequestFilter.doFilte
1b80
r(OncePerRequestFilter.java:107)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)\r\n\t
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)\r\n\t
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)\r\n\t
at org.springframework.security.web.debug.DebugFilter.invokeWithWrappedRequest(DebugFilter.java:90)\r\n\t
at org.springframework.security.web.debug.DebugFilter.doFilter(DebugFilter.java:77)\r\n\t
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)\r\n\t
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\t
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)\r\n\t
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\r\n\t
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)\r\n\t
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)\r\n\t
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)\r\n\t
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)\r\n\t
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)\r\n\t
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)\r\n\t
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407)\r\n\t
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)\r\n\t
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)\r\n\t
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376)\r\n\t
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\r\n\t
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\t
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\t
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\r\n\t
at java.lang.Thread.run(Thread.java:744)\r\nCaused by: javax.persistence.RollbackException: Error while committing the transaction\r\n\t
at org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:75)\r\n\t
at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:71)\r\n\t
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517)\r\n\t... 90 more\r\nCaused by: java.lang.NullPointerException\r\n\t
at org.hibernate.engine.internal.StatefulPersistenceContext.getLoadedCollectionOwnerOrNull(StatefulPersistenceContext.java:788)\r\n\t
at org.hibernate.event.spi.AbstractCollectionEvent.getLoadedOwnerOrNull(AbstractCollectionEvent.java:58)\r\n\t
at org.hibernate.event.spi.InitializeCollectionEvent.<init>(InitializeCollectionEvent.java:22)\r\n\t
at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:2174)\r\n\t
at org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:565)\r\n\t
at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:247)\r\n\t
at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:561)\r\n\t
at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:132)\r\n\t
at org.hibernate.collection.internal.PersistentBag.iterator(PersistentBag.java:277)\r\n\t
at org.hibernate.search.engine.spi.AbstractDocumentBuilder.appendContainedInWorkForInstance(AbstractDocumentBuilder.java:214)\r\n\t
at org.hibernate.search.engine.impl.WorkPlan$PerEntityWork.processContainedIn(WorkPlan.java:548)\r\n\t
at org.hibernate.search.engine.impl.WorkPlan$PerClassWork.processContainedInAndPrepareExecution(WorkPlan.java:309)\r\n\t
at org.hibernate.search.engine.impl.WorkPlan.processContainedInAndPrepareExecution(WorkPlan.java:136)\r\n\t
at org.hibernate.search.backend.impl.WorkQueue.prepareWorkPlan(WorkQueue.java:113)\r\n\t
at org.hibernate.search.backend.impl.BatchedQueueingProcessor.prepareWorks(BatchedQueueingProcessor.java:54)\r\n\t
at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.beforeCompletion(PostTransactionWorkQueueSynchronization.java:66)\r\n\t
at org.hibernate.search.event.impl.EventSourceTransactionContext$DelegateToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTransactionContext.java:169)\r\n\t
at org.hibernate.engine.spi.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:932)\r\n\t
at org.hibernate.engine.spi.ActionQueue.beforeTransactionCompletion(ActionQueue.java:507)\r\n\t
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2405)\r\n\t
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:467)\r\n\t
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:146)\r\n\t
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38)\r\n\t
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:220)\r\n\t
at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:68)\r\n\t... 91 more\r\n","stackTraceLine":"ClassName:org.springframework.orm.jpa.JpaTransactionManager MethodName:doCommit 

#7

The error is the following:

Caused by: java.lang.NullPointerException
at org.hibernate.engine.internal.StatefulPersistenceContext.getLoadedCollectionOwnerOrNull(StatefulPersistenceContext.java:788)
at org.hibernate.event.spi.AbstractCollectionEvent.getLoadedOwnerOrNull(AbstractCollectionEvent.java:58)
at org.hibernate.event.spi.InitializeCollectionEvent.&lt;init&gt;(InitializeCollectionEvent.java:22)\r\n\t at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:2174)
at org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:565)
at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:247)
at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:561)
at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:132)

Can you try to upgrade to the latest 5.2.x (5.2.17) and see if you still have the issue?

I can see very old references to this type of issues but they apparently have already been fixed so it’s weird you encounter them.

Do you use bytecode enhancement?

Could you try to reproduce it with our test case template: https://github.com/hibernate/hibernate-test-case-templates/tree/master/orm/hibernate-orm-5 ? (Set the ORM version to the version you are using first so that you are able to reproduce the issue for sure).


#8

I updated the hibernate orm version to 5.2.17.Now I have the following error.
Note : When I turn off HibernateSearch, deletion is performed successfully.

{"id":4966,"customExceptionDetailModelList":[{"id":5276,"message":{"error":"Error while indexing in Hibernate Search (before transaction completion); nested exception is org.hibernate.HibernateException: Error while indexing in Hibernate Search (before transaction completion)"},"stackTrace":"org.springframework.orm.jpa.JpaSystemException: Error while indexing in Hibernate Search (before transaction completion); nested exception is org.hibernate.HibernateException: Error while indexing in Hibernate Search (before transaction completion)\r\n\t
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:333)\r\n\t
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)\r\n\t
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:521)\r\n\t
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)\r\n\t
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)\r\n\t
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:504)\r\n\t
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:292)\r\n\t
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)\r\n\t
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)\r\n\t
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)\r\n\t
at org.org.ServiceImpl$$EnhancerBySpringCGLIB$$953424a8.delete(<generated>)\r\n\t
at org.org.warehouseDelete(EShopOrchServiceImpl.java:1249)\r\n\t
at org.org.controller.WarehouseController.delete(WarehouseController.java:215)\r\n\t
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\t
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\t
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\t
at java.lang.reflect.Method.invoke(Method.java:483)\r\n\t
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)\r\n\t
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)\r\n\t
at org.springframework.web.servlet.mvc.method.annot
ation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)\r\n\t
at org.springframework.web.servlet.mvc.method.annot
ation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)\r\n\t
at org.springframework.web.servlet.mvc.method.annot
ation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)\r\n\t
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)\r\n\t
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)\r\n\t
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)\r\n\t
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)\r\n\t
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)\r\n\t
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)\r\n\t
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)\r\n\t
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\t
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)\r\n\t
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\t
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)\r\n\t
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)\r\n\t
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:176)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)\r\n\t
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\
1c4b
t
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)\r\n\t
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)\r\n\t
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\t
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\r\n\t
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)\r\n\t
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)\r\n\t
at org.springframework.security.web.debug.DebugFilter.invokeWithWrappedRequest(DebugFilter.java:90)\r\n\t
at org.springframework.security.web.debug.DebugFilter.doFilter(DebugFilter.java:77)\r\n\t
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)\r\n\t
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\r\n\t
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\r\n\t
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)\r\n\t
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\r\n\t
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)\r\n\t
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)\r\n\t
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)\r\n\t
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)\r\n\t
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)\r\n\t
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)\r\n\t
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407)\r\n\t
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)\r\n\t
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)\r\n\t
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376)\r\n\t
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\r\n\t
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\t
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\t
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\r\n\t
at java.lang.Thread.run(Thread.java:744)\r\nCaused by: org.hibernate.HibernateException: Error while indexing in Hibernate Search (before transaction completion)\r\n\t
at org.hibernate.search.event.impl.EventSourceTransactionContext$DelegateToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTransactionContext.java:172)\r\n\t
at org.hibernate.engine.spi.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:946)\r\n\t
at org.hibernate.engine.spi.ActionQueue.beforeTransactionCompletion(ActionQueue.java:521)\r\n\t
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2452)\r\n\t
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:473)\r\n\t
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:156)\r\n\t
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38)\r\n\t
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:231)\r\n\t
at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:68)\r\n\t
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517)\r\n\t... 90 more\r\nCaused by: java.lang.NullPointerException\r\n\t
at org.hibernate.engine.internal.St
atefulPersistenceContext.getLoadedCollectionOwnerOrNull(St
atefulPersistenceContext.java:788)\r\n\t
at org.hibernate.event.spi.AbstractCollectionEvent.getLoadedOwnerOrNull(AbstractCollectionEvent.java:58)\r\n\t
at org.hibernate.event.spi.InitializeCollectionEvent.<init>(InitializeCollectionEvent.java:22)\r\n\t
at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:2221)\r\n\t
at org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:565)\r\n\t
at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:247)\r\n\t
at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:561)\r\n\t
at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:132)\r\n\t
at org.hibernate.collection.internal.PersistentBag.iterator(PersistentBag.java:277)\r\n\t
at org.hibernate.search.engine.spi.AbstractDocumentBuilder.appendContainedInWorkForInstance(AbstractDocumentBuilder.java:214)\r\n\t
at org.hibernate.search.engine.impl.WorkPlan$PerEntityWork.processContainedIn(WorkPlan.java:548)\r\n\t
at org.hibernate.search.engine.impl.WorkPlan$PerClassWork.processContainedInAndPrepareExecution(WorkPlan.java:309)\r\n\t
at org.hibernate.search.engine.impl.WorkPlan.processContainedInAndPrepareExecution(WorkPlan.java:136)\r\n\t
at org.hibernate.search.backend.impl.WorkQueue.prepareWorkPlan(WorkQueue.java:113)\r\n\t
at org.hibernate.search.backend.impl.BatchedQueueingProcessor.prepareWorks(BatchedQueueingProcessor.java:54)\r\n\t
at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.beforeCompletion(PostTransactionWorkQueueSynchronization.java:66)\r\n\t
at org.hibernate.search.event.impl.EventSourceTransactionContext$DelegateToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTransactionContext.java:169)\r\n\t... 99 more\r\n","stackTraceLine":"ClassName:org.springframework.orm.jpa.vendor.HibernateJpaDialect MethodName:convertHibernateAccessException 

#9

Try to reproduce it inside our test case template so that we have a reproducer.

You have one for Search here: https://github.com/hibernate/hibernate-test-case-templates/tree/master/search/hibernate-search-lucene .


#10

The scale of my project is big and i cant reproduce it with your test case.


#11

Try to check which entity (class + id) it concerns with a breakpoint. Then you should be able to extract this entity from your code and create a test case.

We can’t really help you if we can’t reproduce the issue.