Hi Stuart,

the problem was that in the swordv2-server.cfg file I used:

accepts =*/*

Changing it to:

accepts = application/zip

solved the "Unacceptable content type" problem.

After that, I was getting a 500 server error, but adding the lines you 
suggested in this message solved this problem:

http://sourceforge.net/mailarchive/message.php?msg_id=28602009

Thanks for all the help!

Best wishes

Marco

> Hi Marco,
> 
> The headers look OK (at a quick glance).
> 
> If you look in dspace.log, you should see an error that will give a bit more 
> information:
> 
> // determine if this is an acceptable file format
>        if (!swordConfig.isAcceptableContentType(context, 
> deposit.getMimeType(), dso))
>        {
>            log.error("Unacceptable content type detected: " + 
> deposit.getMimeType() + " for object " + dso.getID());
>            throw new SwordError(UriRegistry.ERROR_CONTENT,
>                    "Unacceptable content type in deposit request: " + 
> deposit.getMimeType());
>        }
> 
> You need to POST the file to the collection URL described in the service 
> document. You don't need to first create an item.
> 
> Thanks,
> 
> 
> Stuart
> 
> 
> 
> -- 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
> 
> 
> -----Original Message-----
> From: Marco Fabiani [mailto:marco.fabi...@eecs.qmul.ac.uk] 
> Sent: 26 March 2012 16:33
> To: Richard Jones
> Cc: sword-app-tech@lists.sourceforge.net; LEWIS Stuart
> Subject: Re: [sword-app-tech] SWORD 2 and DSpace
> 
> Hi Richard,
> 
> I will look into how to create my own ingester, thanks.
> 
> Do you have any suggestions regarding the METS package ingestion (I'm using 
> the example package I found on the sword app website)? 
> 
>> 
>> I realise that all these problems might be solved by using a METSDSpaceSIP 
>> package instead, but I couldn't manage to ingest one, I keep getting Error 
>> 415: Unacceptable content.
>> 
>> Here are the headers I am posting (to the Collection IRI):
>> 
>> 'Content-Length': '33777', 'Content-Disposition': 'attachment; 
>> filename=example.zip', 'In-Progress': 'true', 'Content-MD5': 
>> '2b25f82ba67284461d4a481d7a06dd28', 'Packaging': 
>> 'http://purl.org/net/sword/package/METSDSpaceSIP', 'Content-Type': 
>> 'application/zip'
>> 
>> and the error message from the server:
>> 
>> <?xml version="1.0" encoding="ISO-8859-1"?> <sword:error 
>> href="http://purl.org/net/sword/error/ErrorContent"; 
>> xmlns:sword="http://purl.org/net/sword/terms/";><atom:title 
>> xmlns:atom="http://www.w3.org/2005/Atom"/><atom:updated 
>> xmlns:atom="http://www.w3.org/2005/Atom";>2012-03-26T14:43:03Z</atom:updated><atom:generator
>>  uri="http://www.dspace.org/ns/sword/2.0/"; version="2.0" 
>> xmlns:atom="http://www.w3.org/2005/Atom";>rdm.c...@gmail.com</atom:generator><sword:treatment>Processing
>>  failed</sword:treatment><atom:summary 
>> xmlns:atom="http://www.w3.org/2005/Atom";>Unacceptable content type in 
>> deposit request: 
>> application/zip</atom:summary><sword:verboseDescription>org.swordapp.server.SwordError:
>>  Unacceptable content type in deposit request: application/zip
>>      at 
>> org.dspace.sword2.DSpaceSwordAPI.isAcceptable(DSpaceSwordAPI.java:228)
>>      at 
>> org.dspace.sword2.CollectionDepositManagerDSpace.createNewFromBinary(CollectionDepositManagerDSpace.java:218)
>>      at 
>> org.dspace.sword2.CollectionDepositManagerDSpace.createNew(CollectionDepositManagerDSpace.java:112)
>>      at org.swordapp.server.CollectionAPI.post(CollectionAPI.java:158)
>>      at 
>> org.swordapp.server.servlets.CollectionServletDefault.doPost(CollectionServletDefault.java:48)
>>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>      at 
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>      at 
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>      at 
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>      at 
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>      at 
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>>      at 
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>      at 
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>      at 
>> org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperValve.java:156)
>>      at 
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
>>      at 
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
>>      at 
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
>>      at 
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>>      at java.lang.Thread.run(Thread.java:662)
>> </sword:verboseDescription></sword:error>
>> 
>> Is it correct to POST the package to the Collection, or should I first 
>> create an entry  and then post the package to the IRI of the newly created 
>> entry?
>> 
> 


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
sword-app-tech mailing list
sword-app-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sword-app-tech

Reply via email to