Opened 16 years ago
Closed 16 years ago
#225 closed defect (fixed)
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 (4)
comment:1 by , 16 years ago
Milestone: | → Release 3.04 |
---|
comment:2 by , 16 years ago
Severity: | → critical |
---|
comment:3 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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.
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) {
}