[ 
https://jira.duraspace.org/browse/DS-1554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=28121#comment-28121
 ] 

Andrew Waterman commented on DS-1554:
-------------------------------------

Hi Ivan,

1) PUTing a binary to the edit-rel of the returned by the Sword receipt from a 
valid Atom+xml POST to the server returns a 500 error, with an embedded 
Exception that complains of the file not being found.

2) Here's the network flow from the request, with the 500 error stacktrace 
included at the end:

a) POST an in-progress Atom+XML to the server (workaround for broken 
multi-part-submit):

POST /swordv2/collection/10673/2 HTTP/1.1
Host: demo.dspace.org
User-Agent: Guzzle/3.5.0 curl/7.24.0 PHP/5.4.15
Authorization: Basic ZHNwYWNlZGVtbytzdWJtaXRAZ21haWwuY29tOmRzcGFjZQ==
Content-Type: application/atom+xml;type=entry
In-Progress: true
X-Packaging: http://purl.org/net/sword-types/METSDSpaceSIP
Content-Length: 1574

cterms:rightsHolderRights>Holder</dcterms:rightsHolderRights><dcterms:source>Source</dcter
>ms:source></atom:entry>

>> Receive the 201 created from the server:

HTTP/1.1 201 Created
Server: Apache-Coyote/1.1
Location: http://demo.dspace.org/swordv2/edit/19
Last-Modified: Tue, 21 May 2013 16:05:06 +0000
Content-MD5: 6ae304d5589f5f199ba9cf9617869c1f
Content-Type: application/atom+xml;type=entry;charset=ISO-8859-1
Transfer-Encoding: chunked
Date: Tue, 21 May 2013 16:05:06 GMT

>> POST the binaries to the edit-rel link in the SWORDV2 receipt:

POST /swordv2/edit-media/19 HTTP/1.1
Host: demo.dspace.org
User-Agent: Guzzle/3.5.0 curl/7.24.0 PHP/5.4.15
Authorization: Basic ZHNwYWNlZGVtbytzdWJtaXRAZ21haWwuY29tOmRzcGFjZQ==
Content-Type: application/pdf
Content-Disposition: filename=resources/Sword.pdf
In-Progress: false
X-Packaging: http://purl.org/net/sword/package/Binary
Content-Length: 120952

>> Receive 500 ERROR and Java stacktrace due to misconfigured (postulate) 
>> swordv2-server as explained above:

HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 3747
Date: Tue, 21 May 2013 16:05:06 GMT
Connection: close

<html><head><title>Apache Tomcat/7.0.29 - Error report</title><style><!--H1
> {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
>  H2 {font-family:
>Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} 
>H3 {font-family:Tahoma,Arial,s
>ans-serif;color:white;background-color:#525D76;font-size:14px;} BODY 
>{font-family:Tahoma,Arial,sans-serif;co
>lor:black;background-color:white;} B 
>{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D
>76;} P 
>{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
> {color : black;}A
>.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP 
>Stat
>us 500 - org.swordapp.server.SwordServerException: 
>java.io.FileNotFoundException: /dspace/upload/SWORD-d8c3f
>fa4-bd35-41aa-9876-b25d1a9e173b (No such file or directory)</h1><HR size="1" 
>noshade="noshade">&
>lt;p><b>type</b> Exception report</p><p><b>message</b> <u>org.s
>wordapp.server.SwordServerException: java.io.FileNotFoundException: 
>/dspace/upload/SWORD-d8c3ffa4-bd35-41aa-
>9876-b25d1a9e173b (No such file or directory)</u></p><p><b>description</b> <
>;u>The server encountered an internal error 
>(org.swordapp.server.SwordServerException: java.io.FileNotFoundException: 
>/dspace/upload/SWORD-d8c3ffa4-bd35-41aa-9876-
>b25d1a9e173b (No such file or directory)) that prevented it from fulfilling 
>this request.</u></p>
>;<p><b>exception</b> <pre>javax.servlet.ServletException: 
>org.swordapp.server.SwordS
>erverException: java.io.FileNotFoundException: 
>/dspace/upload/SWORD-d8c3ffa4-bd35-41aa-9876-b25d1a9e173b (No
> such file or directory)
.org.swordapp.server.SwordAPIEndpoint.addDepositPropertiesFromBinary(SwordAPIEndpoint.java:326)
.org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:231)
.org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49)
.javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
.javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
</pre></p><p><b>root cause</b> <pre>org.swordapp.server.SwordServerExcep
>tion: java.io.FileNotFoundException: 
>/dspace/upload/SWORD-d8c3ffa4-bd35-41aa-9876-b25d1a9e173b (No such file
> or directory)
.org.swordapp.server.SwordAPIEndpoint.storeAndCheckBinary(SwordAPIEndpoint.java:159)
.org.swordapp.server.SwordAPIEndpoint.addDepositPropertiesFromBinary(SwordAPIEndpoint.java:322)
.org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:231)
.org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49)
.javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
.javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
</pre></p><p><b>root cause</b> <pre>java.io.FileNotFoundException: /dspa
>ce/upload/SWORD-d8c3ffa4-bd35-41aa-9876-b25d1a9e173b (No such file or 
>directory)
.java.io.FileOutputStream.$$YJP$$open(Native Method)
.java.io.FileOutputStream.open(FileOutputStream.java)
.java.io.FileOutputStream.<init>(FileOutputStream.java:212)
.java.io.FileOutputStream.<init>(FileOutputStream.java:165)
.org.swordapp.server.SwordAPIEndpoint.storeAndCheckBinary(SwordAPIEndpoint.java:141)
.org.swordapp.server.SwordAPIEndpoint.addDepositPropertiesFromBinary(SwordAPIEndpoint.java:322)
.org.swordapp.server.MediaResourceAPI.post(MediaResourceAPI.java:231)
.org.swordapp.server.servlets.MediaResourceServletDefault.doPost(MediaResourceServletDefault.java:49)
.javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
.javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is av
>ailable in the Apache Tomcat/7.0.29 logs.</u></p><HR size="1" 
>noshade="noshade"><h3>
>Apache Tomcat/7.0.29</h3></body></html>

                
> swordv2-server.cfg not updated during build process
> ---------------------------------------------------
>
>                 Key: DS-1554
>                 URL: https://jira.duraspace.org/browse/DS-1554
>             Project: DSpace
>          Issue Type: Bug
>          Components: SWORD
>    Affects Versions: 3.1
>         Environment: OSX/Ubuntu Server.
>            Reporter: Andrew Waterman
>            Priority: Major
>              Labels: build.properties, customization, swordv2, swordv2-server
>
> The build.properties file distributed with the full DSpace source provides a 
> way to customize an install of DSpace for a given environment. This works 
> with core dspace functionality. However, changes to the dspace install 
> directory are not reflected in the swordv2-server.cfg file contained in the 
> dspace configuration/modules folder. This can result in hard to diagnose 500 
> errors for clients depositing resources using the swordv2 protocol. I was 
> only able to diagnose issues I had on a local install, by stepping through 
> the sword-ingestion process by means of a Debugger. This would be very nice 
> to have fixed in future versions of DSpace and/or the configuration details 
> updated in the main DSpace documentation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to