Sword Plugin Problem on OJS 2.4.5.0 when exporting to Dspace 5.5

We’ve enabled Dspace 5.5 Sword and Swordv2 servers and we’ve configured on OJS 2.4.5 two deposit points: one for each Dspace Sword server version.

When we try to make a deposit, no matter sword or sword2 deposit point we’ve choosen, the OJS plugin shows this error message:
“Error parsing error document (String could not be parsed as XML)”.

Does someone can help me to solve this problem?

Edmilson
ejsboregas

Hi @ejsboregas,

That’s coming from the third-party SwordApp library that OJS uses to interact with DSpace. The message in question comes from lib/pkp/lib/swordappv2/swordappclient.php around line 127:

throw new Exception("Error parsing error document (" . $e->getMessage() . ")");

If I were debugging this, I’d temporarily edit that code to dump out the response DSpace is serving back to OJS to see whether it contains an error message or something similar.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

How can I do this debugging? Could you help me?

If you prefer, we can chat by my Skype account: ejsboregas

Edmilson José Boregas, São Paulo, Brasil
Fundação Getulio Vargas

Hi @ejsboregas,

This is third-party code (i.e. we don’t maintain it) – you’ll need a little bit of PHP experience to investigate. But I’d suggest inspecting the $sac_resp variable, which should contain the text response from the server; the PHP error_log function might be useful.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher, thanks a lot!

Your tips were so usefull. I will try to find someone in my institutions that has expertise in PHP.

Anyway, do you know who maintain (or even has created) this Sword OJS plugin? It is from 7 years ago!!!

Edmilson José Boregas, São Paulo, Brasil
Fundação Getulio Vargas

Hi @ejsboregas,

I wrote the SWORD plugin, but it also includes the third-party SWORD library, and the code in question lives there.

(In case you’re interested, we do have a developer working on upgrading the SWORD plugin for OJS so that it works with OJS 3.x. But I don’t think that’ll help you with the immediate problem here.)

Regards,
Alec Smecher
Public Knowledge Project Team