ModeShape
  1. ModeShape
  2. MODE-952

Zip sequencer does not work correctly

    Details

    • Type: Bug Bug
    • Status: Closed Closed (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: 2.2.1.GA
    • Fix Version/s: 2.3.0.Final, 2.2.1.GA
    • Component/s: Sequencers
    • Labels:
      None
    • Environment:
      JDK 1.6, Fedora 11, JBoss SOA platform 5.1 ER2 (which contains ModeShape 2.2.1)
    • Similar Issues:
      Show 10 results 

      Description

      I uploaded a zip file (named test01.zip) into repository under "/files" location, the result of sequence process should be available under "/sequence/zip/test01.zip". When I looked on http://127.0.0.1:8080/modeshape-rest/test-inmemory/default/items/sequenced/zip/test01.zip I've got HTTP 500 ERROR with following stacktrace:

      org.jboss.resteasy.spi.UnhandledException: org.modeshape.graph.session.ValidationException: Missing primary node type "ns001:content" for node /sequenced/zip/test01.zip/test01.zip in workspace "default" of "JCR test-inmemory"
      org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:263)
      org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:169)
      org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:146)
      org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:456)
      org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:418)
      org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:111)
      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:217)
      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:159)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

      root cause

      org.modeshape.graph.session.ValidationException: Missing primary node type "ns001:content" for node /sequenced/zip/test01.zip/test01.zip in workspace "default" of "JCR test-inmemory"
      org.modeshape.jcr.SessionCache$JcrNodeOperations.materialize(SessionCache.java:2572)
      org.modeshape.graph.session.GraphSession$Node.load(GraphSession.java:1654)
      org.modeshape.graph.session.GraphSession$Node.getPayload(GraphSession.java:2925)
      org.modeshape.jcr.AbstractJcrNode.getNodes(AbstractJcrNode.java:969)
      org.modeshape.web.jcr.rest.ItemHandler.jsonFor(ItemHandler.java:200)
      org.modeshape.web.jcr.rest.ItemHandler.getItem(ItemHandler.java:92)
      org.modeshape.web.jcr.rest.JcrResources.getItem(JcrResources.java:225)
      sun.reflect.GeneratedMethodAccessor438.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:124)
      org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:247)
      org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:212)
      org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:202)
      org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:441)
      org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:418)
      org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:111)
      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:217)
      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:159)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

      Correct URL the content should be http://127.0.0.1:8080/modeshape-rest/test-inmemory/default/items/sequenced/zip/test01.zip but after typing it into browser it looks for content under URL with rel. path: /sequenced/zip/test01.zip/test01.zip.

      Stacktrace from server console:

      10:43:57,640 ERROR [[Resteasy]] Servlet.service() for servlet Resteasy threw exception
      org.jboss.resteasy.spi.UnhandledException: org.modeshape.graph.session.ValidationException: Missing primary node type "ns001:content" for node /sequenced/zip/test01.zip/test01.zip in workspace "default" of "JCR test-inmemory"
      at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:263)
      at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:169)
      at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:146)
      at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:456)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:418)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:111)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:217)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:159)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: org.modeshape.graph.session.ValidationException: Missing primary node type "ns001:content" for node /sequenced/zip/test01.zip/test01.zip in workspace "default" of "JCR test-inmemory"
      at org.modeshape.jcr.SessionCache$JcrNodeOperations.materialize(SessionCache.java:2572)
      at org.modeshape.graph.session.GraphSession$Node.load(GraphSession.java:1654)
      at org.modeshape.graph.session.GraphSession$Node.getPayload(GraphSession.java:2925)
      at org.modeshape.jcr.AbstractJcrNode.getNodes(AbstractJcrNode.java:969)
      at org.modeshape.web.jcr.rest.ItemHandler.jsonFor(ItemHandler.java:200)
      at org.modeshape.web.jcr.rest.ItemHandler.getItem(ItemHandler.java:92)
      at org.modeshape.web.jcr.rest.JcrResources.getItem(JcrResources.java:225)
      at sun.reflect.GeneratedMethodAccessor438.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:124)
      at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:247)
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:212)
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:202)
      at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:441)
      ... 26 more

      1. MODE-952-fix.patch
        17 kB
        Randall Hauch
      2. MODE-952-fix2.patch
        190 kB
        Randall Hauch
      3. reproducer.tar.bz2
        1.89 MB
        Boris Belovic

        Issue Links

          Activity

          Hide
          Boris Belovic
          added a comment -

          Attaching reproducer archive, type ant -Drepository=repo_name -Dworkspace=workspace_name to run it.

          Show
          Boris Belovic
          added a comment - Attaching reproducer archive, type ant -Drepository=repo_name -Dworkspace=workspace_name to run it.
          Hide
          Randall Hauch
          added a comment -

          The cause of this problem is exactly the same as MODE-950.

          Show
          Randall Hauch
          added a comment - The cause of this problem is exactly the same as MODE-950 .
          Hide
          Boris Belovic
          added a comment -

          The cause in MODE-950 is wrong class name in ModeShape's config file, but for ZIP sequencer the class looks correct - org.modeshape.sequencer.zip.ZipSequencer.

          Show
          Boris Belovic
          added a comment - The cause in MODE-950 is wrong class name in ModeShape's config file, but for ZIP sequencer the class looks correct - org.modeshape.sequencer.zip.ZipSequencer.
          Hide
          Randall Hauch
          added a comment -

          Changed the configuration for the ZIP sequencer to use the name of the file in the content and to not duplicate that segment. Additionally, a new node type was introduced, called 'zip:file', that extends 'nt:folder' and that is used as the primary type of the derived output. All contained files and folders are then represented as 'nt:file' and 'nt:folder' nodes, respectively. Added a new integration test to verify that ZIP files uploaded to the repository are sequenced correctly.

          See the 'MODE-952-fix.patch' attachment for details.

          Show
          Randall Hauch
          added a comment - Changed the configuration for the ZIP sequencer to use the name of the file in the content and to not duplicate that segment. Additionally, a new node type was introduced, called 'zip:file', that extends 'nt:folder' and that is used as the primary type of the derived output. All contained files and folders are then represented as 'nt:file' and 'nt:folder' nodes, respectively. Added a new integration test to verify that ZIP files uploaded to the repository are sequenced correctly. See the ' MODE-952 -fix.patch' attachment for details.
          Hide
          Randall Hauch
          added a comment -

          Added another patch file ('MODE-952-fix2.patch') that supersedes the previous patch with changes that improve support for and integration testing of the ZIP sequencer, XML sequencer, and CND sequencer. Additionally, the DDL sequencer tests were expanded. The sequencer configurations in the JBoss AS kit were updated and improved.

          Show
          Randall Hauch
          added a comment - Added another patch file (' MODE-952 -fix2.patch') that supersedes the previous patch with changes that improve support for and integration testing of the ZIP sequencer, XML sequencer, and CND sequencer. Additionally, the DDL sequencer tests were expanded. The sequencer configurations in the JBoss AS kit were updated and improved.
          Hide
          Randall Hauch
          added a comment -

          These changes were committed into SVN trunk with r2439 and r2440, and into the '2.2.x' branch with r2441 and 2442.

          Show
          Randall Hauch
          added a comment - These changes were committed into SVN trunk with r2439 and r2440, and into the '2.2.x' branch with r2441 and 2442.
          Hide
          Randall Hauch
          added a comment -

          Marking as resolved, based upon the new integration tests.

          Show
          Randall Hauch
          added a comment - Marking as resolved, based upon the new integration tests.
          Hide
          Boris Belovic
          added a comment -

          Verified in SOA-P ER4 build. Zip file was published into /files directory and nodes corresponding to its content were created in sequenced/zip/

          {zipfile}

          directory. I wanted to close this issue today, but somehow I couldn't find/see "Close" button.

          Show
          Boris Belovic
          added a comment - Verified in SOA-P ER4 build. Zip file was published into /files directory and nodes corresponding to its content were created in sequenced/zip/ {zipfile} directory. I wanted to close this issue today, but somehow I couldn't find/see "Close" button.
          Hide
          Randall Hauch
          added a comment -

          Closing as requested.

          Show
          Randall Hauch
          added a comment - Closing as requested.

            People

            • Assignee:
              Randall Hauch
              Reporter:
              Boris Belovic
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: