Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-2354

Versioning in JSPUI fails caused by NPE in encodeBitstreamName method

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0
    • Component/s: JSPUI
    • Environment:
      DSpace master branch as of December 10, 2014. Item Level Versioning enabled for JSPUI.
    • Attachments:
      0
    • Comments:
      10
    • Documentation Status:
      Not Required

      Description

      When trying to create a new version in JSPUI the UploadStep crashes (see Stacktrace below).

      The method Util.encodeBitstreamName(...) is called, with null as BitstreamName. In upload-file-list.jsp line 144 loads all Bitstreams and their names. It is never checked whether the name is null. I would expect that Bitstream.getName() returns the original file name, but it returns null. I suppose that may have something to do with metadata for all feature, but that is just a bold guess.

      2014-12-10 15:21:16,053 ERROR org.dspace.app.webui.servlet.SubmissionController @ Error loading step class'org.dspace.submit.step.UploadStep':
      org.apache.jasper.JasperException: An exception occurred processing JSP page /submit/upload-file-list.jsp at line 180

      178: } %> />
      178: </td>
      179: <td headers="t2" class="<%= row %>RowOddCol">
      180: <a href="<%= request.getContextPath() %>/retrieve/<%= bitstreams[i].getID() %>/<%= org.dspace.app.webui.util.UIUtil.encodeBitstreamName(bitstreams[i].getName()) %>" target="_blank"><%= bitstreams[i].getName() %></a>
      181: <% // Don't display "remove" button in workflow mode
      182: if (allowFileEditing)
      183: {

      Stacktrace:
      at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
      at org.dspace.app.webui.util.JSPManager.showJSP(JSPManager.java:60)
      at org.dspace.app.webui.submit.JSPStepManager.showJSP(JSPStepManager.java:372)
      at org.dspace.app.webui.submit.step.JSPUploadStep.showUploadFileList(JSPUploadStep.java:573)
      at org.dspace.app.webui.submit.step.JSPUploadStep.showUploadPage(JSPUploadStep.java:491)
      at org.dspace.app.webui.submit.step.JSPUploadStep.doPreProcessing(JSPUploadStep.java:154)
      at org.dspace.app.webui.submit.JSPStepManager.doStepStart(JSPStepManager.java:284)
      at org.dspace.app.webui.submit.JSPStepManager.processStep(JSPStepManager.java:246)
      at org.dspace.app.webui.servlet.SubmissionController.doStep(SubmissionController.java:491)
      at org.dspace.app.webui.servlet.SubmissionController.doNextStep(SubmissionController.java:561)
      at org.dspace.app.webui.servlet.SubmissionController.doStep(SubmissionController.java:507)
      at org.dspace.app.webui.servlet.SubmissionController.doDSPost(SubmissionController.java:427)
      at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:115)
      at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:73)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.dspace.app.webui.filter.RegisteredOnlyFilter.doFilter(RegisteredOnlyFilter.java:66)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:78)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      at com.googlecode.psiprobe.Tomcat70AgentValve.invoke(Tomcat70AgentValve.java:38)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NullPointerException
      at org.dspace.app.util.Util.encodeBitstreamName(Util.java:125)
      at org.dspace.app.util.Util.encodeBitstreamName(Util.java:162)
      at org.apache.jsp.submit.upload_002dfile_002dlist_jsp._jspService(upload_002dfile_002dlist_jsp.java:408)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
      ... 47 more

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hardyoyo Hardy Pottinger
                Reporter:
                pbecker Pascal-Nicolas Becker
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: