click here for details... Sakai Executive Director Position Search now open
Issue Details (XML | Word | Printable)

Key: KNL-219
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: David Horwitz
Reporter: Matthew Jones
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Kernel - K1

Clone - Poor diagnostics on missing tool registration

Created: 22-Jun-2009 11:55   Updated: 05-Mar-2010 02:46
Component/s: Impl
Affects Version/s: 1.0.9
Fix Version/s: 1.0.12, 1.1.0

Time Tracking:
Not Specified

File Attachments: 1. Text File SAK-7004-KNL.patch (0.9 kB)

Issue Links:
Relate

1.0.x Status: Resolved


 Description  « Hide
This is a port from a patch made against SAK-7004. We've been running it for around a year at Michigan. Helps catch some errors when running in production (NPE check). Should have been merged in a long time ago. Please merge.

The diagnostics from Sakai on attempting to dispatch to a missing or improperly registered tool context have always been extremely poor.

WARN: Bug Report user: admin usage-session: 11ea2976-60bc-4e82-807b-d507d5b9000e time: 2006/10/26 18:52:48 user comment: null stack trace
java.lang.NullPointerException
    at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:339)
    at org.sakaiproject.portal.charon.CharonPortal.forwardTool(CharonPortal.java:1632)

etc. etc.

The lines in question are

getDispatcher().forward(wreq, wres);

at ActiveToolComponent.java (around line 339) making a call to:

protected RequestDispatcher getDispatcher()
{
return m_servletContext.getNamedDispatcher(getId());
}



 All   Comments   Work Log   Change History   Subversion Commits   git Commits      Sort Order: Ascending order - Click to sort in descending order
Stephen Marquard added a comment - 22-Jun-2009 13:47
Committed to trunk in r63983.

The original JIRA suggested that this might show up with incorrectly configured tools in a development context. Under what scenarios would one expect to see this in a production system?

Matthew Jones added a comment - 22-Jun-2009 13:59
This likely wouldn't ever come up for a proper fixed set of tools in production, but it did come up either when we were creating new tools against sakai or testing some tool out of contrib. I don't remember the exact details of why I saw it, but having this patch did make my life easier. It was last summer that I'd patched and used it, I'll see if I can dig up some email or blog where I'd hit it. I don't know if it really was #1 tool developer error but it was an easy fix and useful.

Matthew Jones added a comment - 22-Jun-2009 19:46
Basically what i can gather from this chat, when a tool in the portal has an this error without the patch it will crash with a null pointer exception, dump a stack track to the screen and to the log and usually won't give you much detail about it, saying something along the lines of:

(I'm sure you've seen this)
org.sakaiproject.portal.api.PortalHandlerException: java.lang.NullPointerException
    at org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:891)
caused by: java.lang.NullPointerException
    at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:459)
    at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1343)
. . .

When this was in place, it actually was able to trap some of these errors if a tool was improperly registered and tell you more about the problem. It's mostly for developers trying to get their tool registration files correct but did pop up for a some other reasons. I pulled up some emails where we lost a few hours trying to track down a bug for development of some tool before this patch, so it might probably save some other developers time. (4 votes on the original issue) I suppose it's severity is minor overall though.

I think it was being trigged for us by some kind of cache timeout or something, which was harder to track down, was a weird bug and there were like 6 tools on the page that had the problem.

Anthony Whyte added a comment - 08-Oct-2009 08:15
Merged to 1.0.x.