org.apache.jasper.JasperException: java.lang.NullPointerException ....

Sakai JIRA | Tim Donohue | 3 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Reported in this thread: http://dspace.2283337.n4.nabble.com/Publication-Date-Metadata-td4673384.html This issue seems to occur in the following scenario: * You are using DSpace 4 with JSPUI * You have re-enabled the "Initial Questions" step in the submission forms * You have enabled one or more Workflow approval steps on the Collection To reproduce: 1) Submit an Item to the Workflow-enabled Collection and leave the "The item has been published or publicly distributed before" UNCHECKED. Complete the submission. Behind the scenes, dc.date.issued has been temporarily set to the literal string "today" (see DS-1745) 2) Once the submission is completed it will head into Workflow approval. Claim the task, and you'll see an error like this: -- Method: POST -- Parameters were: -- submit_claim: "Take Task" -- workflow_id: "186" -- step: "0" org.apache.jasper.JasperException: java.lang.NullPointerException .... at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.NullPointerException at org.dspace.content.DCDate.getMonthUTC(DCDate.java:368) at org.dspace.content.DCDate.displayUTCDate(DCDate.java:520) at org.dspace.content.DCDate.displayDate(DCDate.java:487) at org.dspace.app.webui.util.UIUtil.displayDate(UIUtil.java:249) at org.dspace.app.webui.jsptag.ItemTag.render(ItemTag.java:541) at org.dspace.app.webui.jsptag.ItemTag.doStartTag(ItemTag.java:289) at org.apache.jsp.mydspace.preview_002dtask_jsp._jspService(preview_002dtask_jsp.java:352) 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) ... 44 more --- The problem seems to be that the JSPUI is attempting to display the 'dc.date.issued' value as a DCDate...however, it was temporarily set to the literal string "today", which is NOT a valid DCDate. The error occurs here: https://github.com/DSpace/DSpace/blob/master/dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/ItemTag.java#L541 There's one of two ways to fix this: Option #1 - Change the "Initial Questions" to actually set today's date, instead of the literal string "today". See: https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/submit/step/InitialQuestionsStep.java#L227 Option #2 - Change the JSPUI ItemTag to have a special case if 'dc.date.issued' is set to "today". This bug does NOT occur in the XMLUI,

    Sakai JIRA | 3 years ago | Tim Donohue
    org.apache.jasper.JasperException: java.lang.NullPointerException ....
  2. 0

    Reported in this thread: http://dspace.2283337.n4.nabble.com/Publication-Date-Metadata-td4673384.html This issue seems to occur in the following scenario: * You are using DSpace 4 with JSPUI * You have re-enabled the "Initial Questions" step in the submission forms * You have enabled one or more Workflow approval steps on the Collection To reproduce: 1) Submit an Item to the Workflow-enabled Collection and leave the "The item has been published or publicly distributed before" UNCHECKED. Complete the submission. Behind the scenes, dc.date.issued has been temporarily set to the literal string "today" (see DS-1745) 2) Once the submission is completed it will head into Workflow approval. Claim the task, and you'll see an error like this: -- Method: POST -- Parameters were: -- submit_claim: "Take Task" -- workflow_id: "186" -- step: "0" org.apache.jasper.JasperException: java.lang.NullPointerException .... at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.NullPointerException at org.dspace.content.DCDate.getMonthUTC(DCDate.java:368) at org.dspace.content.DCDate.displayUTCDate(DCDate.java:520) at org.dspace.content.DCDate.displayDate(DCDate.java:487) at org.dspace.app.webui.util.UIUtil.displayDate(UIUtil.java:249) at org.dspace.app.webui.jsptag.ItemTag.render(ItemTag.java:541) at org.dspace.app.webui.jsptag.ItemTag.doStartTag(ItemTag.java:289) at org.apache.jsp.mydspace.preview_002dtask_jsp._jspService(preview_002dtask_jsp.java:352) 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) ... 44 more --- The problem seems to be that the JSPUI is attempting to display the 'dc.date.issued' value as a DCDate...however, it was temporarily set to the literal string "today", which is NOT a valid DCDate. The error occurs here: https://github.com/DSpace/DSpace/blob/master/dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/ItemTag.java#L541 There's one of two ways to fix this: Option #1 - Change the "Initial Questions" to actually set today's date, instead of the literal string "today". See: https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/submit/step/InitialQuestionsStep.java#L227 Option #2 - Change the JSPUI ItemTag to have a special case if 'dc.date.issued' is set to "today". This bug does NOT occur in the XMLUI,

    Sakai JIRA | 3 years ago | Tim Donohue
    org.apache.jasper.JasperException: java.lang.NullPointerException ....

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.dspace.content.DCDate.getMonthUTC()
    2. DSpace Kernel :: API and Implementation
      DCDate.displayDate
      1. org.dspace.content.DCDate.getMonthUTC(DCDate.java:368)
      2. org.dspace.content.DCDate.displayUTCDate(DCDate.java:520)
      3. org.dspace.content.DCDate.displayDate(DCDate.java:487)
      3 frames
    3. org.dspace.app
      ItemTag.doStartTag
      1. org.dspace.app.webui.util.UIUtil.displayDate(UIUtil.java:249)
      2. org.dspace.app.webui.jsptag.ItemTag.render(ItemTag.java:541)
      3. org.dspace.app.webui.jsptag.ItemTag.doStartTag(ItemTag.java:289)
      3 frames
    4. org.apache.jsp
      preview_002dtask_jsp._jspService
      1. org.apache.jsp.mydspace.preview_002dtask_jsp._jspService(preview_002dtask_jsp.java:352)
      1 frame
    5. GWT dev
      HttpJspBase.service
      1. org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      1 frame
    6. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      1 frame
    7. GWT dev
      JspServletWrapper.service
      1. org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
      1 frame
    8. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      2. java.lang.Thread.run(Thread.java:744)
      2 frames