XMLUI always shows a NullPointerException after running a Site-wide Curation
Task
---------------------------------------------------------------------------------
Key: DS-1077
URL: https://jira.duraspace.org/browse/DS-1077
Project: DSpace
Issue Type: Bug
Components: XMLUI
Affects Versions: 1.8.0
Reporter: Tim Donohue
Assignee: Tim Donohue
Priority: Major
Fix For: 1.8.1
Attachments: Curator.patch
There is a bug in the 1.8.0 Curation System such that Site-Wide Curation Tasks
run from the XMLUI will always result in the following error:
java.lang.NullPointerException
at
org.dspace.storage.rdbms.DatabaseManager.queryTable(DatabaseManager.java:220)
at org.dspace.eperson.Group.allMemberGroupIDs(Group.java:426)
at org.dspace.eperson.Group.allMemberGroups(Group.java:396)
at
org.dspace.app.xmlui.aspect.administrative.Navigation.getValidity(Navigation.java:149)
This error will be displayed whether the Curation Task succeeds or fails (you
can check your DSpace Log file to see whether the Curation Task actually
succeeded or failed).
The error is caused by the Curator.doSite() method which always calls
"context.complete()". When this is run via the XMLUI, that "complete()" call
will close the existing XMLUI Context -- meaning that any other code that
attempts to use that Context object will encounter a NullPointerException as
the Context object no longer has an open DB connection.
What is going on behind the scenes seems to be the following:
1. You kick off a Site-Wide curation task from XMLUI (it will use the current
XMLUI Context object)
2. Behind the scenes, the task may actually complete successfully (check the
logs). But after the task completes, Curator.doSite() will call
context.complete() on the current XMLUI context.
3. At that point, the XMLUI will attempt to refresh the current page (in order
to show the "Success" message). During this process, 'Navigation.getValidity()'
gets called.
4. The 'Navigation.getValidity()' method will attempt to use the XMLUI Context
object to load all member groups of the current user.
5. The result is a NullPointerException as the XMLUI Context object is no
longer valid & its database connection was closed (because of #2 above).
This bug only affects Curation Tasks when they are run site-wide (across all
objects), and only when run via the XMLUI. If a Site-wide Curation Task is run
via Command Line (or queued so that it will run via Command Line later), then
it will not be affected by this bug.
A patch is attached which resolves the issues of closing the Context, and
ensures that Curator.curationContext() caches any context it may create (so
that it can be closed/committed automatically by Curator once the task
completes). This patch is still undergoing testing, but it seems to be
working well so far.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.duraspace.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel