When duplicating site in sakai a NPE for ImportExportUtilityImpl is generated.

Description

If you do a duplicate site call from site manage in Sakai 2.7 on a site that has a gradebook you'll get the following two NPE's in this order:

java.lang.NullPointerException
at org.sakaiproject.gradebook.gwt.server.ImportExportUtilityImpl.processStructureInformationForDisplayAndScaledOptions(ImportExportUtilityImpl.java:2116)
at org.sakaiproject.gradebook.gwt.server.ImportExportUtilityImpl.processStructureInformation(ImportExportUtilityImpl.java:1747)
at org.sakaiproject.gradebook.gwt.server.ImportExportUtilityImpl.parseImportGeneric(ImportExportUtilityImpl.java:2432)
at org.sakaiproject.gradebook.gwt.server.ImportExportUtilityImpl.parseImportCSV(ImportExportUtilityImpl.java:1255)
at org.sakaiproject.gradebook.entity.Gradebook2EntityProducerTransferAgent.transferCopyEntities(Gradebook2EntityProducerTransferAgent.java:266)
at org.sakaiproject.site.tool.SiteAction.transferCopyEntities(SiteAction.java:10700)
at org.sakaiproject.site.tool.SiteAction.importToolContent(SiteAction.java:7807)
....

then

2011-06-01 12:19:09,651 WARN ajp-10.10.12.56-8009-4 org.sakaiproject.site.tool.SiteAction - org.sakaiproject.site.tool.SiteAction@28f46f3d.transferCopyEntities: Error encountered while asking EntityTransfer to transferCopyEntities from: bcccd6b0-fd3d-4078-bb1a-ab04811da90e to: fa38e476-abe6-44f7-a2b8-d641572e0944
java.lang.NullPointerException
at org.sakaiproject.gradebook.gwt.server.ImportExportUtilityImpl.parseImportGeneric(ImportExportUtilityImpl.java:2464)
at org.sakaiproject.gradebook.gwt.server.ImportExportUtilityImpl.parseImportCSV(ImportExportUtilityImpl.java:1255)
at org.sakaiproject.gradebook.entity.Gradebook2EntityProducerTransferAgent.transferCopyEntities(Gradebook2EntityProducerTransferAgent.java:266)
at org.sakaiproject.site.tool.SiteAction.transferCopyEntities(SiteAction.java:10700)
at org.sakaiproject.site.tool.SiteAction.importToolContent(SiteAction.java:7807)
at org.sakaiproject.site.tool.SiteAction.actionForTemplate(SiteAction.java:7363)
at org.sakaiproject.site.tool.SiteAction.doContinue(SiteAction.java:4998)
at org.sakaiproject.site.tool.SiteAction.doDuplicate_site_option(SiteAction.java:10587)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)

Attachments

1

Activity

David Woods February 22, 2012 at 4:03 PM
Edited

QA Test

QA Environment: WinXP, Firefox 10.0.2

QA Process
use the site editor duplicate site option from sites with points, percentage, and Letter grade format gradebooks (each in no cats and weighted cats sites)

QA Results
all 6 sites duplicated correctly and the gradebooks open correctly on the new sites.

QA PASS

Thomas Amsler July 12, 2011 at 2:42 PM

QA: Please verify if this is still an issue after we have enabled the percentage type gradebook import

David Woods June 6, 2011 at 3:43 PM
Edited

If the gradebook2 is a set to grade using Percentages,
then it will not be copied to a new site during
either
Site Editor ==> "Duplicate Site" option processing from the source site
or
Site Editor ==> "Import from site" option processing from the target site
or
Site Setup ==> "new" site creation processing where the "Re-use Material from Other Sites You Own" option is invoked from the target (new) site.

Thomas Amsler June 3, 2011 at 2:17 PM

This was caused by a site duplication bug, where the GradebookItemModel was null. Since that bug has been fixed, the GradebookItemModel is not null anymore and want cause the NPE.

However, since we can endup with such error conditions, we should do a null check at that location but this can be postponed for 1.6.0

Jon Gorrono June 3, 2011 at 2:04 PM
Edited

The process for stopping the import of percentage gradebooks should stop the import process altogether.... the NPE here is in import code so it can't be a percentage gradebook import issue if that being handled correectly, and I think it is

Fixed

Details

Assignee

Reporter

QA Status

PASS

Components

Fix versions

Affects versions

Priority

Created June 1, 2011 at 12:37 PM
Updated February 24, 2012 at 4:14 PM
Resolved January 24, 2012 at 4:36 PM