I am not sure if this makes sense, so I will be very grateful if someone can confirm that they are Ok. My understanding is that lucene is building a huge index file without flushing and I am hitting the TimOut setting (currently 28 800). With these parameters my aim is to force flushing (hibernate.search.default.batch. max_buffered_docs">64) and avoid reaching the time out (I have returned the TimeOut to 3600).

[2016-09-08 13:08:54,223] ERROR [eu.europa.ec.estat.egr.is.view] Unexpected error occurred java.net.SocketException: Connection reset at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at weblogic.utils.io.ChunkedOutputStream.writeTo(ChunkedOutputStream.java:284) at weblogic.servlet.internal.ServletOutputStreamImpl.writeHeader(ServletOutputStreamImpl.java:167) at weblogic.servlet.internal.ResponseHeaders.writeHeaders(ResponseHeaders.java:444) at weblogic.servlet.internal.ServletResponseImpl.writeHeaders(ServletResponseImpl.java:1288) at weblogic.servlet.internal.ServletOutputStreamImpl.sendHeaders(ServletOutputStreamImpl.java:281) at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:424) at weblogic.servlet.internal.CharsetChunkOutput.flush(CharsetChunkOutput.java:298) at weblogic.servlet.internal.ChunkOutput$2.checkForFlush(ChunkOutput.java:648) at weblogic.servlet.internal.CharsetChunkOutput.write(CharsetChunkOutput.java:200) at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:148) at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:148) at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.writeStaticResourceResponse(AbstractApplicationServlet.java:1373) at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.serveStaticResourcesInVAADIN(AbstractApplicationServlet.java:1350) at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.serveStaticResources(AbstractApplicationServlet.java:1251) at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:423) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60) at eu.europa.ec.estat.egr.is.filter.MaintenanceModeFilter.doFilter(MaintenanceModeFilter.java:35) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60) at eu.europa.ec.estat.egr.is.filter.MDCUserServletFilter.doFilter(MDCUserServletFilter.java:36) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60) at eu.europa.ec.estat.egr.is.filter.WelcomePageFilter.doFilter(WelcomePageFilter.java:39) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60) at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:60) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3748) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3714) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2283) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2182) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1499) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:263) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)[2016-09-08 13:43:15,209] bbb WARN [org.hibernate.engine.loading.LoadContexts] fail-safe cleanup (collections) : org.hibernate.engine.loading.CollectionLoadContext@1ffe51c8<rs=weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl@792ec> [2016-09-08 13:43:15,210] bbb WARN [org.hibernate.engine.loading.CollectionLoadContext] On CollectionLoadContext#cleanup, localLoadingCollectionKeys contained [2] entries [2016-09-08 13:43:45,288] WARN [org.springframework.integration.channel.MessagePublishingErrorHandler] Error message was not delivered. java.lang.OutOfMemoryError: allocLargeObjectOrArray: [B, size 2832 at java.util.jar.Attributes.read(Attributes.java:377) at java.util.jar.Manifest.read(Manifest.java:180) at java.util.jar.Manifest.<init>(Manifest.java:50) at java.util.jar.JarFile.getManifestFromReference(JarFile.java:168) at java.util.jar.JarFile.getManifest(JarFile.java:149) at weblogic.utils.classloaders.JarSource.getManifest(JarSource.java:21) at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:319) at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:302) at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270) at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43) at org.springframework.integration.util.MessagingMethodInvokerHelper.findClosestMatch(MessagingMethodInvokerHelper.java:387) at org.springframework.integration.util.MessagingMethodInvokerHelper.findHandlerMethodsForParameters(MessagingMethodInvokerHelper.java:376) at org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:220) at org.springframework.integration.util.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:127) at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:73) at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:67) at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:134) at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73) at org.springframework.integration.dispatcher.BroadcastingDispatcher.invokeHandler(BroadcastingDispatcher.java:121) at org.springframework.integration.dispatcher.BroadcastingDispatcher.dispatch(BroadcastingDispatcher.java:112) at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77) at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157) at org.springframework.integration.channel.MessagePublishingErrorHandler.handleError(MessagePublishingErrorHandler.java:83) at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:55) at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48) at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49) at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:231) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51) at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662)[2016-09-08 13:43:47,077] ERROR [org.springframework.integration.channel.

so it looks like you're running with container managed transactions, specifically managed by WebLogic.But you're also running a quite old version of Hibernate Search: 3.4.0.Final. That version is unable to control the timeout of the container, so it will eventually timeout when indexing large datasets.

I would suggest to use a more recent version, as e.g. version 5.5.x is able to keep the container managed transaction alive for as long as it needs - although we tested this only on WildFly, I don't have a WebLogic instance to test it but it's using a standard API to accomplish this so I expect it to work equally well.

As an alternative to upgrading the dependencies you might want to reconfigure your transaction timeout to be large enough for the indexing to be able to complete; this would affect all your transactions though.

In the first stack trace you posted there also is an OutOfMemory exception. You probably want to monitor the JVM for memory usage: when it is running low on memory the indexing process will take significantly longer.