tomcatdspaceoai

How to correctly configure the Swordv2-Server with Dspace?


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?


Solution

  • 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.