Cayenne
  1. Cayenne
  2. CAY-1445 Initialize QueryCache via dependency injection
  3. CAY-1536

Expand deserialization context to provide Injector object instead of just a DataChannel.

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1M2
    • Fix Version/s: 3.1M2
    • Component/s: Core Library
    • Labels:
      None

      Description

      Replace BaseContext.bindThreadDeserializationChannel/getThreadDeserializationChannel with a more generic context for deserialization : CayenneRuntime.bindThreadInjector/getThreadInjector. This way deserialized objects can lookup any service in the runtime container. Will need to test that in real scenarios (e.g. deserializing sessions from disk in Tomcat)

        Activity

        Hide
        Andrus Adamchik added a comment -

        Issues with Tomcat 7.0.8 deserialization. Given a web app similar to Cayenne web tutorial with a session containing a DataContext with one object. When Tomcat is shutdown, the session is serialized to disk. When tomcat is started and the page is reloaded in the browser with the old session cookie, the following error occurs:

        type Exception report

        message

        description The server encountered an internal error () that prevented it from fulfilling this request.

        exception

        org.apache.jasper.JasperException: java.lang.NullPointerException
        org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:532)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        org.apache.cayenne.configuration.web.CayenneFilter.doFilter(CayenneFilter.java:97)

        root cause

        java.lang.NullPointerException
        org.apache.cayenne.query.BaseQueryMetadata.resolve(BaseQueryMetadata.java:103)
        org.apache.cayenne.query.SelectQueryMetadata.resolve(SelectQueryMetadata.java:44)
        org.apache.cayenne.query.SelectQuery.getMetaData(SelectQuery.java:143)
        org.apache.cayenne.util.ObjectContextQueryAction.<init>(ObjectContextQueryAction.java:79)
        org.apache.cayenne.access.DataContextQueryAction.<init>(DataContextQueryAction.java:49)
        org.apache.cayenne.access.DataContext.onQuery(DataContext.java:999)
        org.apache.cayenne.access.DataContext.performQuery(DataContext.java:988)
        org.apache.jsp.index_jsp._jspService(index_jsp.java:69)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        org.apache.cayenne.configuration.web.CayenneFilter.doFilter(CayenneFilter.java:97)

        Show
        Andrus Adamchik added a comment - Issues with Tomcat 7.0.8 deserialization. Given a web app similar to Cayenne web tutorial with a session containing a DataContext with one object. When Tomcat is shutdown, the session is serialized to disk. When tomcat is started and the page is reloaded in the browser with the old session cookie, the following error occurs: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: java.lang.NullPointerException org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:532) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.cayenne.configuration.web.CayenneFilter.doFilter(CayenneFilter.java:97) root cause java.lang.NullPointerException org.apache.cayenne.query.BaseQueryMetadata.resolve(BaseQueryMetadata.java:103) org.apache.cayenne.query.SelectQueryMetadata.resolve(SelectQueryMetadata.java:44) org.apache.cayenne.query.SelectQuery.getMetaData(SelectQuery.java:143) org.apache.cayenne.util.ObjectContextQueryAction.<init>(ObjectContextQueryAction.java:79) org.apache.cayenne.access.DataContextQueryAction.<init>(DataContextQueryAction.java:49) org.apache.cayenne.access.DataContext.onQuery(DataContext.java:999) org.apache.cayenne.access.DataContext.performQuery(DataContext.java:988) org.apache.jsp.index_jsp._jspService(index_jsp.java:69) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.cayenne.configuration.web.CayenneFilter.doFilter(CayenneFilter.java:97)

          People

          • Assignee:
            Andrus Adamchik
            Reporter:
            Andrus Adamchik
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development