Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-3197

SWORD (v1) not functioning properly

    Details

    • Attachments:
      0
    • Comments:
      2
    • Documentation Status:
      Not Required

      Description

      The SWORD (v1) webapp is not functioning properly. When you call /sword/servicedocument the following gets logged:

      SEVERE: Allocate exception for servlet servicedocument
      java.lang.NullPointerException
      at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:123)
      at org.purl.sword.server.ServiceDocumentServlet.<init>(ServiceDocumentServlet.java:51)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at java.lang.Class.newInstance(Class.java:383)

      The issue seems to be related to some code refactoring done in DS-2763, in this PR:
      https://github.com/DSpace/DSpace/pull/1170

      It looks like the PR refactored the init() methods of BOTH org.purl.sword.server.ServiceDocumentServlet and org.purl.sword.server.DepositServlet into a public constructor. It seems as though the "init()" method was previously being called after ServletContext is initialized (which worked). But, the (newly refactored) public constructor seems to be called before ServletContext is initialized (which throws an NPE)

        Attachments

          Activity

            People

            • Assignee:
              mwood Mark H. Wood
              Reporter:
              tdonohue Tim Donohue
              Reviewer:
              Tim Donohue
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: