Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-37858

Stacktrace when viewing a page that doesn't have a valid sakaiId

    XMLWordPrintable

    Details

    • Previous Issue Keys:
      LSNBLDR-800
    • Test Plan:
      Hide

      I don't yet know how to reproduce this directly, maybe Charles Hedrick would have some ideas.

      I can reproduce it on the database, just create a page, go to the database, and edit the sakaiId to be a page that doesn't exist.

      Show
      I don't yet know how to reproduce this directly, maybe Charles Hedrick would have some ideas. I can reproduce it on the database, just create a page, go to the database, and edit the sakaiId to be a page that doesn't exist.

      Description

      We recently were getting this error in the logs

      13-Apr-2017 14:10:38.224 WARN [http-apr-8366-exec-170] org.sakaiproject.lessonbuildertool.tool.producers.ShowPageProducer.makeLink Lesson Builder Item #320099 does not have an associated page.
      

      Which was resulting in this stack trace and error to the user

      Fatal internal error handling request: 
      Target exception of class java.lang.NullPointerException
      Successive lines until stack trace show causes progressing to exception site:
      
      java.lang.NullPointerException
      	at org.sakaiproject.lessonbuildertool.tool.producers.ShowPageProducer.fillComponents(ShowPageProducer.java:1567
      

      The line 1567 is this, and it looks like sPage comes back null (as expected in this case)

      1567							SimplePage sPage = simplePageBean.getPage(Long.parseLong(i.getSakaiId()));
      

      That exception was from the feature LSNBLDR-579 but I wasn't sure how to reproduce it to get sakaiId to point to a non-existant page item. I don't know the relation between sakaiId on lesson_builder_items and lesson_builder_pages to reproduce this case.

      So the straightforward fix would be to NPE protect this, but seems like something wasn't correctly cleaned up somewhere

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  • Assignee:
                    hedrick Charles Hedrick
                    Reporter:
                    jonespm Matthew Jones
                  • Votes:
                    0 Vote for this issue
                    Watchers:
                    2 Start watching this issue

                    Dates

                    • Created:
                      Updated:
                      Resolved:

                      Git Integration