Null pointer exception when submitting an item via a file

35 views
Skip to first unread message

Marc

unread,
Jun 4, 2019, 11:58:01 AM6/4/19
to DSpace Technical Support

Dear List,


As requested, I am reposting this issue


When using the submission form and selecting to submit an item using a bibliographic file,

when clicking the process button the loading dialog just sits there and nothing seems to happen.

Checking the dspace log the error below is logged.


Debian Stretch 9
Java OpenJDK version 1.8
Tomcat 8.5
DSpace CRIS 5.10
ORCID is configured to use the sandbox.

NginX used as a reverse proxy and for SSL


Putting a breakpoint at the code in `MultipleSubmissionLookupDataLoader.java` line 76, reveals that the `identifiers` map variable on line 91 is null and is causing the error. I am not that familiar with the DSpace code, but I am assuming that this map variable is populated from the `bte.xml` configuration file, but I could be wrong. We have not modified the `bte.xml` file yet.


Any advice would be gratefully received


Regards
Marc


2019-06-04 15:45:06,527 WARN  org.dspace.app.webui.servlet.InternalErrorServlet @ :session_id=08BA154A01067A1C0AA1908B81D6E56B:internal_error:-- URL Was: http://wytham1.ouce.ox.ac.uk/json/submissionLookup
-- Method: POST
-- Parameters were:

java.lang.RuntimeException
at org.dspace.app.webui.servlet.JSONServlet.doDSGet(JSONServlet.java:76)
at org.dspace.app.webui.servlet.JSONServlet.doDSPost(JSONServlet.java:33)
at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:115)
at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:73)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:279)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:549)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:314)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:170)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:225)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:47)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:149)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at sun.reflect.GeneratedMethodAccessor164.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:279)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:549)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:314)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:253)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:191)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:47)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:149)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144)
at org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWebappServletFilter.java:78)
at sun.reflect.GeneratedMethodAccessor164.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:279)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:549)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:314)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:253)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:191)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:47)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:149)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1458)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at org.dspace.submit.lookup.MultipleSubmissionLookupDataLoader.getRecords(MultipleSubmissionLookupDataLoader.java:93)
at org.dspace.submit.lookup.MultipleSubmissionLookupDataLoader.getRecords(MultipleSubmissionLookupDataLoader.java:320)
at gr.ekt.bte.core.TransformationEngine.transform(TransformationEngine.java:87)
at org.dspace.app.webui.json.SubmissionLookupJSONRequest.doJSONRequest(SubmissionLookupJSONRequest.java:293)
at org.dspace.app.webui.servlet.JSONServlet.doDSGet(JSONServlet.java:67)
... 69 more

Marc

unread,
Jun 5, 2019, 7:28:57 AM6/5/19
to DSpace Technical Support
Looking into this further it would seem that the identifiers map variable is set to null when the setFile method is called before the getRecords method.

We are using the recommend version of DSpace CRIS from GitHub


I am wondering if this is a bug and should be logged in GitHub?

Mark H. Wood

unread,
Jun 5, 2019, 8:07:35 AM6/5/19
to DSpace Technical Support
On Wed, Jun 05, 2019 at 04:28:56AM -0700, Marc wrote:
> Looking into this further it would seem that the identifiers map variable
> is set to null when the setFile method is called before the getRecords
> method.
>
> We are using the recommend version of DSpace CRIS from GitHub
>
> https://github.com/4Science/DSpace/tree/dspace-5_x_x-cris
>
> I am wondering if this is a bug and should be logged in GitHub?

I would say: yes it is a bug, and would you please file an issue.

A Collection reference should be initialized with an empty Collection
and optionally filled later. It is easy to distinguish 'Collection's
and 'Array's that are empty -- IMHO 'null' is never a useful value for
such references. (Likewise an Iterator reference should be
initialized to an empty Iterator, not 'null', if its intended content
is not yet available or if it may never have content. Ditto
Enumeration and other generators.)
> --
> All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
> ---
> You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/7215d4af-bf82-40c6-a283-3ee88cca1c59%40googlegroups.com.


--
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
signature.asc

Fazio Riccardo

unread,
Jun 5, 2019, 10:15:47 AM6/5/19
to brouar...@gmail.com, dspac...@googlegroups.com
Dear Marc,

I put a fix (
https://github.com/4Science/DSpace/commit/49bf2bcb60d13163a7aeac61c24c2280fe7b382e
) into github dspace-5_x_x-cris branch;
try to update
thanks for pointing this out

regards
Riccardo
> java:253)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> icationFilterChain.java:191)
> at
> org.apache.catalina.core.ApplicationFilterChain.access$000(Applicatio
> nFilterChain.java:47)
> at
> org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilt
> erChain.java:149)
> at
> org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilt
> erChain.java:145)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> ilterChain.java:144)
> at
> org.dspace.utils.servlet.DSpaceWebappServletFilter.doFilter(DSpaceWeb
> appServletFilter.java:78)
> at sun.reflect.GeneratedMethodAccessor164.invoke(Unknown
> Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:282
> )
> at
> org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:279
> )
> at java.security.AccessController.doPrivileged(Native Method)
> at
> javax.security.auth.Subject.doAsPrivileged(Subject.java:549)
> at
> org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:3
> 14)
> at
> org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.
> java:253)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> icationFilterChain.java:191)
> at
> org.apache.catalina.core.ApplicationFilterChain.access$000(Applicatio
> nFilterChain.java:47)
> at
> org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilt
> erChain.java:149)
> at
> org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilt
> erChain.java:145)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> ilterChain.java:144)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
> alve.java:199)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
> alve.java:96)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
> torBase.java:470)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
> ava:140)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
> ava:80)
> at
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAcce
> ssLogValve.java:624)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
> ve.java:87)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
> --
> All messages to this mailing list should adhere to the DuraSpace Code
> of Conduct: https://duraspace.org/about/policies/code-of-conduct/
> ---
> You received this message because you are subscribed to the Google
> Groups "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to dspace-tech...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dspace-tech/e09b0f55-9b7f-4499-b329-588e8d613f7e%40googlegroups.com
> .
>
--
--
Riccardo Fazio
DSpace and DSpace-CRIS developer

4Science, www.4science.it (an Itway Group Company)

office: UP Urban Places - Via Tiburtina, 652, 00159 Roma RM
tel: +39 3339341798

--
Questo messaggio e' stato analizzato da Libra ESVA ed e' risultato non infetto.
This message was scanned by Libra ESVA and is believed to be clean.

Marc

unread,
Jun 5, 2019, 11:39:55 AM6/5/19
to DSpace Technical Support
Dear Riccardo,

Thank you for the quick response. The New Submission, import a file is no longer stopping and no error is logged in dspace log.

But no data is being read from the file, both in preview mode and direct import into a collection.

I will try and debug into the code a little more and get back
> send an email to dspac...@googlegroups.com.

Marc

unread,
Jun 6, 2019, 10:05:36 AM6/6/19
to DSpace Technical Support
Dear Riccardo,

I think I may have determined one reason why the file upload is not working.

In SubmissionLookupJSONRequest.java when doing the BTE transformation, it creates a new TransformationSpec, but the creation fails with a null pointer error. Line 293.

I will create a new issue against the GitHub repository for Dspace CRIS to avoid spamming this mailing list

kind regards
Marc

Marc

unread,
Jun 10, 2019, 7:10:53 AM6/10/19
to DSpace Technical Support, Riccard...@4science.it

Hi Riccardo,

I have logged a issue in the DSpace CRIS GitHub Repo for this issue

https://github.com/4Science/DSpace/issues/84

This is actually quite an important issue for us, as we want to allow researchers to upload items using files. I am afraid my knowledge of DSpace CRIS is lacking otherwise I would try and fix it myself. I am not sure what is trying to be accomplished using the BTE Transformation.

Kind regards
Marc

--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/96aab5cc-7414-4edd-bf7e-bdd34b7fd48a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages