ibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

Atlassian JIRA | Sunny Kalsi | 2 years ago
  1. 0

    Instead of returning that a token is invalid, Crowd throws an StaleStateException when a token is validated (using the REST client's {{validateSSOAuthentication}}) and invalidated (using the REST client's {{invalidateSSOToken}}) in parallel. This has no effect in practise, because the token is still treated as invalid, but it causes exceptions in our logs. The error can be fairly conveniently generated with some minor tweaks to BenchLogins in the crowd-perf repository. Relevant Exception: {noformat} [INFO] [talledLocalContainer] 2015-06-01 16:48:26,354 http-bio-8095-exec-16 ERROR [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Batch update returned unexpected row count from update [ 0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 [INFO] [talledLocalContainer] org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.h ibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:181) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:678) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:560) [INFO] [talledLocalContainer] at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755) [INFO] [talledLocalContainer] at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724) [INFO] [talledLocalContainer] at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475) [INFO] [talledLocalContainer] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:270) [INFO] [talledLocalContainer] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [INFO] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy31.validateUserToken(Unknown Source) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.service.controller.TokenController.validateToken(TokenController.java:141) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.service.resource.TokenResource.validateToken(TokenResource.java:178) [INFO] [talledLocalContainer] at sun.reflect.GeneratedMethodAccessor268.invoke(Unknown Source) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:497) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:234) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:100) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.validation.ValidationInterceptor.intercept(ValidationInterceptor.java:78) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.expand.interceptor.ExpandInterceptor.intercept(ExpandInterceptor.java:38) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper.invokeMethodWithInterceptors(DispatchProviderHelper.java:132) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker._dispatch(DispatchProviderHelper.java:230) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) [INFO] [talledLocalContainer] at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.filter.RestServiceVersionFilter.doFilter(RestServiceVersionFilter.java:86) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:97) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151) [INFO] [talledLocalContainer] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.security.BlockOpenSocialRequestFilter.doFilter(BlockOpenSocialRequestFilter.java:45) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.horde.tenant.TenantServletFilter.doFilter(TenantServletFilter.java:74) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.web.filter.HttpContextFilter.doFilter(HttpContextFilter.java:34) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [INFO] [talledLocalContainer] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [INFO] [talledLocalContainer] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [INFO] [talledLocalContainer] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [INFO] [talledLocalContainer] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [INFO] [talledLocalContainer] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) [INFO] [talledLocalContainer] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) [INFO] [talledLocalContainer] at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [INFO] [talledLocalContainer] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:745) [INFO] [talledLocalContainer] Caused by: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 [INFO] [talledLocalContainer] at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:81) [INFO] [talledLocalContainer] at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:73) [INFO] [talledLocalContainer] at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.checkRowCounts(BatchingBatch.java:141) [INFO] [talledLocalContainer] at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:118) [INFO] [talledLocalContainer] at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101) [INFO] [talledLocalContainer] at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:157) [INFO] [talledLocalContainer] at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.getBatch(JdbcCoordinatorImpl.java:196) [INFO] [talledLocalContainer] at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3187) [INFO] [talledLocalContainer] at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3138) [INFO] [talledLocalContainer] at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3468) [INFO] [talledLocalContainer] at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:140) [INFO] [talledLocalContainer] at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395) [INFO] [talledLocalContainer] at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387) [INFO] [talledLocalContainer] at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:304) [INFO] [talledLocalContainer] at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349) [INFO] [talledLocalContainer] at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56) [INFO] [talledLocalContainer] at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1159) [INFO] [talledLocalContainer] at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) [INFO] [talledLocalContainer] at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) [INFO] [talledLocalContainer] at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:552) [INFO] [talledLocalContainer] ... 91 more [INFO] [talledLocalContainer] Jun 01, 2015 4:48:26 PM com.sun.jersey.spi.container.ContainerResponse mapException [INFO] [talledLocalContainer] SEVERE: Exception mapper com.atlassian.plugins.rest.common.error.jersey.ThrowableExceptionMapper@68c52d43 for Throwable org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 threw a RuntimeException when attempting to obtain the response [INFO] [talledLocalContainer] Jun 01, 2015 4:48:26 PM com.sun.jersey.spi.container.ContainerResponse logException [INFO] [talledLocalContainer] SEVERE: Mapped exception to response: 500 (Internal Server Error) [INFO] [talledLocalContainer] java.lang.IllegalStateException [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.ThreadLocalHttpContext.getRequest(ThreadLocalHttpContext.java:82) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl$2.invoke(WebApplicationImpl.java:286) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy49.selectVariant(Unknown Source) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.error.jersey.UncaughtExceptionEntity.variantFor(UncaughtExceptionEntity.java:85) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.error.jersey.ThrowableExceptionMapper.toResponse(ThrowableExceptionMapper.java:49) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.ContainerResponse.mapException(ContainerResponse.java:463) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.ContainerResponse.mapMappableContainerException(ContainerResponse.java:400) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1446) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) [INFO] [talledLocalContainer] at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.filter.RestServiceVersionFilter.doFilter(RestServiceVersionFilter.java:86) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:97) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.horde.filters.SysadminPasswordExpiryServletFilter.doFilter(SysadminPasswordExpiryServletFilter.java:51) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.horde.analytics.HttpRequestAnalyticsFilter.doFilter(HttpRequestAnalyticsFilter.java:51) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151) [INFO] [talledLocalContainer] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.security.BlockOpenSocialRequestFilter.doFilter(BlockOpenSocialRequestFilter.java:45) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.horde.tenant.TenantServletFilter.doFilter(TenantServletFilter.java:74) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.web.filter.HttpContextFilter.doFilter(HttpContextFilter.java:34) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [INFO] [talledLocalContainer] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [INFO] [talledLocalContainer] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [INFO] [talledLocalContainer] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [INFO] [talledLocalContainer] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [INFO] [talledLocalContainer] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) [INFO] [talledLocalContainer] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) [INFO] [talledLocalContainer] at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [INFO] [talledLocalContainer] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:745) {noformat}

    Atlassian JIRA | 2 years ago | Sunny Kalsi
    ibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
  2. 0

    Instead of returning that a token is invalid, Crowd throws an StaleStateException when a token is validated (using the REST client's {{validateSSOAuthentication}}) and invalidated (using the REST client's {{invalidateSSOToken}}) in parallel. This has no effect in practise, because the token is still treated as invalid, but it causes exceptions in our logs. The error can be fairly conveniently generated with some minor tweaks to BenchLogins in the crowd-perf repository. Relevant Exception: {noformat} [INFO] [talledLocalContainer] 2015-06-01 16:48:26,354 http-bio-8095-exec-16 ERROR [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Batch update returned unexpected row count from update [ 0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 [INFO] [talledLocalContainer] org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.h ibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:181) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:678) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:560) [INFO] [talledLocalContainer] at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755) [INFO] [talledLocalContainer] at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724) [INFO] [talledLocalContainer] at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475) [INFO] [talledLocalContainer] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:270) [INFO] [talledLocalContainer] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [INFO] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy31.validateUserToken(Unknown Source) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.service.controller.TokenController.validateToken(TokenController.java:141) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.service.resource.TokenResource.validateToken(TokenResource.java:178) [INFO] [talledLocalContainer] at sun.reflect.GeneratedMethodAccessor268.invoke(Unknown Source) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:497) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:234) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:100) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.validation.ValidationInterceptor.intercept(ValidationInterceptor.java:78) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.expand.interceptor.ExpandInterceptor.intercept(ExpandInterceptor.java:38) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper.invokeMethodWithInterceptors(DispatchProviderHelper.java:132) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker._dispatch(DispatchProviderHelper.java:230) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) [INFO] [talledLocalContainer] at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.filter.RestServiceVersionFilter.doFilter(RestServiceVersionFilter.java:86) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:97) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151) [INFO] [talledLocalContainer] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.security.BlockOpenSocialRequestFilter.doFilter(BlockOpenSocialRequestFilter.java:45) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.horde.tenant.TenantServletFilter.doFilter(TenantServletFilter.java:74) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.web.filter.HttpContextFilter.doFilter(HttpContextFilter.java:34) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [INFO] [talledLocalContainer] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [INFO] [talledLocalContainer] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [INFO] [talledLocalContainer] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [INFO] [talledLocalContainer] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [INFO] [talledLocalContainer] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) [INFO] [talledLocalContainer] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) [INFO] [talledLocalContainer] at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [INFO] [talledLocalContainer] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:745) [INFO] [talledLocalContainer] Caused by: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 [INFO] [talledLocalContainer] at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:81) [INFO] [talledLocalContainer] at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:73) [INFO] [talledLocalContainer] at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.checkRowCounts(BatchingBatch.java:141) [INFO] [talledLocalContainer] at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:118) [INFO] [talledLocalContainer] at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101) [INFO] [talledLocalContainer] at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:157) [INFO] [talledLocalContainer] at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.getBatch(JdbcCoordinatorImpl.java:196) [INFO] [talledLocalContainer] at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3187) [INFO] [talledLocalContainer] at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3138) [INFO] [talledLocalContainer] at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3468) [INFO] [talledLocalContainer] at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:140) [INFO] [talledLocalContainer] at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395) [INFO] [talledLocalContainer] at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387) [INFO] [talledLocalContainer] at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:304) [INFO] [talledLocalContainer] at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349) [INFO] [talledLocalContainer] at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56) [INFO] [talledLocalContainer] at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1159) [INFO] [talledLocalContainer] at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) [INFO] [talledLocalContainer] at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) [INFO] [talledLocalContainer] at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:552) [INFO] [talledLocalContainer] ... 91 more [INFO] [talledLocalContainer] Jun 01, 2015 4:48:26 PM com.sun.jersey.spi.container.ContainerResponse mapException [INFO] [talledLocalContainer] SEVERE: Exception mapper com.atlassian.plugins.rest.common.error.jersey.ThrowableExceptionMapper@68c52d43 for Throwable org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 threw a RuntimeException when attempting to obtain the response [INFO] [talledLocalContainer] Jun 01, 2015 4:48:26 PM com.sun.jersey.spi.container.ContainerResponse logException [INFO] [talledLocalContainer] SEVERE: Mapped exception to response: 500 (Internal Server Error) [INFO] [talledLocalContainer] java.lang.IllegalStateException [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.ThreadLocalHttpContext.getRequest(ThreadLocalHttpContext.java:82) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl$2.invoke(WebApplicationImpl.java:286) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy49.selectVariant(Unknown Source) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.error.jersey.UncaughtExceptionEntity.variantFor(UncaughtExceptionEntity.java:85) [INFO] [talledLocalContainer] at com.atlassian.plugins.rest.common.error.jersey.ThrowableExceptionMapper.toResponse(ThrowableExceptionMapper.java:49) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.ContainerResponse.mapException(ContainerResponse.java:463) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.ContainerResponse.mapMappableContainerException(ContainerResponse.java:400) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1446) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) [INFO] [talledLocalContainer] at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) [INFO] [talledLocalContainer] at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) [INFO] [talledLocalContainer] at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.filter.RestServiceVersionFilter.doFilter(RestServiceVersionFilter.java:86) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:97) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.horde.filters.SysadminPasswordExpiryServletFilter.doFilter(SysadminPasswordExpiryServletFilter.java:51) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.horde.analytics.HttpRequestAnalyticsFilter.doFilter(HttpRequestAnalyticsFilter.java:51) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151) [INFO] [talledLocalContainer] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.security.BlockOpenSocialRequestFilter.doFilter(BlockOpenSocialRequestFilter.java:45) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.horde.tenant.TenantServletFilter.doFilter(TenantServletFilter.java:74) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [INFO] [talledLocalContainer] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at com.atlassian.crowd.plugin.web.filter.HttpContextFilter.doFilter(HttpContextFilter.java:34) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [INFO] [talledLocalContainer] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [INFO] [talledLocalContainer] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [INFO] [talledLocalContainer] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [INFO] [talledLocalContainer] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [INFO] [talledLocalContainer] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) [INFO] [talledLocalContainer] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) [INFO] [talledLocalContainer] at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [INFO] [talledLocalContainer] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:745) {noformat}

    Atlassian JIRA | 2 years ago | Sunny Kalsi
    ibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
  3. 0

    Java ERROR TaskUtils$LoggingErrorHandler:95 - Unexpected error occurred in scheduled task

    Stack Overflow | 2 years ago | Rachel Geller
    org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    why saveOrUpdate doesn't insert note in database when it executes if I use save

    Stack Overflow | 3 years ago | homeAccount
    org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
  6. 0

    Hibernate delete record miserably fails

    Stack Overflow | 3 years ago | PerfectGundam
    org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

  1. kuldeep 8 times, last 2 months ago
