Ticket #225 (closed defect: fixed)

Opened 12 years ago

Last modified 11 years ago

server crash

Reported by: anonymous Owned by: ak19
Priority: very high Milestone: 3.04 Release
Component: Greenstone3 Runtime Severity: critical
Keywords: Cc:

Description

in building I got this in creating CL3

buildcol.pl> Use of uninitialized value in subtraction (-) at C:\research\gs3.03\gs2build\perllib\classify\AZCompactList.pm line 738.

and when clicking on an untitled shelf icon I crash the server:

 http://localhost:8080/greenstone3/library?a=b&rt=r&s=ClassifierBrowse&c=testoai2&cl=CL3.1

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.NullPointerException?

org.greenstone.gsdl3.util.GSXML.getChildByTagName(GSXML.java:426) org.greenstone.gsdl3.util.GSXML.getNodeByPath(GSXML.java:464)

org.greenstone.gsdl3.action.GS2BrowseAction.classifierBrowse(GS2BrowseAction.java:178)

org.greenstone.gsdl3.action.GS2BrowseAction.process(GS2BrowseAction.java:33) org.greenstone.gsdl3.core.Receptionist.process(Receptionist.java:197) org.greenstone.gsdl3.LibraryServlet?.doGet(LibraryServlet?.java:499) javax.servlet.http.HttpServlet?.service(HttpServlet?.java:690) javax.servlet.http.HttpServlet?.service(HttpServlet?.java:803)

Change History

Changed 12 years ago by oranfry

  • milestone set to Release 3.04

Changed 11 years ago by kjdon

  • severity set to critical

Changed 11 years ago by ak19

  • owner changed from nobody to ak19
  • status changed from new to assigned

I think I fixed this bug now: NullPointerException? in org.greenstone.gsdl3.util.GSXML.getChildByTagName(GSXML.java:426). Possibly n is null on some occasion, so need to check for that before trying n.getFirstChild(). If n is null, null is still returned, which the caller GSXML.getNodeByPath() and its caller GS2BrowseAction.classifierBrowse() already check for.

Code change to GSXML.java:

public static Node getChildByTagName(Node n, String name) {

if(n != null) { // this line is an attempted solution to the NullPointerException? mentioned

// old code went in here

} return null; //not found

}

Changed 11 years ago by ak19

  • status changed from assigned to closed
  • resolution set to fixed

I have been unable to generate the necessary circumstances that would have caused the NPE, but the bug ticket shows that the line where the NPE occurs is method org.greenstone.gsdl3.util.GSXML.getChildByTagName(GSXML.java:426) and from inspection of the method's code, it seems that the only place there that the NPE could have happened is if n itself was null. I'm closing this ticket therefore until such a time as someone is able to ever reproduce it again.

Note: See TracTickets for help on using tickets.