Details

      Description

      When you call REST MOP Import:

      curl -v -u root:gtn -X PUT -H 'Content-type: application/zip' --upload-file portal_classic_2013-06-10_15-16-53.zip http://localhost:8080/rest/private/managed-components/mop?importMode=overwrite
      

      It returns 200 OK even if it fails on JCR commit (for example, cache replication timeout).

      Because JCR commit happens in RequestLifeCycle.end() after requestHandler.handleRequest() which flushes http response.

      https://github.com/exoplatform/ws/blob/master/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/servlet/RestServlet.java

         protected void onService(ExoContainer container, HttpServletRequest httpRequest, HttpServletResponse httpResponse)
            throws IOException, ServletException
         {
      ...
            try
            {
               EnvironmentContext.setCurrent(env);
               ServletContainerRequest request = new ServletContainerRequest(httpRequest);
               ContainerResponse response = new ContainerResponse(new ServletContainerResponseWriter(httpResponse));
               requestHandler.handleRequest(request, response);
            }
      ...
            finally
            {
               EnvironmentContext.setCurrent(null);
               RequestLifeCycle.end();
            }
         }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                nscavell Nick Scavelli
                Reporter:
                tkobayashi Toshiya Kobayashi
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: