NPE in assessment settings when site groups have the same name

Description

When multiple site groups have the same name, the assessment tool will cause a null pointer exception.

When you click on settings, a list of site groups with checkboxes is displayed. The data for the checkboxes is supplied by:

AssessmentSettingsBean.getNumberOfGroupsForSite
AssessmentSettingsBean.getGroupsForSite

When the number reported by the first method is different from the number of groups actually returned by the second method, a null pointer exception results. They can be different when a multiple groups have the same description, because the getGroupsForSite() method sorts them using a TreeMap. The TreeMap discards duplicates. So it would return fewer items.

Ordinarily, site groups are prevented from having duplicate names, so this situation is avoided. But unique group names are not guaranteed.

Attached is a patch that stops the NPE.

Attachments

1

Activity

Show:

Hui Tsao July 13, 2011 at 1:48 PM

Will,

Thanks for looking into this. I have fixed this in r95139.

Will Humphries July 13, 2011 at 6:58 AM

Reopening as this is not fixed in 2.7.

Will Humphries July 12, 2011 at 10:18 AM

This issue was fixed in trunk, but 1/2 of the fix was not merged to 2.7.x. The trunk commit r74195 was not merged to 2.7.x. Merging r74195 to 2.7.x fixed this issue for us.

It looks like r74311 is actually a revert of the merge of (trunk r74199) to 2.7.x (r74307). This might have been an unintentional revert, so you may want to check for a regression with in 2.7.x.

Rémi Rémi March 1, 2011 at 11:54 AM
Edited

Same for us here in 2.7.1. We don't know what creates these duplicates. They appear randomly on several course sites (not all of them).

Stacktrace:
org.sakaiproject.portal.api.PortalHandlerException: org.sakaiproject.tool.api.ToolException: javax.servlet.jsp.JspException: null
at org.sakaiproject.portal.charon.handlers.ToolHandler.doPost(ToolHandler.java:73)
caused by: org.sakaiproject.tool.api.ToolException: javax.servlet.jsp.JspException: null
at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1221)
caused by: org.apache.jasper.JasperException: javax.servlet.jsp.JspException: null
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException: null
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
caused by: java.lang.NullPointerException
at com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer.renderOption(SelectManyCheckboxListRenderer.java:179)
at com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer.encodeEnd(SelectManyCheckboxListRenderer.java:156)
[...]

Matt Clare January 20, 2011 at 10:57 AM

FYI: We just had this happen to us in 2.7.1. I'd check it in the nightlies as of Thursday January 20, 2011 - but you can only create this kind of scenario through the APIs.

Fixed

Details

Priority

Affects versions

Fix versions

Components

Assignee

Reporter

Created February 24, 2010 at 12:57 PM
Updated April 17, 2018 at 8:38 AM
Resolved July 13, 2011 at 1:50 PM
Loading...