5 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.hibernate.StaleStateException

    Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

    at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched()
  2. Hibernate
    AbstractTransactionImpl.commit
    1. org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:81)
    2. org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:73)
    3. org.hibernate.engine.jdbc.batch.internal.BatchingBatch.checkRowCounts(BatchingBatch.java:141)
    4. org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:118)
    5. org.hibernate.engine.jdbc.batch.internal.BatchingBatch.doExecuteBatch(BatchingBatch.java:101)
    6. org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.execute(AbstractBatchImpl.java:157)
    7. org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.getBatch(JdbcCoordinatorImpl.java:196)
    8. org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3187)
    9. org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3138)
    10. org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3468)
    11. org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:140)
    12. org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)
    13. org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387)
    14. org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:304)
    15. org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349)
    16. org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)
    17. org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1159)
    18. org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404)
    19. org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)
    20. org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175)
    20 frames
  3. Spring ORM
    HibernateTransactionManager.doCommit
    1. org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:552)
    2. org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:181)
    3. org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:678)
    4. org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:560)
    4 frames
  4. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755)
    2. org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724)
    3. org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475)
    4. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:270)
    5. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
    5 frames
  5. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    2 frames
  6. com.sun.proxy
    $Proxy31.validateUserToken
    1. com.sun.proxy.$Proxy31.validateUserToken(Unknown Source)
    1 frame
  7. com.atlassian.crowd
    TokenResource.validateToken
    1. com.atlassian.crowd.plugin.rest.service.controller.TokenController.validateToken(TokenController.java:141)
    2. com.atlassian.crowd.plugin.rest.service.resource.TokenResource.validateToken(TokenResource.java:178)
    2 frames
  8. Java RT
    Method.invoke
    1. sun.reflect.GeneratedMethodAccessor268.invoke(Unknown Source)
    2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    3. java.lang.reflect.Method.invoke(Method.java:497)
    3 frames
  9. com.atlassian.plugins
    DispatchProviderHelper$ResponseOutInvoker._dispatch
    1. com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:234)
    2. com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:100)
    3. com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61)
    4. com.atlassian.plugins.rest.common.validation.ValidationInterceptor.intercept(ValidationInterceptor.java:78)
    5. com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61)
    6. com.atlassian.plugins.rest.common.expand.interceptor.ExpandInterceptor.intercept(ExpandInterceptor.java:38)
    7. com.atlassian.plugins.rest.common.interceptor.impl.DefaultMethodInvocation.invoke(DefaultMethodInvocation.java:61)
    8. com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper.invokeMethodWithInterceptors(DispatchProviderHelper.java:132)
    9. com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker._dispatch(DispatchProviderHelper.java:230)
    9 frames
  10. Jersey
    WebApplicationImpl.handleRequest
    1. com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
    2. com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
    3. com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    4. com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    5. com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    6. com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    7. com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
    8. com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
    9. com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
    10. com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
    10 frames
  11. Jersey
    ServletContainer.service
    1. com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
    2. com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
    3. com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
    3 frames
  12. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    1 frame
  13. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  14. com.atlassian.crowd
    RestServiceVersionFilter.doFilter
    1. com.atlassian.crowd.plugin.rest.filter.RestServiceVersionFilter.doFilter(RestServiceVersionFilter.java:86)
    1 frame
  15. Spring
    DelegatingFilterProxy.doFilter
    1. org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
    2. org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
    2 frames
  16. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  17. com.atlassian.crowd
    BasicApplicationAuthenticationFilter.doFilter
    1. com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:97)
    1 frame
  18. Spring
    DelegatingFilterProxy.doFilter
    1. org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
    2. org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
    2 frames
  19. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  20. Tomcat WS
    WsFilter.doFilter
    1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    1 frame
  21. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  22. Spring ORM
    OpenSessionInViewFilter.doFilterInternal
    1. org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)
    1 frame
  23. Spring
    OncePerRequestFilter.doFilter
    1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
    1 frame
  24. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  25. com.atlassian.crowd
    BlockOpenSocialRequestFilter.doFilter
    1. com.atlassian.crowd.security.BlockOpenSocialRequestFilter.doFilter(BlockOpenSocialRequestFilter.java:45)
    1 frame
  26. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  27. com.atlassian.crowd
    TenantServletFilter.doFilter
    1. com.atlassian.crowd.horde.tenant.TenantServletFilter.doFilter(TenantServletFilter.java:74)
    1 frame
  28. Spring
    DelegatingFilterProxy.doFilter
    1. org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
    2. org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
    2 frames
  29. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    2 frames
  30. com.atlassian.crowd
    HttpContextFilter.doFilter
    1. com.atlassian.crowd.plugin.web.filter.HttpContextFilter.doFilter(HttpContextFilter.java:34)
    1 frame
  31. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    8. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    10 frames
  32. Grizzly HTTP
    JIoEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    3. org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    3 frames
  33. Java RT
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    2 frames
  34. Tomcat Util
    TaskThread$WrappingRunnable.run
    1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    1 frame
  35. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:745)
    1 frame