Opened 15 years ago

Closed 14 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:


in building I got this in creating CL3> Use of uninitialized value in subtraction (-) at C:\research\gs3.03\gs2build\perllib\classify\ line 738.

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


HTTP Status 500 -

type Exception report


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



org.greenstone.gsdl3.util.GSXML.getChildByTagName( org.greenstone.gsdl3.util.GSXML.getNodeByPath(


org.greenstone.gsdl3.action.GS2BrowseAction.process( org.greenstone.gsdl3.core.Receptionist.process( org.greenstone.gsdl3.LibraryServlet.doGet( javax.servlet.http.HttpServlet.service( javax.servlet.http.HttpServlet.service(

Change History (4)

comment:1 by oranfry, 15 years ago

Milestone: Release 3.04

comment:2 by kjdon, 14 years ago

Severity: critical

comment:3 by ak19, 14 years ago

Owner: changed from nobody to ak19
Status: newassigned

I think I fixed this bug now: NullPointerException in org.greenstone.gsdl3.util.GSXML.getChildByTagName( 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

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


comment:4 by ak19, 14 years ago

Resolution: fixed
Status: assignedclosed

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( 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.