2

I have to configure the Swordv2 Server on an exisitng Dspace installation to allow access via SwordV2 protocol. I have looked at duraspace's instruction, the swordv2 app at [dspace]/webapps/swordv2/ seems to be available in the tomcat webapps folder and the Sword2 config file is locatet at the right place ([dspace]/config/modules/swordv2-server.cfg).

Yet changes to the config file seem to have no effect. What am I doing wrong here?

UPDATE
This is the sword specific output of tomcat after restart:

Nov 14 08:10:33 ub11 server: INFORMATION: Deploying web application directory /data/dspace/webapps-deploy/swordv2
Nov 14 08:10:37 ub11 server: INFO [localhost-startStop-1] (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from URL [jar:file:/data/dspace/webapps/swordv2/WEB-INF/lib/additions-5.3.jar!/spring/spring-dspace-addon-example-services.xml]
Nov 14 08:10:37 ub11 server: INFO [localhost-startStop-1] (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from URL [jar:file:/data/dspace/webapps/swordv2/WEB-INF/lib/dspace-api-5.3.jar!/spring/spring-dspace-addon-sherpa-configuration-services.xml]
Nov 14 08:10:37 ub11 server: INFO [localhost-startStop-1] (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from URL [jar:file:/data/dspace/webapps/swordv2/WEB-INF/lib/dspace-api-5.3.jar!/spring/spring-dspace-addon-requestitem-services.xml]
Nov 14 08:10:37 ub11 server: INFO [localhost-startStop-1] (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from URL [jar:file:/data/dspace/webapps/swordv2/WEB-INF/lib/dspace-api-5.3.jar!/spring/spring-dspace-addon-sherpa-services.xml]
Nov 14 08:10:37 ub11 server: INFO [localhost-startStop-1] (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from URL [jar:file:/data/dspace/webapps/swordv2/WEB-INF/lib/dspace-api-5.3.jar!/spring/spring-dspace-addon-discovery-services.xml]
Nov 14 08:10:37 ub11 server: INFO [localhost-startStop-1] (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from URL [jar:file:/data/dspace/webapps/swordv2/WEB-INF/lib/dspace-api-5.3.jar!/spring/spring-dspace-core-services.xml]
Nov 14 08:10:37 ub11 server: INFO [localhost-startStop-1] (XmlBeanDefinitionReader.java:315) - Loading XML bean definitions from URL [jar:file:/data/dspace/webapps/swordv2/WEB-INF/lib/dspace-services-5.3.jar!/spring/spring-dspace-core-services.xml]
Nov 14 08:10:37 ub11 server: INFO [localhost-startStop-1] (DefaultListableBeanFactory.java:623) - Overriding bean definition for bean 'org.dspace.identifier.IdentifierService': replacing [Generic bean: class [org.dspace.identifier.IdentifierServiceImpl]; scope=singleton; abstract=false; lazyInit=false; autowireMode=2; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/data/dspace/webapps/swordv2/WEB-INF/lib/dspace-api-5.3.jar!/spring/spring-dspace-core-services.xml]] with [Generic bean: class [org.dspace.identifier.IdentifierServiceImpl]; scope=singleton; abstract=false; lazyInit=false; autowireMode=2; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [/opt/dspace/config/spring/api/identifier-service.xml]]
Nov 14 08:10:37 ub11 server: INFO [localhost-startStop-1] (DefaultListableBeanFactory.java:623) - Overriding bean definition for bean 'org.dspace.app.requestitem.RequestItemAuthorExtractor': replacing [Generic bean: class [org.dspace.app.requestitem.RequestItemMetadataStrategy]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/data/dspace/webapps/swordv2/WEB-INF/lib/dspace-api-5.3.jar!/spring/spring-dspace-addon-requestitem-services.xml]] with [Generic bean: class [org.dspace.app.requestitem.RequestItemMetadataStrategy]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [/opt/dspace/config/spring/api/requestitem.xml]]
Nov 14 08:10:37 ub11 server: INFO [localhost-startStop-1] (DefaultListableBeanFactory.java:623) - Overriding bean definition for bean 'org.dspace.app.sherpa.submit.SHERPASubmitConfigurationService': replacing [Generic bean: class [org.dspace.app.sherpa.submit.SHERPASubmitConfigurationService]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/data/dspace/webapps/swordv2/WEB-INF/lib/dspace-api-5.3.jar!/spring/spring-dspace-addon-sherpa-configuration-services.xml]] with [Generic bean: class [org.dspace.app.sherpa.submit.SHERPASubmitConfigurationService]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [/opt/dspace/config/spring/api/sherpa.xml]]
Nov 14 08:10:38 ub11 server: INFORMATION: Deployment of web application directory /data/dspace/webapps-deploy/swordv2 has finished in 5,024 ms


This is my swordv2-server.cfg:

url = https://somedomain.de/swordv2
collection.url = https://somedomain.de/swordv2/collection
servicedocument.url = https://somedomain.de/swordv2/servicedocument

This is from dspace.cfg:

dspace.hostname = somedomain.de
dspace.baseUrl = https://somedomain.de
dspace.url = https://somedomain.de/xmlui


Real names have been replaced with 'somedomain'.

If i call an url like somedomain.de/swordv2/servicedocument i get a 404 Not found.

UPDATE 2:
I rebooted the machine and now sword shows up in my dspace log:

2017-11-15 12:50:10,337 INFO  org.swordapp.server.servlets.SwordServlet @ Using org.dspace.sword2.SwordConfigurationDSpace as 'config-impl'
2017-11-15 12:50:10,340 INFO  org.swordapp.server.servlets.SwordServlet @ Using org.dspace.sword2.ServiceDocumentManagerDSpace as 'service-document-impl'
2017-11-15 12:50:10,347 INFO  org.swordapp.server.SwordAPIEndpoint @ Auth type = None
2017-11-15 12:50:10,488 INFO  org.dspace.sword2.SwordAuthenticator @ anonymous:session_id=0:sword_authenticate:username=null,on_behalf_of=null
2017-11-15 12:50:10,494 INFO  org.dspace.sword2.SwordAuthenticator @ anonymous:session_id=0:sword_unable_to_set_on_behalf_of:username=null,on_behalf_of=null

I have set authentication in sword server config to None temporarily. When I try to access the service document with curl, I get a 403 Status code from tomcat ("Access to the specified resource has been forbidden"). I guess all that's left to do now is reconfiguring access in tomcat?

Fab
  • 57
  • 5
  • You need to restart tomcat after changing the config file, are you doing that? Also, is there anything useful in the DSpace log file when you try to access eg the servicedocument? – schweerelos Nov 09 '17 at 03:48
  • I restarted the server and checked the dspace log. No output concerning a servicedocument or swordv2. Is there a way to fiind out if the SwordV2-Module is up and running? The sword module seems to be lying in the tomcat's baseApps folder ..... – Fab Nov 10 '17 at 10:09
  • The servicedocument URL is in your swordv2-server settings. Try accessing it. – schweerelos Nov 12 '17 at 20:25
  • Also - if you don't know how to access the Swordv2 module, how do you know your changed settings aren't taking? – schweerelos Nov 12 '17 at 20:26
  • I have full access to the swordv2-server.cfg. When i try to access the service document I get a 404 Not found. No authentication request and nothing else .... – Fab Nov 13 '17 at 06:21
  • This is really difficult to diagnose without more information about your set-up -- eg, what URL are you using to access the service document; what are your url and servicedocument.url in swordv2-server.cfg. In order to check whether the swordv2 module is deployed, check whether there is any reference to it in the Tomcat log file. – schweerelos Nov 14 '17 at 03:35
  • Thanks for your help schweerelos, I have updated the question with the tomcat output and dspace / sword configuration. – Fab Nov 14 '17 at 07:37
  • Thanks, that extra information is helpful. That's all looking good. Is there anything in the DSpace log file when you access the https://somedomain.de/swordv2/servicedocument URL? – schweerelos Nov 14 '17 at 22:10
  • There is unfortunately no relevant output in the dspace log file. Sword isn't mentioned at all neither are the servicedocument or the swordv2-server.cfg. I'm not sure if this is relevant but the tomcat server is running in combination with httpd as webserver. Could this be part of the problem? What puzzles me however is that there's absolutely no output from the swordv2 module except that it seems to deploy just fine. I also checked the audit.log to see if there are any problems with selinux, but I couldn't find any problems there either.... – Fab Nov 15 '17 at 00:04
  • The sword module seems to work now after a system reboot but I still cant access the document. I updated the question with the log output. – Fab Nov 15 '17 at 14:21
  • From the dspace.log output it looks like your authentication methods are not set up right. I believe swordv2 requires you to have password authentication enabled. – schweerelos Nov 16 '17 at 00:46
  • You were right schweerelos, I had to use a local dspace account to access the servicedocument (instead of our organisation's shibboleth login). The sword interface is now accessible. Thank you for your help! – Fab Nov 20 '17 at 08:22
  • Glad to hear you got it working! I've re-posted my comment regarding the authentication as an answer below so you can mark it as accepted if you like :) – schweerelos Nov 21 '17 at 00:13

1 Answers1

0

From the dspace.log output it looks like your authentication methods are not set up right. I believe swordv2 requires you to have password authentication enabled.

schweerelos
  • 2,189
  • 2
  • 17
  • 25