[Dspace-tech] using ItemImporter

0 views
Skip to first unread message

Jose Blanco

unread,
Aug 24, 2015, 2:15:53 PM8/24/15
to dspac...@lists.sourceforge.net

I have written a perl cgi that prepares an item for import using the ItemImport script.  Once the data is prepared if I run the ItemImport script from a shell where dspace is logged in, the item is imported into Dspace, but if I try to run the ItemImport script from the browser it chokes when it tries to Read the bitstream file to import.  It’s able to read the dublin_core.xml file just fine.  And it reads the contents file just fine also, but then when it tries to read the file listed in the contents file it gets an IOException error.  Here is the error:

 

Adding items from directory: /dspace/submit_umtri Generating mapfile: /dspace/mapfile_submit_umtri Adding item from directory item_1 Loading dublin core from /dspace/submit_umtri/item_1/dublin_core.xml Element: title Qualifier: none Value: Item comming from perl cgi Element: creator Qualifier: none Value: sdfsdf Element: subject Qualifier: none Value: Arts and Humanities Element: subject Qualifier: none Value: Arts and Humanities Element: description Qualifier: none Value: sdf Element: publisher Qualifier: none Value: a Element: creator Qualifier: none Value: sdfa Element: date Qualifier: none Value: sdf Element: type Qualifier: none Value: Collection Element: format Qualifier: none Value: a Element: identifier Qualifier: none Value: sdfa Element: source Qualifier: none Value: sdfasf Element: language Qualifier: none Value: abk - Abkhazian Element: relation Qualifier: none Value: a Element: coverage Qualifier: temporal Value: a Element: publisher Qualifier: none Value: sdfasf Element: publisher Qualifier: none Value: sdfasdf Processing contents file: /dspace/submit_umtri/item_1/contents java.io.IOException: No such file or directory

 

Does any one have any suggestions?

 

Thanks in advance,

 

Jose

Jim Downing

unread,
Aug 24, 2015, 2:15:54 PM8/24/15
to dspac...@lists.sourceforge.net
Hi Jose,
Are you executing the script as the correct user (probably 'dspace').
Java raises this IOException when it doesn't have permissions, as well
as when the file or directory is missing.

jim

--
Jim Downing <oj...@cam.ac.uk>
DSpace@Cambridge

Jose Blanco

unread,
Aug 24, 2015, 2:15:55 PM8/24/15
to Jim Downing, dspac...@lists.sourceforge.net
I'm executing the script as nobody because it's being executed from the
browser. I do setup some env variables in my script and I think that maybe
I'm missing something. I'm trying to see if I can determine if that's why
it's not working.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
DSpace-tech mailing list
DSpac...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech


Jose Blanco

unread,
Aug 24, 2015, 2:15:59 PM8/24/15
to Jose Blanco, Jim Downing, dspac...@lists.sourceforge.net
Jim:

In my testing to get this to work, I've come across something rather
strange.

I have a perl script that I run from a shell that does the following:
1. Sets up what I think are env variables that the Importer will need like
CLASSPATH
2. executes the following command to add an item:

/dspace/bin/dsrun org.dspace.app.itemimport.ItemImport -a -e 13 -c
123456789/12867 -s /dspace/submit_umtri -m /dspace/mapfile_submit_umtri

What's happening is that I'll run this perl script a few times and it will
work and then I'll run it and it fails. I'll try running it again and it
works. When it fails I get this error:

java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:828)
at
org.dspace.storage.bitstore.BitstreamStorageManager.store(BitstreamStorageMa
nager.java:205)
at org.dspace.content.Bitstream.create(Bitstream.java:185)
at org.dspace.content.Bundle.createBitstream(Bundle.java:369)
at
org.dspace.app.itemimport.ItemImport.processContentFileEntry(ItemImport.java
:742)
at
org.dspace.app.itemimport.ItemImport.processContentsFile(ItemImport.java:681
)
at org.dspace.app.itemimport.ItemImport.addItem(ItemImport.java:456)
at
org.dspace.app.itemimport.ItemImport.addItems(ItemImport.java:334)
at org.dspace.app.itemimport.ItemImport.main(ItemImport.java:282)

Seems to be some sort timing problem, and perhaps that is what is happening
from the browser. Not sure why it would work some times and some times not,
and there is no specific pattern of working and not working.

Any ideas? Thanks again! Jose

Stuve, David H

unread,
Aug 24, 2015, 2:16:00 PM8/24/15
to Jose Blanco, Jim Downing, dspac...@lists.sourceforge.net
Hi Jose,

This random failure with 'not such file or directory' is exactly what
happens when there is a permissions problem in your assetstore
directory. This usually happens when people run the importer as a
different user than dspace (usually root), and dspace can't write to any
new directories that get created during that import session. Run 'chmod
-R dspace' on your assetstore directory and this should fix the problem.

Dave

-----Original Message-----
From: dspace-t...@lists.sourceforge.net
[mailto:dspace-t...@lists.sourceforge.net] On Behalf Of Jose
Blanco
Sent: Friday, December 17, 2004 1:44 PM
To: 'Jose Blanco'; 'Jim Downing'; dspac...@lists.sourceforge.net
Subject: RE: [Dspace-tech] using ItemImporter


Reply all
Reply to author
Forward
0 new messages