Opened 14 years ago

Closed 14 years ago

#976 closed defect (fixed)

NullPointerException in Experiment overview

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: minor Milestone: BASE 2.6.2
Component: web Version:
Keywords: Cc:

Description

The original report is found in #975. I have now been able to reproduce the NullPointerException? part.

  1. Goto any experiment which contains some data
  2. Click on the Overview tab.
  3. Click on the Revalidate button.
  4. Click on any item in the tree structure on the left side.
  5. Click on Validation options.
  6. Click on Save. It doesn't matter if any options are changed or not.
  7. The NullPointerException? will no appear in the upper-right frame.

Here is the relevant part of the stacktrace:

java.lang.NullPointerException
...at org.apache.jsp.views.experiments.overview.info_jsp._jspService(info_jsp.java:167)
...at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

and here is the code on line 164-169 on my Tomcat (line numbers may very depending on Tomcat version):

164  String nodeId = request.getParameter("nodeId");
165  Node node = nodeId == null ? overview.getRootNode() : 
         overview.getNode(nodeId);
166
167  BasicItem item = node.getItem();
168  List<Failure> failures = overview.getFailures();
169  ValidationOptions options = overview.getValidationOptions();

I think it is the click on the Revalidate button that is the cause of the problem. The revalidation causes new node ID:s to be generated. This is ok and expected, but the revalidate flag is kept in the request URL, which causes all subsequent actions to do a new revalidation. Thus, when saving the validation options an unwanted revalidation happens. The result is that the node ID of the selected node no longer exists, which causes the NullPointerException?.

I think the fix is easy: Use a redirect instead of forward after a revalidation. This will remove the revalidate flag from the URL.

Change History (2)

comment:1 Changed 14 years ago by Nicklas Nordborg

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:2 Changed 14 years ago by Nicklas Nordborg

Resolution: fixed
Status: assignedclosed

(In [4209]) Fixes #976: NullPointerException? in Experiment overview

Note: See TracTickets for help on using tickets.