[Dspace-tech] File not uploaded!!!!!!!!!!!!! How come??????????????????

262 views
Skip to first unread message

Chen, Kevin

unread,
Aug 24, 2015, 12:13:37 PM8/24/15
to dspac...@lists.sourceforge.net

Hi everybody,

 

We (the main library in the University of Arizona) is building a LOR (learning object repository) system based on dspace. We did lots of modifications to the original Dspace application, mostly replacing some java classes, servlets, and JSPs shipped with original dspace by our own classes/servlets/JSPs.

 

We have already solved numerous problems in developing our system, and all functions in our customized dspace are working fine now except one last problem in file uploading during the submission process. Basically, our servlet class (UASubmitServlet) gathers all required basic information and metadata of the item. Then, at the last stage, the system lets the user select a file to upload. The servlet get the file path according to the form submitted by JSP and then call the org.dspace.content.Bundle.createBitstream method to create the bit stream. The servlet works 8 out of 10 times without any problem. However, 2 out of 10 times the system generates the following exception:

 

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(BitstreamStorageManager.java:205)

        at org.dspace.content.Bitstream.create(Bitstream.java:185)

        at org.dspace.content.Bundle.createBitstream(Bundle.java:295)

        at org.dspace.content.Item.createSingleBitstream(Item.java:899)

        at ua.dspace.app.webui.servlet.UASubmitServlet.uploadFile(UASubmitServlet.java:1262)

        at ua.dspace.app.webui.servlet.UASubmitServlet.doDSPost(UASubmitServlet.java:111)

        at org.dspace.app.webui.servlet.DSpaceServlet.processRequest(DSpaceServlet.java:153)

        at org.dspace.app.webui.servlet.DSpaceServlet.doPost(DSpaceServlet.java:110)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

 

When the system throws this exception, the item still got submitted but no file is uploaded.  I have checked many online resources which describe this exception and used many possible ways to solve it. The "dspace" user (the user we use to run Tomcat and dspace) is the owner of the dspace temp directory. Also, the permission of the directory is set to 777, which means every user can write to it. However, the problem still persists. What is most frustrating is that, as said, this behavior appears only about 20% of the time. If it is a problem in our code or configurations, the problem should present every time a user submit an item.

 

So, is there anything wrong, such as unstability, with the Dspace out-of-box classes (mostly bitstream class), Lucene classes, or other packages that dspace use?

 

Nai-Shuo Kevin Chen

Senior Applications Systems Analyst

University of Arizona Libraries

(520) 621-2916

 

Chen, Kevin

unread,
Aug 24, 2015, 12:13:42 PM8/24/15
to dspac...@lists.sourceforge.net

Hi guys,

 

Sorry that I forgot to include the code section that caused the exception (at ua.dspace.app.webui.servlet.UASubmitServlet.uploadFile(UASubmitServlet.java:1262)), here it is:

 

1258     if (temp != null)

1259     {

1260                 // Read the temp file into a bitstream

1261                 InputStream is = new FileInputStream(temp);

1262                 b = item.createSingleBitstream(is);

            ...............

 

I also tried the original Dspace version in line 1262: InputStream is = new BufferedInputStream(new FileInputStream(temp));

 

Nonetheless, regardless of what stream I use, the problem still persists .....  please help me ~ Dspace & Java gurus!!  ><

 

Nai-Shuo Kevin Chen

Senior Applications Systems Analyst

University of Arizona Libraries

(520) 621-2916

 

STUVE,DAVID (HP-Corvallis,ex1)

unread,
Aug 24, 2015, 12:13:44 PM8/24/15
to Chen, Kevin, dspac...@lists.sourceforge.net
Hi Kevin,
 
This sounds like a problem we've seen before - ownerships are set incorrectly in your asset store directories.  Someone probably ran DSpace as root or another user, and now the user you're running DSpace as cannot write to those directories.  The problem is random because DSpace randomly saves bitstreams to different directories, and sounds like 20% of your asset store directories have this problem.  Try doing a chown -R (recursive change ownership) on your asset store directory, and this problem should disappear.
 
(Java weirdly reports this permission problem as a 'no such file or directory'.)
 
Hope this helps,
 
Dave
David Stuve / HP Labs Corvallis / david...@hp.com / 541-715-4106
 
Reply all
Reply to author
Forward
0 new messages