com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct doc from XWikiDocument as doc where lower(doc.title) like '%%' or lower(doc.fullName) like '%%' Wrapped Exception: Session is closed!

XWiki.org JIRA | Anca Luca | 7 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Sometimes this error occurs when calling the XWikiService related functions: {code} com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct doc from XWikiDocument as doc where lower(doc.title) like '%%' or lower(doc.fullName) like '%%' Wrapped Exception: Session is closed! at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2142) at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2072) at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2061) at com.xpn.xwiki.store.XWikiCacheStore.search(XWikiCacheStore.java:581) at com.xpn.xwiki.XWiki.search(XWiki.java:1565) at com.xpn.xwiki.wysiwyg.server.DefaultWysiwygService.getMatchingPages(DefaultWysiwygService.java:432) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166) at com.xpn.xwiki.gwt.api.server.XWikiServiceImpl.processCall(XWikiServiceImpl.java:85) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:117) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Wrapped Exception: org.hibernate.SessionException: Session is closed! at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1110) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2134) at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2072) at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2061) at com.xpn.xwiki.store.XWikiCacheStore.search(XWikiCacheStore.java:581) at com.xpn.xwiki.XWiki.search(XWiki.java:1565) at com.xpn.xwiki.wysiwyg.server.DefaultWysiwygService.getMatchingPages(DefaultWysiwygService.java:432) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166) at com.xpn.xwiki.gwt.api.server.XWikiServiceImpl.processCall(XWikiServiceImpl.java:85) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:117) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) {code} which is tipically the error when the same context is shared by 2 different threads. In the XWikiServiceImpl context preparing code, the prepared context is stored as a member of the service servlet to be retrieved afterwards in the called function, which makes it shared by 2 threads if 2 calls to the service are made simultaneously.

    XWiki.org JIRA | 7 years ago | Anca Luca
    com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct doc from XWikiDocument as doc where lower(doc.title) like '%%' or lower(doc.fullName) like '%%' Wrapped Exception: Session is closed!

    Root Cause Analysis

    1. com.xpn.xwiki.XWikiException

      Error number 3223 in 3: Exception while searching documents with sql select distinct doc from XWikiDocument as doc where lower(doc.title) like '%%' or lower(doc.fullName) like '%%' Wrapped Exception: Session is closed!

      at com.xpn.xwiki.store.XWikiHibernateStore.search()
    2. com.xpn.xwiki
      DefaultWysiwygService.getMatchingPages
      1. com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2142)
      2. com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2072)
      3. com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2061)
      4. com.xpn.xwiki.store.XWikiCacheStore.search(XWikiCacheStore.java:581)
      5. com.xpn.xwiki.XWiki.search(XWiki.java:1565)
      6. com.xpn.xwiki.wysiwyg.server.DefaultWysiwygService.getMatchingPages(DefaultWysiwygService.java:432)
      6 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    4. Jetty Contrib :: jetty-gwt RemoteServiceServlet
      RemoteServiceServlet.processCall
      1. com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
      2. com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
      2 frames
    5. com.xpn.xwiki
      XWikiServiceImpl.processCall
      1. com.xpn.xwiki.gwt.api.server.XWikiServiceImpl.processCall(XWikiServiceImpl.java:85)
      1 frame
    6. Jetty Contrib :: jetty-gwt RemoteServiceServlet
      RemoteServiceServlet.doPost
      1. com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
      1 frame
    7. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      2 frames
    8. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      2. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      2 frames
    9. com.xpn.xwiki
      ActionFilter.doFilter
      1. com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:117)
      1 frame
    10. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148)
      1 frame
    11. com.xpn.xwiki
      XWikiDavFilter.doFilter
      1. com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
      1 frame
    12. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148)
      1 frame
    13. com.xpn.xwiki
      SavedRequestRestorerFilter.doFilter
      1. com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295)
      1 frame
    14. Jetty Server
      ServletHandler$CachedChain.doFilter
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148)
      1 frame
    15. com.xpn.xwiki
      SetCharacterEncodingFilter.doFilter
      1. com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
      1 frame
    16. Jetty Server
      SelectChannelEndPoint.run
      1. org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1148)
      2. org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:387)
      3. org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      4. org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      5. org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      6. org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
      7. org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
      8. org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      9. org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      10. org.mortbay.jetty.Server.handle(Server.java:326)
      11. org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
      12. org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
      13. org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
      14. org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      15. org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      16. org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      16 frames
    17. Jetty Util
      QueuedThreadPool$PoolThread.run
      1. org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
      1 frame