Replying to myself in case anyone else should find this helpful:
I traced the problem to a section in
org/dspace/submit/step/UploadStep.java
that has to do with the file description string.
As far as I could tell, the program was trying to add a file description string
to a null bitstream. Not sure why, since the file was uploading perfectly and I
was just using the default “traditional” form upload. But I suppose I must have
done something to cause this to happen only to my install… Perhaps it was set
up for multi-file upload (not deliberately) but I was using it for single
uploads? Maybe someone on here can shed some light on that aspect.
But anyway the system was uploading the file in one step, then doing a separate
step to assign the file description — but second time round the bitstream was
null. Hence the error.
I’m not recommending my fix as the solution for this. In fact, I’m sure there
must be something a lot simpler you can tweak. But just in case anyone else is
interested I changed the UploadStep.java file from
262 // -------------------------------------------------
263 // Step #3: Check for a change in file description
264 // -------------------------------------------------
265 String fileDescription = request.getParameter("description");
266 if (fileDescription != null && fileDescription.length() > 0)
267 {
268 // save this file description
269 int status = processSaveFileDescription(context, request,
response,
270 subInfo);
271
272
273 // if error occurred, return immediately
274 if (status != STATUS_COMPLETE)
375 {
376 return status;
377 }
378 }
379
to
262 // -------------------------------------------------
263 // Step #3: Check for a change in file description
264 // -------------------------------------------------
265 String fileDescription = request.getParameter("description");
266 if (fileDescription != null && fileDescription.length() > 0)
267 {
268
269 // ---------------------------------------------
270 // Every time I tried adding an item to a collection
271 // I would get an error message about Malformed item
272 // Traced this to this method - file upload happens
273 // but then this method gets called to set the description
274 // and the bitstream the /second/ time round is null.
275 // So we get the bitstream from the Item object and
276 // set the description string on that. Not sure if that
277 // is the right thing to do but it seems to work...
278 // D I Macdonald 2015-02-06
279 // ----------------------------------------------
280 if (subInfo.getBitstream() == null)
281 {
282 if (item != null)
283 {
284 Bundle[] bundle = item.getBundles("ORIGINAL");
285 if (bundle.length!=0)
286 {
287 Bitstream[] bitstreams = bundle[0].getBitstreams();
288 if (bitstreams[0] !=null)
subInfo.setBitstream(bitstreams[0]);
289 }
290 }
291 } // - - end of DI insert
292
293 // save this file description
294 int status = processSaveFileDescription(context, request,
response,
295 subInfo);
296
297
298 // if error occurred, return immediately
299 if (status != STATUS_COMPLETE)
300 {
301 return status;
302 }
303 }
304
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette