Hi, I think the point is that the value is returning null - e.g. it is not set in your dspace.cfg - and so a null is passed into the new File(), and throwing a NullPointerException.
Ugh. That code needs updating - the static initializer in ItemImport ought to have try {} catch around it, and there should be explicit handling of the configuration property not being present (null). G On 31 July 2015 at 11:31, Layale Bassil <l...@aub.edu.lb> wrote: > Hello Stefan, > > > > I am also facing exception when I try to import. I am using the same > import command as the one you used, and I am getting the following > exception at Line 108 which is (File tempWorkDirFile = new > File(tempWorkDir); > > > > Exception in thread "main" java.lang.ExceptionInInitializerError > > at java.lang.Class.forName0(Native Method) > > at java.lang.Class.forName(Class.java:274) > > at > org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:141) > > at > org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:78) > > Caused by: java.lang.NullPointerException > > at java.io.File.<init>(File.java:277) > > at > org.dspace.app.itemimport.ItemImport.<clinit>(ItemImport.java:108) > > ... 4 more > > > > The error is not telling me anything, but it might be related to creating > the temp working directory. Where can I find the value of this property: > ConfigurationManager.getProperty("org.dspace.app.batchitemimport.work.dir"); > ? > > > > Your help is very much appreciated to know how to solve this issue. > > > > Thanks. > > > > -----Original Message----- > From: Stefan Fritzsche [mailto:stefan.fritzs...@tu-dresden.de] > Sent: Thursday, July 30, 2015 1:50 PM > To: dspace-tech@lists.sourceforge.net > Subject: [Dspace-tech] dspace import throws NullPointerException > > > > Dear Members, > > > > i try to ingest some content with the commandline tool "dspace import". > > > > I want to ingest the content via the Simple Archive Format ( > https://wiki.duraspace.org/display/DSDOC5x/Importing+and+Exporting+Items+via+Simple+Archive+Format > ). > > > > > > The ingest is started with > > > > dspace@server> dspace import -a -e f...@bar.de -s . -m mapfile. > > No collections given. Assuming 'collections' file inside item directory > Adding items from directory: . > > Generating mapfile: mapfile > > Processing collections file: collections ... > > > > The content of the collection file is "123456789/9". > > > > When i start the ingest, the process throws a NullPointerException but if > i use the -c option with the collection_id from the file it works. > > > > I use the debugger to find the cause of the exception. The method > addItem(Context c, Collection[] mycollections, String path, String > itemname, PrintWriter mapOut, boolean template) throws Exception) in the > package org.dspace.app.itemimport throws the exception. > > I determine that the method addItem is called with the parameter > mycollections = null but if i use the -c option the parameter holds the > collection_id. > > > > I add at line 736 the statement mycollections = clist. After this change > the process behave like -c option is set. > > > > My questions are: > > Is this a bug and should i report it? > > Has my fix some side effects? > > > > Thanks in advance, > > Stefan > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > > DSpace-tech mailing list > > DSpace-tech@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/dspace-tech > > List Etiquette: > https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette > > > ------------------------------------------------------------------------------ > > _______________________________________________ > DSpace-tech mailing list > DSpace-tech@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/dspace-tech > List Etiquette: > https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette >
------------------------------------------------------------------------------
_______________________________________________ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette