I have got a strange problem with Adobe CQ5 versioning.
I'm doing two different operations(one is adding and the other updates) using the same user login.
28.07.2017 06:30:52.846 *ERROR* [Response--12] [publishing.create.commentary.PSI43457815.int-emp] com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl Update publication failed com.ubs.f35.content.sdk.data.DaoException: com.day.cq.wcm.api.WCMException: Unable to create version.
at com.ubs.f35.content.cms.publishing.internal.dao.publication.PublicationDaoImpl.updatePublication(PublicationDaoImpl.java:208)
at com.ubs.f35.content.cms.publishing.internal.dao.publication.PublicationDaoImpl$$FastClassByCGLIB$$b8ac430f.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at com.ubs.f35.content.cms.common.aop.StopwatchMethodInterceptor.invoke(StopwatchMethodInterceptor.java:21)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at com.ubs.f35.content.sdk.session.SessionRequiredInterceptor.executeMethod(SessionRequiredInterceptor.java:106)
at com.ubs.f35.content.sdk.session.SessionRequiredInterceptor.invoke(SessionRequiredInterceptor.java:71)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.ubs.f35.content.cms.publishing.internal.dao.publication.PublicationDaoImpl$$EnhancerByCGLIB$$d66ec20a.updatePublication(<generated>)
at com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl.unpermissionedUpdatePublicationInternal(PublicationServiceImpl.java:345)
at com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl.updatePublicationInternal(PublicationServiceImpl.java:322)
at com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl.updateSalesCommentary(PublicationServiceImpl.java:226)
at com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl$$FastClassByCGLIB$$7c3b2aad.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at com.ubs.f35.content.cms.common.aop.StopwatchMethodInterceptor.invoke(StopwatchMethodInterceptor.java:21)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at com.ubs.f35.content.sdk.session.SessionRequiredInterceptor.executeMethod(SessionRequiredInterceptor.java:106)
at com.ubs.f35.content.sdk.session.SessionRequiredInterceptor.invoke(SessionRequiredInterceptor.java:71)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl$$EnhancerByCGLIB$$449170e6.updateSalesCommentary(<generated>)
at com.ubs.f35.content.cms.publishing.internal.messaging.publication.PublishPublicationMessageProcessor.updatePublication(PublishPublicationMessageProcessor.java:92)
at com.ubs.f35.content.cms.publishing.internal.messaging.publication.PublishPublicationMessageProcessor.handleObject(PublishPublicationMessageProcessor.java:44)
at com.ubs.f35.content.messaging.AbstractMessageProcessor.invoke(AbstractMessageProcessor.java:61)
at com.ubs.f35.content.messaging.AbstractMessageProcessor$$FastClassByCGLIB$$6f62e747.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:617)
at com.ubs.f35.content.cms.publishing.internal.messaging.publication.PublishPublicationMessageProcessor$$EnhancerByCGLIB$$c3ef3346.invoke(<generated>)
at com.ubs.f35.common.transport.events.lbm.ReceiveReplyCallbackHandler.processMessage(ReceiveReplyCallbackHandler.java:119)
at com.ubs.f35.common.transport.events.threadpool.ThreadPoolReceiveReplyCallbackHandler.access$001(ThreadPoolReceiveReplyCallbackHandler.java:11)
at com.ubs.f35.common.transport.events.threadpool.ThreadPoolReceiveReplyCallbackHandler$1.run(ThreadPoolReceiveReplyCallbackHandler.java:31)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at com.day.cq.wcm.core.impl.PageManagerImpl.createRevision(PageManagerImpl.java:1027)
at com.ubs.f35.content.cms.publishing.internal.dao.publication.PublicationTemplate.createRevision(PublicationTemplate.java:410)
at com.ubs.f35.content.cms.publishing.internal.dao.publication.PublicationDaoImpl.updatePublication(PublicationDaoImpl.java:205)
... 38 more
Caused by: javax.jcr.RepositoryException: org.apache.jackrabbit.core.state.StaleItemStateException: 124a7e07-1345-4bf7-81d2-c3c625ed62bc/{http://www.jcp.org/jcr/1.0}isCheckedOut has been modified externally
at org.apache.jackrabbit.core.version.VersionManagerImplBase.checkoutCheckin(VersionManagerImplBase.java:218)
at org.apache.jackrabbit.core.VersionManagerImpl.access$300(VersionManagerImpl.java:73)
at org.apache.jackrabbit.core.VersionManagerImpl$2.perform(VersionManagerImpl.java:142)
at org.apache.jackrabbit.core.VersionManagerImpl$2.perform(VersionManagerImpl.java:135)
at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:200)
at org.apache.jackrabbit.core.VersionManagerImpl.perform(VersionManagerImpl.java:96)
at org.apache.jackrabbit.core.VersionManagerImpl.checkout(VersionManagerImpl.java:135)
at org.apache.jackrabbit.core.NodeImpl.checkout(NodeImpl.java:2875)
at com.day.cq.wcm.core.impl.PageManagerImpl.createRevision(PageManagerImpl.java:1094)
... 41 more
Caused by: org.apache.jackrabbit.core.state.StaleItemStateException: 124a7e07-1345-4bf7-81d2-c3c625ed62bc/{http://www.jcp.org/jcr/1.0}isCheckedOut has been modified externally
at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:670)
at org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:1473)
at org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:1503)
at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:398)
at org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:354)
at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:373)
at org.apache.jackrabbit.core.version.VersionManagerImplBase$WriteOperation.save(VersionManagerImplBase.java:469)
at org.apache.jackrabbit.core.version.VersionManagerImplBase.checkoutCheckin(VersionManagerImplBase.java:215)
... 49 more
28.07.2017 06:30:52.846 *DEBUG* [Response--12] [STOPWATCH] com.ubs.f35.content.cms.common.aop.StopwatchMethodInterceptor PublicationServiceImpl.updateSalesCommentary=14m 27s
28.07.2017 06:30:52.847 *DEBUG* [Response--12] [null] com.ubs.f35.content.sdk.session.SessionRequiredInterceptor Ending transaction
28.07.2017 06:30:52.847 *ERROR* [Response--12] [null] com.ubs.f35.content.messaging.AbstractMessageProcessor 612ed2de-e27b-4f21-9039-46c40435a469 Invoke failed with code: SERVICE_ERROR com.ubs.f35.content.messaging.service.ServiceException: Update publication failed
at com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl.unpermissionedUpdatePublicationInternal(PublicationServiceImpl.java:353)
at com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl.updatePublicationInternal(PublicationServiceImpl.java:322)
at com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl.updateSalesCommentary(PublicationServiceImpl.java:226)
at com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl$$FastClassByCGLIB$$7c3b2aad.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at com.ubs.f35.content.cms.common.aop.StopwatchMethodInterceptor.invoke(StopwatchMethodInterceptor.java:21)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at com.ubs.f35.content.sdk.session.SessionRequiredInterceptor.executeMethod(SessionRequiredInterceptor.java:106)
at com.ubs.f35.content.sdk.session.SessionRequiredInterceptor.invoke(SessionRequiredInterceptor.java:71)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl$$EnhancerByCGLIB$$449170e6.updateSalesCommentary(<generated>)
at com.ubs.f35.content.cms.publishing.internal.messaging.publication.PublishPublicationMessageProcessor.updatePublication(PublishPublicationMessageProcessor.java:92)
at com.ubs.f35.content.cms.publishing.internal.messaging.publication.PublishPublicationMessageProcessor.handleObject(PublishPublicationMessageProcessor.java:44)
at com.ubs.f35.content.messaging.AbstractMessageProcessor.invoke(AbstractMessageProcessor.java:61)
at com.ubs.f35.content.messaging.AbstractMessageProcessor$$FastClassByCGLIB$$6f62e747.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:617)
at com.ubs.f35.content.cms.publishing.internal.messaging.publication.PublishPublicationMessageProcessor$$EnhancerByCGLIB$$c3ef3346.invoke(<generated>)
at com.ubs.f35.common.transport.events.lbm.ReceiveReplyCallbackHandler.processMessage(ReceiveReplyCallbackHandler.java:119)
at com.ubs.f35.common.transport.events.threadpool.ThreadPoolReceiveReplyCallbackHandler.access$001(ThreadPoolReceiveReplyCallbackHandler.java:11)
at com.ubs.f35.common.transport.events.threadpool.ThreadPoolReceiveReplyCallbackHandler$1.run(ThreadPoolReceiveReplyCallbackHandler.java:31)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.ubs.f35.content.sdk.data.DaoException: com.day.cq.wcm.api.WCMException: Unable to create version.
at com.ubs.f35.content.cms.publishing.internal.dao.publication.PublicationDaoImpl.updatePublication(PublicationDaoImpl.java:208)
at com.ubs.f35.content.cms.publishing.internal.dao.publication.PublicationDaoImpl$$FastClassByCGLIB$$b8ac430f.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at com.ubs.f35.content.cms.common.aop.StopwatchMethodInterceptor.invoke(StopwatchMethodInterceptor.java:21)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at com.ubs.f35.content.sdk.session.SessionRequiredInterceptor.executeMethod(SessionRequiredInterceptor.java:106)
at com.ubs.f35.content.sdk.session.SessionRequiredInterceptor.invoke(SessionRequiredInterceptor.java:71)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.ubs.f35.content.cms.publishing.internal.dao.publication.PublicationDaoImpl$$EnhancerByCGLIB$$d66ec20a.updatePublication(<generated>)
at com.ubs.f35.content.cms.publishing.internal.service.PublicationServiceImpl.unpermissionedUpdatePublicationInternal(PublicationServiceImpl.java:345)
... 26 more
Caused by: com.day.cq.wcm.api.WCMException: Unable to create version.
at com.day.cq.wcm.core.impl.PageManagerImpl.createRevision(PageManagerImpl.java:1145)
at com.day.cq.wcm.core.impl.PageManagerImpl.createRevision(PageManagerImpl.java:1027)
at com.ubs.f35.content.cms.publishing.internal.dao.publication.PublicationTemplate.createRevision(PublicationTemplate.java:410)
at com.ubs.f35.content.cms.publishing.internal.dao.publication.PublicationDaoImpl.updatePublication(PublicationDaoImpl.java:205)
... 38 more
Caused by: javax.jcr.RepositoryException: org.apache.jackrabbit.core.state.StaleItemStateException: 124a7e07-1345-4bf7-81d2-c3c625ed62bc/{http://www.jcp.org/jcr/1.0}isCheckedOut has been modified externally
at org.apache.jackrabbit.core.version.VersionManagerImplBase.checkoutCheckin(VersionManagerImplBase.java:218)
at org.apache.jackrabbit.core.VersionManagerImpl.access$300(VersionManagerImpl.java:73)
at org.apache.jackrabbit.core.VersionManagerImpl$2.perform(VersionManagerImpl.java:142)
at org.apache.jackrabbit.core.VersionManagerImpl$2.perform(VersionManagerImpl.java:135)
at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:200)
at org.apache.jackrabbit.core.VersionManagerImpl.perform(VersionManagerImpl.java:96)
at org.apache.jackrabbit.core.VersionManagerImpl.checkout(VersionManagerImpl.java:135)
at org.apache.jackrabbit.core.NodeImpl.checkout(NodeImpl.java:2875)
at com.day.cq.wcm.core.impl.PageManagerImpl.createRevision(PageManagerImpl.java:1094)
... 41 more
Caused by: org.apache.jackrabbit.core.state.StaleItemStateException: 124a7e07-1345-4bf7-81d2-c3c625ed62bc/{http://www.jcp.org/jcr/1.0}isCheckedOut has been modified externally
at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:670)
at org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:1473)
at org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:1503)
at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:398)
at org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:354)
at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:373)
at org.apache.jackrabbit.core.version.VersionManagerImplBase$WriteOperation.save(VersionManagerImplBase.java:469)
at org.apache.jackrabbit.core.version.VersionManagerImplBase.checkoutCheckin(VersionManagerImplBase.java:215)
... 49 more
I believe that concurrent access might be the issue as the user is trying to update before the add operation even succeeds(we have got a pipeline that does the job of saving under the hood,but to the user, we show that the add operation is successful beforehand). We've also implemented thread locking mechanism so that only one operation(add/update) can be allowed at a time.
As a workaround, we've also tried to refresh the JCR session for the user using session.refresh method so that the state of the item can be updated before saving.
But nothing seems to be working.
Any help will be highly appreciated.
Related
In our java application We have got an exception like
ERROR net.acs.sdd.pkop.bo.TreatmentMessageDispatcher - could not execute query
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2231)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
at org.hibernate.loader.Loader.list(Loader.java:2120)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.jbpm.pvm.internal.query.AbstractQuery.execute(AbstractQuery.java:88)
at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.execute(ProcessDefinitionQueryImpl.java:65)
at org.jbpm.pvm.internal.query.AbstractQuery.untypedList(AbstractQuery.java:64)
at org.jbpm.pvm.internal.query.AbstractQuery.untypedUniqueResult(AbstractQuery.java:68)
at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.uniqueResult(ProcessDefinitionQueryImpl.java:145)
at org.jbpm.pvm.internal.repository.RepositorySessionImpl.findProcessDefinitionByKey(RepositorySessionImpl.java:143)
at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:57)
at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:37)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.jta.JtaTransactionInterceptor.executeInExistingTx(JtaTransactionInterceptor.java:65)
at org.jbpm.pvm.internal.tx.jta.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:51)
at org.jbpm.pvm.internal.tx.jta.JtaRetryInterceptor.executeWithoutRetry(JtaRetryInterceptor.java:56)
at org.jbpm.pvm.internal.tx.jta.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:48)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:78)
at net.acs.sdd.scvv.bo.BaseBusinessProcessor.startProcess(BaseBusinessProcessor.java:209)
at net.acs.sdd.scvv.bo.BaseBusinessProcessor.startProcess(BaseBusinessProcessor.java:203)
at net.acs.sdd.scvv.bo.command.StartProcessCommand.execute(StartProcessCommand.java:25)
at net.acs.sdd.pkop.bo.command.GnivcRtuDecisionCommand.execute(GnivcRtuDecisionCommand.java:49)
at net.acs.sdd.scvv.bo.MessageDispatcher.processInputMessageObject(MessageDispatcher.java:175)
at net.acs.sdd.scvv.bo.MessageDispatcher.processInputMessage(MessageDispatcher.java:130)
at net.acs.sdd.scvv.bo.MessageDispatcher.processInputMessage(MessageDispatcher.java:101)
at net.acs.sdd.scvv.bo.RollbackMessageDispatcher.processInputMessage(RollbackMessageDispatcher.java:55)
at net.acs.sdd.scvv.transport.BaseMessageReceiver.processInputMessage(BaseMessageReceiver.java:66)
at net.acs.sdd.scvv.transport.SCVVMessageReceiver.onMessageInternal(SCVVMessageReceiver.java:135)
at net.acs.sdd.scvv.transport.BaseMessageReceiver.onMessage(BaseMessageReceiver.java:39)
at sun.reflect.GeneratedMethodAccessor119.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy10.onMessage(Unknown Source)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:243)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1096)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1088)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:985)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.sql.SQLException: javax.resource.ResourceException: SystemException: Failed to add the resource due to error in the resource : oracle.jdbc.xa.OracleXAException errorcode : -7
at oracle.oc4j.sql.spi.ManagedConnectionImpl.setupTransaction(ManagedConnectionImpl.java:841)
at oracle.oc4j.sql.spi.ConnectionHandle.oc4j_intercept(ConnectionHandle.java:305)
at oracle_jdbc_driver_LogicalConnection_Proxy.prepareStatement()
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
at org.hibernate.loader.Loader.doQuery(Loader.java:696)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
at org.hibernate.loader.Loader.doList(Loader.java:2228)
... 54 more
Caused by: javax.resource.ResourceException: SystemException: Failed to add the resource due to error in the resource : oracle.jdbc.xa.OracleXAException errorcode : -7
at com.evermind.server.connector.ConnectionContext.setupForJTATransaction(ConnectionContext.java:378)
at com.evermind.server.connector.ConnectionContext.setupForTransaction(ConnectionContext.java:303)
at com.evermind.server.connector.ConnectionContext.setupForTransaction(ConnectionContext.java:288)
at com.evermind.server.connector.ApplicationConnectionManager.lazyEnlist(ApplicationConnectionManager.java:2149)
at oracle.j2ee.connector.OracleConnectionManager.lazyEnlist(OracleConnectionManager.java:312)
at oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.enlist(ManagedConnectionFactoryImpl.java:532)
at oracle.oc4j.sql.spi.ManagedConnectionImpl.setupTransaction(ManagedConnectionImpl.java:839)
... 63 more
And I don't know how to find any connection with that 'errorcode : -7'
I went into OracleXAException to find, at least some decription. And there is
public static final int XA_HEURCOM = 7;
and if I found correct this is description of my error.
But it doesn't help me.
Which way should I follow to find the root of that exception, Could some help me with that?
P.S.
And, also I want to add, that we have working application.That exception happened in the middle of a day and after that were also about 10 exceptions like that but after them there were not exceptions in log.
I've written a spring batch application that uses JPA+ Hibernate model for read-write operations.
I'm getting OutOfmemory error due to hibernateSessionImpl object.
I'm using JPA entity manager factory: org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
as a singleton bean configured in spring.xml
Error:
java.lang.OutOfMemoryError
at java.util.HashMap.createHashedEntry(HashMap.java:650)
at java.util.HashMap.putImpl(HashMap.java:629)
at java.util.HashMap.put(HashMap.java:605)
at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:366)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:960)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
at $Proxy43.flush(Unknown Source)
at com.bunge.portal.core.dao.jpa.RssGenericDaoJpaImpl.create(RssGenericDaoJpaImpl.java:200)
at com.bunge.portal.rss.repository.RssFeedContentCacheRepositoryImpl.create(RssFeedContentCacheRepositoryImpl.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy44.create(Unknown Source)
at com.bunge.portal.rss.service.RssFeedServiceImpl.createRssFeedContentCache(RssFeedServiceImpl.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
15:22:08,023 ERROR AbstractStep:212 - Encountered an error executing the step
org.springframework.batch.core.JobExecutionException: Partition handler returned an unsuccessful step
at org.springframework.batch.core.partition.support.PartitionStep.doExecute(PartitionStep.java:110)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:195)
at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:135)
at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61)
at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60)
at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144)
at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124)
at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:135)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:281)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48)
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:114)
at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:349)
at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:574)
The problem was we were fetching 8000 records in one of the queries and using only first record. The batch was running successfully as the number of records in table were less, but as time passed the total records were too many and it was overflowing the heap memory,i changed the query to fetch only one record the latest one and it works fine....
Thanks for you help everyone..!!
When generating the reports using the DynamicJasper API, the below exception is getting thrown. In my logic, around 5000 to 10000 reports will be generating in single execution.
Due to this exception, the report generation exception is totally blocked. Please suggest how to fix this solution without increasing the ulimit option as we can not increase depends on the no.of reports.
net.sf.jasperreports.engine.JRException: Error compiling report java source files : /home/gscsfo/Report_1409558503418_133890.java
com.bnp.scm.services.common.exception.BNPApplicationException: net.sf.jasperreports.engine.JRException: Error compiling report java source files : /home/gscsfo/Report_1409558503418_133890.java
at com.bnp.scm.services.scheduler.common.SystemLogger.profile(SystemLogger.java:54)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.bnp.scm.services.scheduler.events.EmailAlertAttachment$$EnhancerByCGLIB$$3c6f687d.getPDFAttachment(<generated>)
at com.bnp.scm.services.scheduler.events.ScheduleEmailEvent.processEvent(ScheduleEmailEvent.java:1039)
at com.bnp.scm.services.scheduler.events.ScheduleEmailEvent$$FastClassByCGLIB$$84dbc7ef.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
at com.bnp.scm.services.scheduler.common.SystemLogger.profile(SystemLogger.java:54)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.bnp.scm.services.scheduler.events.ScheduleEmailEvent$$EnhancerByCGLIB$$f22c0d43.processEvent(<generated>)
at com.bnp.scm.scheduler.job.handler.EmailNotificationJob.run(EmailNotificationJob.java:52)
at com.bnp.scm.scheduler.job.AbstractJob.execute(AbstractJob.java:79)
at com.bnp.scm.scheduler.job.AbstractJob$$FastClassByCGLIB$$d1c345af.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
at com.bnp.scm.services.scheduler.common.SystemLogger.profile(SystemLogger.java:54)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at com.bnp.scm.scheduler.job.handler.EmailNotificationJob$$EnhancerByCGLIB$$b1534990.execute(<generated>)
at org.quartz.core.JobRunShell.run(JobRunShell.java:206)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:548)
Caused by: net.sf.dynamicreports.report.exception.DRException: net.sf.jasperreports.engine.JRException: Error compiling report java source files : /home/gscsfo/Report_1409558503418_133890.java
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toJasperReport(JasperReportBuilder.java:279)
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toJasperPrint(JasperReportBuilder.java:309)
at com.bnp.scm.services.scheduler.events.EmailAlertAttachment.getPDFAttachment(EmailAlertAttachment.java:183)
... 56 more
Caused by: net.sf.jasperreports.engine.JRException: Error compiling report java source files : /home/gscsfo/Report_1409558503418_133890.java
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:89)
at net.sf.jasperreports.engine.design.JRAbstractClassCompiler.compileUnits(JRAbstractClassCompiler.java:63)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:188)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:212)
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toJasperReport(JasperReportBuilder.java:276)
... 58 more
Caused by: java.io.IOException: Cannot run program "javac": java.io.IOException: error=24, Too many open files
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:466)
at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:58)
... 62 more
Caused by: java.io.IOException: java.io.IOException: error=24, Too many open files
at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
... 65 more
I'm experiencing the following exception:
java.lang.NullPointerException
at javassist.util.proxy.RuntimeSupport$DefaultMethodHandler.invoke(RuntimeSupport.java:38)
at com.Customer_$$_javassist_1.getHibernateLazyInitializer(Customer_$$_javassist_1.java)
at org.hibernate.Hibernate.isInitialized(Hibernate.java:429)
at org.hibernate.engine.StatefulPersistenceContext.reassociateIfUninitializedProxy(StatefulPersistenceContext.java:530)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.reassociateIfUninitializedProxy(DefaultSaveOrUpdateEventListener.java:99)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:82)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:685)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:677)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:673)
at org.springframework.orm.hibernate3.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:740)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:737)
at com.HibernateCustomerService.create(HibernateCustomerService.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at sun.proxy.$Proxy62.create(Unknown Source)
This tends to happen shortly after application startup under moderate/high load. Further Instantiation of the com.Customer class fail with the same exception so the application is effectively broken until we restart.
I've traced through the code and can't see how the DefaultMethodHandler would ever be invoked in theCustomer_$$_javassist_1 since it's set in the JavassistLazyInitializer.
This is on Hibernate 3.6.8-Final with javassist 3.16.1
Has anyone seen this before? Is there any workaround possible?
I may be missing something here but I cannot seem to find any docs about persisting a List of Entities using Spring Integration JPA Outbound Channel Adapter. I have an extremely simple scenario that should poll a database and copy new data across to another database. Thus:
<int-jpa:inbound-channel-adapter channel="myChannel"
entity-class="my.package.MyClass"
entity-manager="mysqlEntityManager"
auto-startup="true">
<int:poller fixed-rate="5000">
<int:transactional propagation="REQUIRED" transaction-manager="mysqlTransactionManager"/>
</int:poller>
</int-jpa:inbound-channel-adapter>
<int:channel id="myChannel" />
<int-jpa:outbound-channel-adapter channel="myChannel"
entity-class="my.package.MyClass"
entity-manager="hsqldbEntityManager">
<int-jpa:transactional transaction-manager="hsqldbTransactionManager" />
</int-jpa:outbound-channel-adapter>
The inbound-channel-adapter returns a List<MyClass> and then the outbound-channel-adapter throws the stack trace below...
How do I configure the adapter to accept a list of entites? I do not want to set max messages per poll in the inbound adapter/poller, as I would prefer minimal database operations.
Any help appreciated.
Spring docs:
http://static.springsource.org/spring-integration/docs/3.0.0.M1/reference/html/jpa.html
[task-scheduler-1] ERROR org.springframework.integration.handler.LoggingHandler - org.springframework.integration.MessageHandlingException: error occurred in message handler [org.springframework.integration.jpa.outbound.JpaOutboundGateway#165d2be]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy24.handleMessage(Unknown Source)
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:115)
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:102)
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.AbstractMessageChannel.send(AbstractMessageChannel.java:128)
at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
at org.springframework.integration.endpoint.SourcePollingChannelAdapter.handleMessage(SourcePollingChannelAdapter.java:97)
at org.springframework.integration.endpoint.AbstractTransactionSynchronizingPollingEndpoint.doPoll(AbstractTransactionSynchronizingPollingEndpoint.java:82)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy23.call(Unknown Source)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:236)
at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
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:53)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Unknown entity: java.util.ArrayList
at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:692)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
at $Proxy18.merge(Unknown Source)
at org.springframework.integration.jpa.core.DefaultJpaOperations.merge(DefaultJpaOperations.java:175)
at org.springframework.integration.jpa.core.JpaExecutor.executeOutboundJpaOperation(JpaExecutor.java:223)
at org.springframework.integration.jpa.outbound.JpaOutboundGateway.handleRequestMessage(JpaOutboundGateway.java:81)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:134)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73)
... 48 more
Caused by: org.hibernate.MappingException: Unknown entity: java.util.ArrayList
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:693)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1485)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:232)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:867)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:851)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:855)
at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:686)
... 59 more
I have created a Jira in order to make that improvement:
https://jira.springsource.org/browse/INT-3029
As a work-around you could also extend DefaultJpaOperations (org.springframework.integration.jpa.core) and customize the persist() method, allowing you to handle a Collection type parameters. For some details see:
Batch inserts with JPA/EJB3
The adapters have an XML namespace attribute jpa-operations, allowing you to provide a reference to custom implementations. For more details, please see http://static.springsource.org/spring-integration/docs/latest-ga/reference/html/jpa.html#jpa-namespace-support-common-attributes
The outbound JPA adapter doesn't currently support persisting a list of entities; feel free to open a new JIRA Issue. You can add a simple <splitter/> before the outbound adapter (no attributes, just input and output channels) and it will bust the list into individual entitities.
However, with your current configuration, each persist will be done in a separate transaction.
Regardless, you probably want to synchronize the two transactions anyway so you should really start the hsql transaction at the same time as the mysql transaction so that Spring will make best efforts to synchronize the two transactions (commit them as close together as possible).
To do that, you'd need something like the ChainedTransactionManager in the 'Best Efforts 1PC' section of Dave Syer's excellent article on this subject.
This way, each of the split entities will be committed in the same transaction.