org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition

Atlassian JIRA | Tuomas Jormola | 9 years ago
  1. 0

    At my organization we have developed a filter (net.itella.confluence.profile.UpdateProfilePictureFilter) for Confluence which automatically sets the profile picture of users to a photograph of the user if needed. This seems to sometime fail when the user doesn't have personal information entity saved in the database yet. This happens due to the fact that when requesting the Personal Information object of a user (method com.atlassian.confluence.user.actions.AbstractUserProfileAction.getPersonalInformationEntity()), in the Personal Information Manager (com.atlassian.confluence.user.DefaultPersonalInformationManager) a new Personal Information object for the requested user is created if no existing Personal Information object couldn't be found using the Personal Information DAO (lines 39-41 of DefaultPersonalInformationManager.java). However, the underlying Hibernate session is in read-only mode and thus an org.springframework.dao.InvalidDataAccessApiUsageException is thrown. Below is the full stack trace and after that the relevat part of UpdateProfilePictureFilter is shown. org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition at org.springframework.orm.hibernate.HibernateTemplate.checkWriteOperationAllowed(HibernateTemplate.java:999) at org.springframework.orm.hibernate.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:531) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:312) at org.springframework.orm.hibernate.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:529) at com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao.save(VersionedHibernateObjectDao.java:106) at com.atlassian.confluence.core.DefaultContentEntityManager.saveContentEntity(DefaultContentEntityManager.java:62) at com.atlassian.confluence.user.DefaultPersonalInformationManager.savePersonalInformation(DefaultPersonalInformationManager.java:64) at com.atlassian.confluence.user.DefaultPersonalInformationManager.createPersonalInformation(DefaultPersonalInformationManager.java:54) at com.atlassian.confluence.user.DefaultPersonalInformationManager._getPersonalInformation(DefaultPersonalInformationManager.java:41) at com.atlassian.confluence.user.DefaultPersonalInformationManager.getPersonalInformation(DefaultPersonalInformationManager.java:34) at sun.reflect.GeneratedMethodAccessor693.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:284) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122) at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:20) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174) at $Proxy14.getPersonalInformation(Unknown Source) at com.atlassian.confluence.user.actions.AbstractUserProfileAction.getPersonalInformationEntity(AbstractUserProfileAction.java:199) at net.itella.confluence.profile.UpdateProfilePictureFilter$UpdateProfilePictureFilterAction.hasProfilePicture(UpdateProfilePictureFilter.java:175) at net.itella.confluence.profile.UpdateProfilePictureFilter$UpdateProfilePictureFilterAction.updateProfilePicture(UpdateProfilePictureFilter.java:92) at net.itella.confluence.profile.UpdateProfilePictureFilter.doFilter(UpdateProfilePictureFilter.java:53) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:117) at com.atlassian.confluence.util.profiling.ProfilingPageFilter.parsePage(ProfilingPageFilter.java:137) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:51) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at net.itella.confluence.filters.HackedServletContextThreadLocalFilter.doFilter(HackedServletContextThreadLocalFilter.java:19) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.confluence.util.LoggingContextFilter.doFilter(LoggingContextFilter.java:46) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.confluence.util.UserThreadLocalFilter.doFilter(UserThreadLocalFilter.java:44) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:182) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.seraph.filter.LoginFilter.doFilter(LoginFilter.java:159) at net.itella.confluence.ubilogin.ConfluenceUbiloginLoginFilter.doFilter(ConfluenceUbiloginLoginFilter.java:98) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.confluence.util.ClusterHeaderFilter.doFilter(ClusterHeaderFilter.java:35) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.johnson.filters.JohnsonFilter.doFilter(JohnsonFilter.java:96) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:172) at com.atlassian.spring.filter.FlushingSpringSessionInViewFilter.doFilterInternal(FlushingSpringSessionInViewFilter.java:29) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:122) at com.atlassian.core.filters.ProfilingAndErrorFilter.doFilter(ProfilingAndErrorFilter.java:27) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.confluence.util.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:25) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.core.filters.gzip.GzipFilter.doFilter(GzipFilter.java:61) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.core.filters.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:37) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.ubisecure.ubilogin.uwa.UbiloginFilter.doFilter(UbiloginFilter.java:302) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.ubisecure.util.filter.ProxyFilter.doFilter(ProxyFilter.java:185) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:511) at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:516) at com.caucho.util.ThreadPool.run(ThreadPool.java:442) at java.lang.Thread.run(Thread.java:619) The filter code: public class UpdateProfilePictureFilter extends AbstractFilter { [....] private class UpdateProfilePictureFilterAction extends AbstractUserProfileAction { [....] private boolean hasProfilePicture(File picture) { if(picture == null) { throw new RuntimeException("picture is null"); } Attachment attachment = attachmentManager.getAttachment(getPersonalInformationEntity(), picture.getName()); //this is line 175 of the file return attachment != null; } [....] } }

    Atlassian JIRA | 9 years ago | Tuomas Jormola
    org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition
  2. 0

    At my organization we have developed a filter (net.itella.confluence.profile.UpdateProfilePictureFilter) for Confluence which automatically sets the profile picture of users to a photograph of the user if needed. This seems to sometime fail when the user doesn't have personal information entity saved in the database yet. This happens due to the fact that when requesting the Personal Information object of a user (method com.atlassian.confluence.user.actions.AbstractUserProfileAction.getPersonalInformationEntity()), in the Personal Information Manager (com.atlassian.confluence.user.DefaultPersonalInformationManager) a new Personal Information object for the requested user is created if no existing Personal Information object couldn't be found using the Personal Information DAO (lines 39-41 of DefaultPersonalInformationManager.java). However, the underlying Hibernate session is in read-only mode and thus an org.springframework.dao.InvalidDataAccessApiUsageException is thrown. Below is the full stack trace and after that the relevat part of UpdateProfilePictureFilter is shown. org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition at org.springframework.orm.hibernate.HibernateTemplate.checkWriteOperationAllowed(HibernateTemplate.java:999) at org.springframework.orm.hibernate.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:531) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:312) at org.springframework.orm.hibernate.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:529) at com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao.save(VersionedHibernateObjectDao.java:106) at com.atlassian.confluence.core.DefaultContentEntityManager.saveContentEntity(DefaultContentEntityManager.java:62) at com.atlassian.confluence.user.DefaultPersonalInformationManager.savePersonalInformation(DefaultPersonalInformationManager.java:64) at com.atlassian.confluence.user.DefaultPersonalInformationManager.createPersonalInformation(DefaultPersonalInformationManager.java:54) at com.atlassian.confluence.user.DefaultPersonalInformationManager._getPersonalInformation(DefaultPersonalInformationManager.java:41) at com.atlassian.confluence.user.DefaultPersonalInformationManager.getPersonalInformation(DefaultPersonalInformationManager.java:34) at sun.reflect.GeneratedMethodAccessor693.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:284) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122) at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:20) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174) at $Proxy14.getPersonalInformation(Unknown Source) at com.atlassian.confluence.user.actions.AbstractUserProfileAction.getPersonalInformationEntity(AbstractUserProfileAction.java:199) at net.itella.confluence.profile.UpdateProfilePictureFilter$UpdateProfilePictureFilterAction.hasProfilePicture(UpdateProfilePictureFilter.java:175) at net.itella.confluence.profile.UpdateProfilePictureFilter$UpdateProfilePictureFilterAction.updateProfilePicture(UpdateProfilePictureFilter.java:92) at net.itella.confluence.profile.UpdateProfilePictureFilter.doFilter(UpdateProfilePictureFilter.java:53) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:117) at com.atlassian.confluence.util.profiling.ProfilingPageFilter.parsePage(ProfilingPageFilter.java:137) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:51) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at net.itella.confluence.filters.HackedServletContextThreadLocalFilter.doFilter(HackedServletContextThreadLocalFilter.java:19) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.confluence.util.LoggingContextFilter.doFilter(LoggingContextFilter.java:46) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.confluence.util.UserThreadLocalFilter.doFilter(UserThreadLocalFilter.java:44) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:182) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.seraph.filter.LoginFilter.doFilter(LoginFilter.java:159) at net.itella.confluence.ubilogin.ConfluenceUbiloginLoginFilter.doFilter(ConfluenceUbiloginLoginFilter.java:98) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.confluence.util.ClusterHeaderFilter.doFilter(ClusterHeaderFilter.java:35) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.johnson.filters.JohnsonFilter.doFilter(JohnsonFilter.java:96) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:172) at com.atlassian.spring.filter.FlushingSpringSessionInViewFilter.doFilterInternal(FlushingSpringSessionInViewFilter.java:29) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:122) at com.atlassian.core.filters.ProfilingAndErrorFilter.doFilter(ProfilingAndErrorFilter.java:27) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.confluence.util.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:25) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.core.filters.gzip.GzipFilter.doFilter(GzipFilter.java:61) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.atlassian.core.filters.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:37) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.ubisecure.ubilogin.uwa.UbiloginFilter.doFilter(UbiloginFilter.java:302) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.ubisecure.util.filter.ProxyFilter.doFilter(ProxyFilter.java:185) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:511) at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:516) at com.caucho.util.ThreadPool.run(ThreadPool.java:442) at java.lang.Thread.run(Thread.java:619) The filter code: public class UpdateProfilePictureFilter extends AbstractFilter { [....] private class UpdateProfilePictureFilterAction extends AbstractUserProfileAction { [....] private boolean hasProfilePicture(File picture) { if(picture == null) { throw new RuntimeException("picture is null"); } Attachment attachment = attachmentManager.getAttachment(getPersonalInformationEntity(), picture.getName()); //this is line 175 of the file return attachment != null; } [....] } }

    Atlassian JIRA | 9 years ago | Tuomas Jormola
    org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition
  3. 0

    When I move a page from one parent to another, an error is reported. The page is correctly moved. However, the WebDAV client will still showing the same list of folders, indicating the page hierarchy, as if the page was never moved. Below is the log of the problem at the server side. {noformat} 2007-11-16 15:42:15,238 ERROR [http-8080-Processor25] [[Catalina].[localhost].[/conf245].[servlet-module-container-servlet]] invoke Servlet.service() for servlet servlet-module-container-servlet threw exception org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition at org.springframework.orm.hibernate.HibernateTemplate.checkWriteOperationAllowed(HibernateTemplate.java:999) at org.springframework.orm.hibernate.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:531) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:312) at org.springframework.orm.hibernate.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:529) at bucket.search.persistence.dao.hibernate.HibernateIndexQueueEntryDao.saveOrUpdate(HibernateIndexQueueEntryDao.java:38) at com.atlassian.confluence.search.lucene.queue.DatabaseIndexTaskQueue.enqueue(DatabaseIndexTaskQueue.java:55) at com.atlassian.confluence.search.lucene.QueuingConfluenceIndexer.reIndex(QueuingConfluenceIndexer.java:64) at com.atlassian.confluence.extra.webdav.impl.resource.PageResource.moveTo(PageResource.java:266) at com.atlassian.confluence.extra.webdav.servlet.resource.WebdavResourceServlet.doMove(WebdavResourceServlet.java:1208) at com.atlassian.confluence.extra.webdav.servlet.WebdavServlet.service(WebdavServlet.java:245) at com.atlassian.confluence.extra.webdav.servlet.resource.WebdavResourceServlet.service(WebdavResourceServlet.java:1291) at com.atlassian.confluence.extra.webdav.servlet.WebdavServlet.service(WebdavServlet.java:218) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at com.atlassian.plugin.descriptors.servlet.ServletModuleContainerServlet.service(ServletModuleContainerServlet.java:38) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.atlassian.confluence.util.LoggingContextFilter.doFilter(LoggingContextFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:182) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.atlassian.seraph.filter.LoginFilter.doFilter(LoginFilter.java:159) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.atlassian.confluence.util.ClusterHeaderFilter.doFilter(ClusterHeaderFilter.java:35) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.atlassian.johnson.filters.JohnsonFilter.doFilter(JohnsonFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:172) at com.atlassian.spring.filter.FlushingSpringSessionInViewFilter.doFilterInternal(FlushingSpringSessionInViewFilter.java:29) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:122) at com.atlassian.core.filters.ProfilingAndErrorFilter.doFilter(ProfilingAndErrorFilter.java:27) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.atlassian.confluence.util.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:25) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.atlassian.core.filters.gzip.GzipFilter.doFilter(GzipFilter.java:61) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.atlassian.core.filters.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:37) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Thread.java:595) {noformat} Below is the log of the problem. It is generated by Data Freeway. {noformat} /*Service SSH available*/ /*Service FTP available*/ /*Service WebDAV available*/ /*Active service: WebDAV*/ [SERVICE] CDAV [CMDLINE] -acceptNewKey -pr -gui 11665602 -P 8080 -v -fast -id 15223625 -batch -pw ****** -move -l "dchui" -host "10.60.1.127" -rdir "/conf245/plugins/servlet/webdav/Global/TP01/Test Page" -target "/conf245/plugins/servlet/webdav/Global/TP01/Test Page/Test Page Children" /*Client 15223625 attached*/ [OUT_1836] Not connected [OUT_1836] DNS lookup [OUT_1836] DNS lookup done [OUT_1836] Connected [OUT_1836] Remote IP: 10.60.1.127 [OUT_1836] Waiting header [OUT_1836] >>>>>> Send headers (PROPFIND) [OUT_1836] PROPFIND /conf245/plugins/servlet/webdav/Global/TP01/Test%20Page/ HTTP/1.1 [OUT_1836] Accept: */* [OUT_1836] User-Agent: DataFreeway/1.37.i386 DAV/2 (compatible; Mozilla 4.0) http://enginsite.com [OUT_1836] Host: 10.60.1.127:8080 [OUT_1836] Authorization: Basic ZGNodWk6cGFzc3dvcmQ= [OUT_1836] Content-Type: text/xml; charset="utf-8" [OUT_1836] Content-Length: 99 [OUT_1836] Depth: 1 [OUT_1836] Cookie: JSESSIONID=FB9F8E7AE72467868A32E20B37D23D5D; Path=/conf245 [OUT_1836] <<<<<< Received headers [OUT_1836] HTTP/1.1 207 Multi-Status [OUT_1836] Server: Apache-Coyote/1.1 [OUT_1836] Set-Cookie: JSESSIONID=FB9F8E7AE72467868A32E20B37D23D5D; Path=/conf245 [OUT_1836] DAV: 1 [OUT_1836] MS-Author-Via: DAV [OUT_1836] Content-Type: text/xml;charset=utf-8 [OUT_1836] Transfer-Encoding: chunked [OUT_1836] Date: Fri, 16 Nov 2007 07:42:15 GMT [OUT_1836] Waiting body [OUT_1836] Body received [OUT_1836] ! check object Test Page Grandchildren; Status Code = 207 [OUT_1836] Connected [OUT_1836] Remote IP: 10.60.1.127 [OUT_1836] Waiting header [OUT_1836] >>>>>> Send headers (MOVE) [OUT_1836] MOVE /conf245/plugins/servlet/webdav/Global/TP01/Test%20Page/Test%20Page%20Grandchildren/ HTTP/1.1 [OUT_1836] Accept: */* [OUT_1836] User-Agent: DataFreeway/1.37.i386 DAV/2 (compatible; Mozilla 4.0) http://enginsite.com [OUT_1836] Host: 10.60.1.127:8080 [OUT_1836] Authorization: Basic ZGNodWk6cGFzc3dvcmQ= [OUT_1836] Accept-Encoding: deflate [OUT_1836] Depth: infinity [OUT_1836] Overwrite: T [OUT_1836] Destination: http://10.60.1.127:8080/conf245/plugins/servlet/webdav/Global/TP01/Test%20Page/Test%20Page%20Children/Test%20Page%20Grandchildren/ [OUT_1836] <<<<<< Received headers [OUT_1836] HTTP/1.1 500 Internal Server Error [OUT_1836] Server: Apache-Coyote/1.1 [OUT_1836] Content-Type: text/html;charset=ISO-8859-1 [OUT_1836] Transfer-Encoding: chunked [OUT_1836] Date: Fri, 16 Nov 2007 07:42:15 GMT [OUT_1836] Connection: close [OUT_1836] Waiting body [OUT_1836] Body received [OUT_1836] Session closed [ERR_1836] !Internal Server Error {noformat}

    Ecosystem JIRA | 9 years ago | David Chui
    org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring Framework / Discussion / Help (deprecated):write operations not allowed in read-only

    sourceforge.net | 1 year ago
    org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO respectively remove 'readOnly' marker from transaction definition
  6. 0

    write operations not allowed in read-only

    springframework | 1 decade ago | jespey
    org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO respectively remove 'readOnly' marker from transaction definition

    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.springframework.dao.InvalidDataAccessApiUsageException

      Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition

      at org.springframework.orm.hibernate.HibernateTemplate.checkWriteOperationAllowed()
    2. Hibernate
      HibernateTemplate.saveOrUpdate
      1. org.springframework.orm.hibernate.HibernateTemplate.checkWriteOperationAllowed(HibernateTemplate.java:999)
      2. org.springframework.orm.hibernate.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:531)
      3. org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:312)
      4. org.springframework.orm.hibernate.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:529)
      4 frames
    3. com.atlassian.confluence
      DefaultPersonalInformationManager.getPersonalInformation
      1. com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao.save(VersionedHibernateObjectDao.java:106)
      2. com.atlassian.confluence.core.DefaultContentEntityManager.saveContentEntity(DefaultContentEntityManager.java:62)
      3. com.atlassian.confluence.user.DefaultPersonalInformationManager.savePersonalInformation(DefaultPersonalInformationManager.java:64)
      4. com.atlassian.confluence.user.DefaultPersonalInformationManager.createPersonalInformation(DefaultPersonalInformationManager.java:54)
      5. com.atlassian.confluence.user.DefaultPersonalInformationManager._getPersonalInformation(DefaultPersonalInformationManager.java:41)
      6. com.atlassian.confluence.user.DefaultPersonalInformationManager.getPersonalInformation(DefaultPersonalInformationManager.java:34)
      6 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor693.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    5. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:284)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
      3 frames
    6. com.atlassian.spring
      SpringProfilingInterceptor.invoke
      1. com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:20)
      1 frame
    7. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
      1 frame
    8. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56)
      1 frame
    9. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
      2 frames
    10. Unknown
      $Proxy14.getPersonalInformation
      1. $Proxy14.getPersonalInformation(Unknown Source)
      1 frame
    11. com.atlassian.confluence
      AbstractUserProfileAction.getPersonalInformationEntity
      1. com.atlassian.confluence.user.actions.AbstractUserProfileAction.getPersonalInformationEntity(AbstractUserProfileAction.java:199)
      1 frame
    12. net.itella.confluence
      UpdateProfilePictureFilter.doFilter
      1. net.itella.confluence.profile.UpdateProfilePictureFilter$UpdateProfilePictureFilterAction.hasProfilePicture(UpdateProfilePictureFilter.java:175)
      2. net.itella.confluence.profile.UpdateProfilePictureFilter$UpdateProfilePictureFilterAction.updateProfilePicture(UpdateProfilePictureFilter.java:92)
      3. net.itella.confluence.profile.UpdateProfilePictureFilter.doFilter(UpdateProfilePictureFilter.java:53)
      3 frames
    13. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    14. Sitemesh
      PageFilter.parsePage
      1. com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:117)
      1 frame
    15. com.atlassian.confluence
      ProfilingPageFilter.parsePage
      1. com.atlassian.confluence.util.profiling.ProfilingPageFilter.parsePage(ProfilingPageFilter.java:137)
      1 frame
    16. Sitemesh
      PageFilter.doFilter
      1. com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:51)
      1 frame
    17. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    18. net.itella.confluence
      HackedServletContextThreadLocalFilter.doFilter
      1. net.itella.confluence.filters.HackedServletContextThreadLocalFilter.doFilter(HackedServletContextThreadLocalFilter.java:19)
      1 frame
    19. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    20. com.atlassian.confluence
      LoggingContextFilter.doFilter
      1. com.atlassian.confluence.util.LoggingContextFilter.doFilter(LoggingContextFilter.java:46)
      1 frame
    21. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    22. com.atlassian.confluence
      UserThreadLocalFilter.doFilter
      1. com.atlassian.confluence.util.UserThreadLocalFilter.doFilter(UserThreadLocalFilter.java:44)
      1 frame
    23. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    24. com.atlassian.seraph
      SecurityFilter.doFilter
      1. com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:182)
      1 frame
    25. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    26. com.atlassian.seraph
      LoginFilter.doFilter
      1. com.atlassian.seraph.filter.LoginFilter.doFilter(LoginFilter.java:159)
      1 frame
    27. net.itella.confluence
      ConfluenceUbiloginLoginFilter.doFilter
      1. net.itella.confluence.ubilogin.ConfluenceUbiloginLoginFilter.doFilter(ConfluenceUbiloginLoginFilter.java:98)
      1 frame
    28. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    29. com.atlassian.confluence
      ClusterHeaderFilter.doFilter
      1. com.atlassian.confluence.util.ClusterHeaderFilter.doFilter(ClusterHeaderFilter.java:35)
      1 frame
    30. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    31. com.atlassian.johnson
      JohnsonFilter.doFilter
      1. com.atlassian.johnson.filters.JohnsonFilter.doFilter(JohnsonFilter.java:96)
      1 frame
    32. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    33. Hibernate
      OpenSessionInViewFilter.doFilterInternal
      1. org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:172)
      1 frame
    34. com.atlassian.spring
      FlushingSpringSessionInViewFilter.doFilterInternal
      1. com.atlassian.spring.filter.FlushingSpringSessionInViewFilter.doFilterInternal(FlushingSpringSessionInViewFilter.java:29)
      1 frame
    35. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      1 frame
    36. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    37. com.atlassian.util
      ProfilingFilter.doFilter
      1. com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:122)
      1 frame
    38. com.atlassian.core
      ProfilingAndErrorFilter.doFilter
      1. com.atlassian.core.filters.ProfilingAndErrorFilter.doFilter(ProfilingAndErrorFilter.java:27)
      1 frame
    39. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    40. com.atlassian.confluence
      RequestCacheThreadLocalFilter.doFilter
      1. com.atlassian.confluence.util.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:25)
      1 frame
    41. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    42. com.atlassian.core
      GzipFilter.doFilter
      1. com.atlassian.core.filters.gzip.GzipFilter.doFilter(GzipFilter.java:61)
      1 frame
    43. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    44. com.atlassian.core
      AbstractEncodingFilter.doFilter
      1. com.atlassian.core.filters.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:37)
      1 frame
    45. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    46. com.ubisecure.ubilogin
      UbiloginFilter.doFilter
      1. com.ubisecure.ubilogin.uwa.UbiloginFilter.doFilter(UbiloginFilter.java:302)
      1 frame
    47. com.caucho.server
      FilterFilterChain.doFilter
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      1 frame
    48. com.ubisecure.util
      ProxyFilter.doFilter
      1. com.ubisecure.util.filter.ProxyFilter.doFilter(ProxyFilter.java:185)
      1 frame
    49. com.caucho.server
      TcpConnection.run
      1. com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
      2. com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173)
      3. com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
      4. com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274)
      5. com.caucho.server.port.TcpConnection.run(TcpConnection.java:511)
      5 frames
    50. com.caucho.util
      ThreadPool.run
      1. com.caucho.util.ThreadPool.runTasks(ThreadPool.java:516)
      2. com.caucho.util.ThreadPool.run(ThreadPool.java:442)
      2 frames
    51. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:619)
      1 frame