java.lang.NullPointerException

Sakai JIRA | Alan Orth | 6 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    The [documentation for DSpace's ORCID integration|https://wiki.duraspace.org/display/DSDOC5x/ORCID+Integration] mentions that the {{UpdateAuthorities}} script can be used to update the names in authority cache from the ORCID service. When you run the script, it always outputs the following: {code} $ /home/dspace/bin/dspace dsrun org.dspace.authority.UpdateAuthorities 10 authorities found. {code} ... but no records appear to be updated. Also, if you give it a specific ID, it crashes with an null pointer exception: {code} $ /dspace/bin/dspace dsrun org.dspace.authority.UpdateAuthorities -i 58b55f8c-4950-40af-ba58-2fc835eda26f 1 authorities found. Exception: null java.lang.NullPointerException at org.apache.xpath.XPathAPI.eval(XPathAPI.java:231) at org.apache.xpath.XPathAPI.selectNodeList(XPathAPI.java:167) at org.apache.xpath.XPathAPI.selectNodeList(XPathAPI.java:147) at org.dspace.authority.util.XMLUtils.getNodeList(XMLUtils.java:86) at org.dspace.authority.util.XMLUtils.getNodeListIterator(XMLUtils.java:94) at org.dspace.authority.orcid.xml.XMLtoBio.convert(XMLtoBio.java:91) at org.dspace.authority.orcid.Orcid.getBio(Orcid.java:54) at org.dspace.authority.orcid.Orcid.queryAuthorityID(Orcid.java:83) at org.dspace.authority.orcid.OrcidAuthorityValue.newInstance(OrcidAuthorityValue.java:249) at org.dspace.authority.AuthorityValueServiceImpl.generateRaw(AuthorityValueServiceImpl.java:86) at org.dspace.authority.AuthorityValueServiceImpl.update(AuthorityValueServiceImpl.java:100) at org.dspace.authority.UpdateAuthorities.run(UpdateAuthorities.java:135) at org.dspace.authority.UpdateAuthorities.main(UpdateAuthorities.java:66) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229) at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81) {code} In a [recent discussion on dspace-tech|https://groups.google.com/forum/#!topic/dspace-tech/do-0D7OsAYU] it seems that this behavior happens on at least DSpace 5.1 and 6.0-rc2.

    Sakai JIRA | 6 months ago | Alan Orth
    java.lang.NullPointerException
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.apache.xpath.XPathAPI.eval()
    2. Xalan Java
      XPathAPI.selectNodeList
      1. org.apache.xpath.XPathAPI.eval(XPathAPI.java:231)
      2. org.apache.xpath.XPathAPI.selectNodeList(XPathAPI.java:167)
      3. org.apache.xpath.XPathAPI.selectNodeList(XPathAPI.java:147)
      3 frames
    3. DSpace Kernel :: API and Implementation
      UpdateAuthorities.main
      1. org.dspace.authority.util.XMLUtils.getNodeList(XMLUtils.java:86)
      2. org.dspace.authority.util.XMLUtils.getNodeListIterator(XMLUtils.java:94)
      3. org.dspace.authority.orcid.xml.XMLtoBio.convert(XMLtoBio.java:91)
      4. org.dspace.authority.orcid.Orcid.getBio(Orcid.java:54)
      5. org.dspace.authority.orcid.Orcid.queryAuthorityID(Orcid.java:83)
      6. org.dspace.authority.orcid.OrcidAuthorityValue.newInstance(OrcidAuthorityValue.java:249)
      7. org.dspace.authority.AuthorityValueServiceImpl.generateRaw(AuthorityValueServiceImpl.java:86)
      8. org.dspace.authority.AuthorityValueServiceImpl.update(AuthorityValueServiceImpl.java:100)
      9. org.dspace.authority.UpdateAuthorities.run(UpdateAuthorities.java:135)
      10. org.dspace.authority.UpdateAuthorities.main(UpdateAuthorities.java:66)
      10 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    5. DSpace Kernel :: API and Implementation
      ScriptLauncher.main
      1. org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:229)
      2. org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:81)
      2 frames