Hi, helix84
thank you for your help! I add the license into the submission package and
it can be deposited in DSpace 4.2 without any exception. But it seems unfinish
the submission process and in my account there is a list of unfinished
submissions, illustrated as following. Can you give me some clue for this
problem?
--
Pengcheng Luo
System Department
Library of Peking University
Beijing, China, 100871
Tel:010-62751062(22)
Email: lu...@lib.pku.edu.cn ; 1406189...@pku.edu.cn
-------------------------- original email ----------------------
发件人 :helix84 <heli...@centrum.sk>
发件人 :ivan masar <ivan.ma...@gmail.com>
主题 :Re: [Dspace-devel] swordv2 submission problem
收件人 :罗鹏程 <1406189...@pku.edu.cn>
回复: :heli...@centrum.sk
尊敬的程先生,
I have little experience with SWORD in particular, but looking at the
location of your error [1] I see that DSpace finds no license in the
submission package, therefore it attepts to use the collection's
license instead. But there is no collection license, either.
[1]
https://github.com/DSpace/DSpace/blob/dspace-4_x/dspace-api/src/main/java/org/dspace/content/packager/PackageUtils.java#L156
希望帮助。
祝好
~~helix84
Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
-------------------------- original email ----------------------
发件人: 罗鹏程 <1406189...@pku.edu.cn>
收件人: dspace-devel@lists.sourceforge.net
已发送邮件: Fri, 28 Nov 2014 15:29:46 +0800 (CST)
主题: swordv2 submission problem
Hi,everyone
I'am freshmen in DSpace development. My library has done development based on
DSpace 1.8 for three years ( our institute repository: http://ir.pku.edu.cn).
Recently we want to migrate to a higher version and I join this activity.
Now, I have a problem with the sword version 2 submission. ( I can submit
package with sword version 1 succussfully, but fail for version 2 no matter
whether I use DSpace 1.8 or higher version such as 4.2).
Following is the code (the example.zip is download from
http://sword-app.svn.sourceforge.net/viewvc/sword-app/dspace/trunk/example/example.zip
) :
----------------------------------------------------------------------------------------------
String sdIRI = "http://162.105.134.229:8080/swordv2/servicedocument";
String userName = "xxxxxxxxxxx"; //I hide the user name
String password = "xxxxxxxxxxx"; //I hide the password
String file = "C:/Users/luopc/Desktop/dspace/example.zip";
Deposit deposit = new Deposit();
deposit.setFile(new FileInputStream(file));
deposit.setMimeType("application/zip");
deposit.setFilename("example.zip");
deposit.setPackaging("http://purl.org/net/sword/package/METSDSpaceSIP");
deposit.setMd5(Test2.getMd5ByFile(new File(file)));
deposit.setInProgress(true);
deposit.setSuggestedIdentifier("abcdefg");
AuthCredentials auth = new AuthCredentials(userName, password);
SWORDClient client = new SWORDClient();
ServiceDocument sd = client.getServiceDocument(sdIRI, auth);
SWORDCollection col = sd.getWorkspaces().get(0).getCollections().get(0);
DepositReceipt receipt = client.deposit(col, deposit,new
AuthCredentials(userName, password));
----------------------------------------------------------------------------------------------
However, I always get the following exception:
----------------------------------------------------------------------------------------------
INFO [main] (SWORDClient.java:400) - Deposit request on
http://162.105.134.229:8080/swordv2/collection/123456789/2 returned Error HTTP
status 500
Exception in thread "main" <!DOCTYPE html><html><head><title>Apache
Tomcat/8.0.15 - Error report</title><style type="text/css">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,sans-serif;color:white;background-color:#525D76;font-size:14px;}
BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
{color : black;}A.name {color : black;}.line {height: 1px; background-color:
#525D76; border: none;}</style> </head><body><h1>HTTP Status 500 - </h1><div
class="line"></div><p><b>type</b> Exception report</p><p><b>message</b>
<u></u></p><p><b>description</b> <u>The server encountered an internal error
that prevented it from fulfilling this
request.</u></p><p><b>exception</b></p><pre>java.lang.NullPointerException
org.dspace.content.packager.PackageUtils.addDepositLicense(PackageUtils.java:156)
org.dspace.content.packager.DSpaceMETSIngester.addLicense(DSpaceMETSIngester.java:178)
org.dspace.content.packager.AbstractMETSIngester.replaceObject(AbstractMETSIngester.java:663)
org.dspace.content.packager.AbstractMETSIngester.replace(AbstractMETSIngester.java:1191)
org.dspace.sword2.SwordMETSContentIngester.ingestToCollection(SwordMETSContentIngester.java:108)
org.dspace.sword2.AbstractSwordContentIngester.ingest(AbstractSwordContentIngester.java:45)
org.dspace.sword2.SwordMETSContentIngester.ingest(SwordMETSContentIngester.java:44)
org.dspace.sword2.CollectionDepositManagerDSpace.createNewFromBinary(CollectionDepositManagerDSpace.java:229)
org.dspace.sword2.CollectionDepositManagerDSpace.createNew(CollectionDepositManagerDSpace.java:116)
org.swordapp.server.CollectionAPI.post(CollectionAPI.java:165)
org.swordapp.server.servlets.CollectionServletDefault.doPost(CollectionServletDefault.java:48)
javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
</pre><p><b>note</b> <u>The full stack trace of the root cause is available in
the Apache Tomcat/8.0.15 logs.</u></p><hr class="line"><h3>Apache
Tomcat/8.0.15</h3></body></html>
at org.swordapp.client.ErrorHandler.handleError(ErrorHandler.java:39)
at org.swordapp.client.SWORDClient.deposit(SWORDClient.java:402)
at org.swordapp.client.SWORDClient.deposit(SWORDClient.java:273)
at lib.pku.edu.cn.Test.main(Test.java:66)
----------------------------------------------------------------------------------------------
Can somebody help us? We have been puzzled by this problem for a long time.
--
罗鹏程
Pengcheng Luo
System Department
Library of Peking University
Beijing, China, 100871
Tel:010-62751062(22)
Email: lu...@lib.pku.edu.cn ; 1406189...@pku.edu.cn
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Dspace-devel mailing list
Dspace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-devel