Re: [dspace-tech] Enabling REST interface

2018-11-16 Thread Sean Carte
Hi Alan

I installed a new instance of DSpace-CRIS, and the REST interface does work.

Unfortunately, I'm still a bit stuck as the version on
https://github.com/4Science/DSpace is 5.10, but the version I have
installed on my production and dev servers is 5.8. I would simply upgrade,
but Symplectics is integrating Elements (yes, I know: we're integrating a
RIMS and CRIS ...) and they say they have problems with SWORDv2 in DSpace
5.10. Since I can't find a way to download any but the current version
(dspace-5_x_x-cris) from github, I guess I'm stuck.

I did try copying the 5.10 webapps/rest/WEB-INF/lib/ to the 5.8 server, but
that doesn't make any difference.

Anyway, thank you very much for your help, Alan. At least we know that a
solution exists.

On Thu, 15 Nov 2018 at 10:26, Alan Orth  wrote:

> Dear Sean,
>
> I'm not sure which package provides the SpringServlet class, but I have
> the following in my REST application directory on DSpace 5.8:
>
> dspace/webapps/rest/WEB-INF/lib/spring-aop-3.1.1.RELEASE.jar
> dspace/webapps/rest/WEB-INF/lib/spring-asm-3.1.1.RELEASE.jar
> dspace/webapps/rest/WEB-INF/lib/spring-beans-3.1.1.RELEASE.jar
> dspace/webapps/rest/WEB-INF/lib/spring-context-3.1.1.RELEASE.jar
> dspace/webapps/rest/WEB-INF/lib/spring-context-support-3.1.1.RELEASE.jar
> dspace/webapps/rest/WEB-INF/lib/spring-core-3.1.1.RELEASE.jar
> dspace/webapps/rest/WEB-INF/lib/spring-expression-3.1.1.RELEASE.jar
> dspace/webapps/rest/WEB-INF/lib/spring-web-3.1.1.RELEASE.jar
>
> Are you using a source or binary build for DSpace? Maybe you should try to
> mvn package again?
>
> Regards,
>
> On Wed, Nov 14, 2018 at 12:05 PM Sean Carte  wrote:
>
>> The /var/log/tomcat7/localhost.2018-11.14.log has some interesting info:
>> ...
>> INFO: Marking servlet DSpace REST API as unavailable
>> Nov 14, 2018 4:08:51 AM org.apache.catalina.core.StandardContext
>> loadOnStartup
>> SEVERE: Servlet [DSpace REST API] in web application [/rest] threw load()
>> exception
>> java.lang.ClassNotFoundException:
>> com.sun.jersey.spi.spring.container.servlet.SpringServlet
>> at
>> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1859)
>> at
>> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1702)
>> at
>> org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504)
>> at
>> org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486)
>> at
>> org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
>> at
>> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1146)
>> at
>> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085)
>> at
>> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5318)
>> at
>> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5610)
>> at
>> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
>> at
>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
>> at
>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
>> at
>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
>> at
>> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677)
>> at
>> org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962)
>> at
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>> at java.lang.Thread.run(Thread.java:748)
>>
>> Looks like I'm missing the SpringServlet class, but where would I get
>> this?
>>
>> I'm using openjdk version "1.8.0_181", if that's at all relevant.
>>
>> On Wed, 14 Nov 2018 at 11:46, Alan Orth  wrote:
>>
>>> Dear Sean,
>>>
>>> It's "good" that the /rest path doesn't work either. So something is
>>> wrong with the loading of this application. Restart Tomcat and watch the
>>> logs as it loads each application (xmlui, solr, rest, etc). On Ubuntu that
>>> would be the general Tomcat Catalina logs[0] and localhost container
>>> logs[1].
>>>
>>> Regards,
>>>
>>> [0] /var/log/tomcat7/catalina.out
>>> [1] /var/log/tomcat7/localhost.2018-11-14.log
>>>
>>> On Wed, Nov 14, 2018 at 11:42 AM Sean Carte 
>>> wrote:
>>>
 Also, the permissions are the same as for all the other webapps,
 including sword2 and jspui, which do work.

 On Wed, 14 Nov 2018 at 11:40, Sean Carte  wrote:

> Thanks for responding, Alan.
>
> Yes, the path exists:
> dspace@dev-ir:~$ ls 

Re: [dspace-tech] Enabling REST interface

2018-11-15 Thread Sean Carte
Thanks, Terry, I did comment out the security-constraint section in:
/dspacecris-dut/webapps/rest/WEB-INF/web.xml

On Thu, 15 Nov 2018 at 20:58, Terry Brady 
wrote:

> If you are running DSpace 5+, the REST api requires ssh by default.
>
> You can comment that requirement out in the web.xml file for the rest
> webapp.
>
>
> https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace-rest/src/main/webapp/WEB-INF/web.xml#L45-L54
>
> On Wed, Nov 14, 2018 at 1:42 AM Sean Carte  wrote:
>
>> Also, the permissions are the same as for all the other webapps,
>> including sword2 and jspui, which do work.
>>
>> On Wed, 14 Nov 2018 at 11:40, Sean Carte  wrote:
>>
>>> Thanks for responding, Alan.
>>>
>>> Yes, the path exists:
>>> dspace@dev-ir:~$ ls /dspacecris-dut/webapps/rest/
>>> ametrics  common  css  image  index.jsp  js  META-INF  static  WEB-INF
>>>
>>> Same 404 for the root:
>>> dspace@dev-ir:~$ curl -s -H "Accept: application/xml"
>>> http://localhost:8080/restApache Tomcat/7.0.68
>>> (Ubuntu) - Error report...HTTP Status 404 - ...
>>>
>>> On Wed, 14 Nov 2018 at 11:30, Alan Orth  wrote:
>>>
 Dear Sean,

 Does the root path for the rest API work, ie /rest? Also, some basic
 sanity checking: make sure the path you gave as the context docBase exists:

 $ ls -l /dspacecris-dut/webapps/rest

 Cheers,

 On Tue, Nov 13, 2018 at 8:45 AM Sean Carte 
 wrote:

> I'm trying to enable the REST interface, but am just getting a 404:
> curl -s -H "Accept: application/xml"
> http://localhost:8080/rest/communities
> Apache Tomcat/7.0.68 (Ubuntu) - Error
> 

Re: [dspace-tech] Enabling REST interface

2018-11-15 Thread Terry Brady
If you are running DSpace 5+, the REST api requires ssh by default.

You can comment that requirement out in the web.xml file for the rest
webapp.

https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace-rest/src/main/webapp/WEB-INF/web.xml#L45-L54

On Wed, Nov 14, 2018 at 1:42 AM Sean Carte  wrote:

> Also, the permissions are the same as for all the other webapps, including
> sword2 and jspui, which do work.
>
> On Wed, 14 Nov 2018 at 11:40, Sean Carte  wrote:
>
>> Thanks for responding, Alan.
>>
>> Yes, the path exists:
>> dspace@dev-ir:~$ ls /dspacecris-dut/webapps/rest/
>> ametrics  common  css  image  index.jsp  js  META-INF  static  WEB-INF
>>
>> Same 404 for the root:
>> dspace@dev-ir:~$ curl -s -H "Accept: application/xml"
>> http://localhost:8080/restApache Tomcat/7.0.68
>> (Ubuntu) - Error report...HTTP Status 404 - ...
>>
>> On Wed, 14 Nov 2018 at 11:30, Alan Orth  wrote:
>>
>>> Dear Sean,
>>>
>>> Does the root path for the rest API work, ie /rest? Also, some basic
>>> sanity checking: make sure the path you gave as the context docBase exists:
>>>
>>> $ ls -l /dspacecris-dut/webapps/rest
>>>
>>> Cheers,
>>>
>>> On Tue, Nov 13, 2018 at 8:45 AM Sean Carte  wrote:
>>>
 I'm trying to enable the REST interface, but am just getting a 404:
 curl -s -H "Accept: application/xml"
 http://localhost:8080/rest/communities
 Apache Tomcat/7.0.68 (Ubuntu) - Error
 

Re: [dspace-tech] Enabling REST interface

2018-11-15 Thread Alan Orth
Dear Sean,

I'm not sure which package provides the SpringServlet class, but I have the
following in my REST application directory on DSpace 5.8:

dspace/webapps/rest/WEB-INF/lib/spring-aop-3.1.1.RELEASE.jar
dspace/webapps/rest/WEB-INF/lib/spring-asm-3.1.1.RELEASE.jar
dspace/webapps/rest/WEB-INF/lib/spring-beans-3.1.1.RELEASE.jar
dspace/webapps/rest/WEB-INF/lib/spring-context-3.1.1.RELEASE.jar
dspace/webapps/rest/WEB-INF/lib/spring-context-support-3.1.1.RELEASE.jar
dspace/webapps/rest/WEB-INF/lib/spring-core-3.1.1.RELEASE.jar
dspace/webapps/rest/WEB-INF/lib/spring-expression-3.1.1.RELEASE.jar
dspace/webapps/rest/WEB-INF/lib/spring-web-3.1.1.RELEASE.jar

Are you using a source or binary build for DSpace? Maybe you should try to
mvn package again?

Regards,

On Wed, Nov 14, 2018 at 12:05 PM Sean Carte  wrote:

> The /var/log/tomcat7/localhost.2018-11.14.log has some interesting info:
> ...
> INFO: Marking servlet DSpace REST API as unavailable
> Nov 14, 2018 4:08:51 AM org.apache.catalina.core.StandardContext
> loadOnStartup
> SEVERE: Servlet [DSpace REST API] in web application [/rest] threw load()
> exception
> java.lang.ClassNotFoundException:
> com.sun.jersey.spi.spring.container.servlet.SpringServlet
> at
> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1859)
> at
> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1702)
> at
> org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504)
> at
> org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486)
> at
> org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1146)
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085)
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5318)
> at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5610)
> at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
> at
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677)
> at
> org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
>
> Looks like I'm missing the SpringServlet class, but where would I get this?
>
> I'm using openjdk version "1.8.0_181", if that's at all relevant.
>
> On Wed, 14 Nov 2018 at 11:46, Alan Orth  wrote:
>
>> Dear Sean,
>>
>> It's "good" that the /rest path doesn't work either. So something is
>> wrong with the loading of this application. Restart Tomcat and watch the
>> logs as it loads each application (xmlui, solr, rest, etc). On Ubuntu that
>> would be the general Tomcat Catalina logs[0] and localhost container
>> logs[1].
>>
>> Regards,
>>
>> [0] /var/log/tomcat7/catalina.out
>> [1] /var/log/tomcat7/localhost.2018-11-14.log
>>
>> On Wed, Nov 14, 2018 at 11:42 AM Sean Carte  wrote:
>>
>>> Also, the permissions are the same as for all the other webapps,
>>> including sword2 and jspui, which do work.
>>>
>>> On Wed, 14 Nov 2018 at 11:40, Sean Carte  wrote:
>>>
 Thanks for responding, Alan.

 Yes, the path exists:
 dspace@dev-ir:~$ ls /dspacecris-dut/webapps/rest/
 ametrics  common  css  image  index.jsp  js  META-INF  static  WEB-INF

 Same 404 for the root:
 dspace@dev-ir:~$ curl -s -H "Accept: application/xml"
 http://localhost:8080/restApache Tomcat/7.0.68
 (Ubuntu) - Error report...HTTP Status 404 - ...

 On Wed, 14 Nov 2018 at 11:30, Alan Orth  wrote:

> Dear Sean,
>
> Does the root path for the rest API work, ie /rest? Also, some basic
> sanity checking: make sure the path you gave as the context docBase 
> exists:
>
> $ ls -l /dspacecris-dut/webapps/rest
>
> Cheers,
>
> On Tue, Nov 13, 2018 at 8:45 AM Sean Carte 
> wrote:
>
>> I'm trying to enable the REST interface, but am just getting a 404:
>> curl -s -H "Accept: application/xml"
>> http://localhost:8080/rest/communities
>> Apache Tomcat/7.0.68 (Ubuntu) - Error
>> 

Re: [dspace-tech] Enabling REST interface

2018-11-14 Thread Sean Carte
The /var/log/tomcat7/localhost.2018-11.14.log has some interesting info:
...
INFO: Marking servlet DSpace REST API as unavailable
Nov 14, 2018 4:08:51 AM org.apache.catalina.core.StandardContext
loadOnStartup
SEVERE: Servlet [DSpace REST API] in web application [/rest] threw load()
exception
java.lang.ClassNotFoundException:
com.sun.jersey.spi.spring.container.servlet.SpringServlet
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1859)
at
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1702)
at
org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504)
at
org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486)
at
org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1146)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1085)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5318)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5610)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:677)
at
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1962)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Looks like I'm missing the SpringServlet class, but where would I get this?

I'm using openjdk version "1.8.0_181", if that's at all relevant.

On Wed, 14 Nov 2018 at 11:46, Alan Orth  wrote:

> Dear Sean,
>
> It's "good" that the /rest path doesn't work either. So something is wrong
> with the loading of this application. Restart Tomcat and watch the logs as
> it loads each application (xmlui, solr, rest, etc). On Ubuntu that would be
> the general Tomcat Catalina logs[0] and localhost container logs[1].
>
> Regards,
>
> [0] /var/log/tomcat7/catalina.out
> [1] /var/log/tomcat7/localhost.2018-11-14.log
>
> On Wed, Nov 14, 2018 at 11:42 AM Sean Carte  wrote:
>
>> Also, the permissions are the same as for all the other webapps,
>> including sword2 and jspui, which do work.
>>
>> On Wed, 14 Nov 2018 at 11:40, Sean Carte  wrote:
>>
>>> Thanks for responding, Alan.
>>>
>>> Yes, the path exists:
>>> dspace@dev-ir:~$ ls /dspacecris-dut/webapps/rest/
>>> ametrics  common  css  image  index.jsp  js  META-INF  static  WEB-INF
>>>
>>> Same 404 for the root:
>>> dspace@dev-ir:~$ curl -s -H "Accept: application/xml"
>>> http://localhost:8080/restApache Tomcat/7.0.68
>>> (Ubuntu) - Error report...HTTP Status 404 - ...
>>>
>>> On Wed, 14 Nov 2018 at 11:30, Alan Orth  wrote:
>>>
 Dear Sean,

 Does the root path for the rest API work, ie /rest? Also, some basic
 sanity checking: make sure the path you gave as the context docBase exists:

 $ ls -l /dspacecris-dut/webapps/rest

 Cheers,

 On Tue, Nov 13, 2018 at 8:45 AM Sean Carte 
 wrote:

> I'm trying to enable the REST interface, but am just getting a 404:
> curl -s -H "Accept: application/xml"
> http://localhost:8080/rest/communities
> Apache Tomcat/7.0.68 (Ubuntu) - Error
> 

Re: [dspace-tech] Enabling REST interface

2018-11-14 Thread Sean Carte
Also, the permissions are the same as for all the other webapps, including
sword2 and jspui, which do work.

On Wed, 14 Nov 2018 at 11:40, Sean Carte  wrote:

> Thanks for responding, Alan.
>
> Yes, the path exists:
> dspace@dev-ir:~$ ls /dspacecris-dut/webapps/rest/
> ametrics  common  css  image  index.jsp  js  META-INF  static  WEB-INF
>
> Same 404 for the root:
> dspace@dev-ir:~$ curl -s -H "Accept: application/xml"
> http://localhost:8080/restApache Tomcat/7.0.68
> (Ubuntu) - Error report...HTTP Status 404 - ...
>
> On Wed, 14 Nov 2018 at 11:30, Alan Orth  wrote:
>
>> Dear Sean,
>>
>> Does the root path for the rest API work, ie /rest? Also, some basic
>> sanity checking: make sure the path you gave as the context docBase exists:
>>
>> $ ls -l /dspacecris-dut/webapps/rest
>>
>> Cheers,
>>
>> On Tue, Nov 13, 2018 at 8:45 AM Sean Carte  wrote:
>>
>>> I'm trying to enable the REST interface, but am just getting a 404:
>>> curl -s -H "Accept: application/xml"
>>> http://localhost:8080/rest/communities
>>> Apache Tomcat/7.0.68 (Ubuntu) - Error
>>> 

Re: [dspace-tech] Enabling REST interface

2018-11-14 Thread Alan Orth
Dear Sean,

It's "good" that the /rest path doesn't work either. So something is wrong
with the loading of this application. Restart Tomcat and watch the logs as
it loads each application (xmlui, solr, rest, etc). On Ubuntu that would be
the general Tomcat Catalina logs[0] and localhost container logs[1].

Regards,

[0] /var/log/tomcat7/catalina.out
[1] /var/log/tomcat7/localhost.2018-11-14.log

On Wed, Nov 14, 2018 at 11:42 AM Sean Carte  wrote:

> Also, the permissions are the same as for all the other webapps, including
> sword2 and jspui, which do work.
>
> On Wed, 14 Nov 2018 at 11:40, Sean Carte  wrote:
>
>> Thanks for responding, Alan.
>>
>> Yes, the path exists:
>> dspace@dev-ir:~$ ls /dspacecris-dut/webapps/rest/
>> ametrics  common  css  image  index.jsp  js  META-INF  static  WEB-INF
>>
>> Same 404 for the root:
>> dspace@dev-ir:~$ curl -s -H "Accept: application/xml"
>> http://localhost:8080/restApache Tomcat/7.0.68
>> (Ubuntu) - Error report...HTTP Status 404 - ...
>>
>> On Wed, 14 Nov 2018 at 11:30, Alan Orth  wrote:
>>
>>> Dear Sean,
>>>
>>> Does the root path for the rest API work, ie /rest? Also, some basic
>>> sanity checking: make sure the path you gave as the context docBase exists:
>>>
>>> $ ls -l /dspacecris-dut/webapps/rest
>>>
>>> Cheers,
>>>
>>> On Tue, Nov 13, 2018 at 8:45 AM Sean Carte  wrote:
>>>
 I'm trying to enable the REST interface, but am just getting a 404:
 curl -s -H "Accept: application/xml"
 http://localhost:8080/rest/communities
 Apache Tomcat/7.0.68 (Ubuntu) - Error
 

Re: [dspace-tech] Enabling REST interface

2018-11-14 Thread Alan Orth
Dear Sean,

Does the root path for the rest API work, ie /rest? Also, some basic sanity
checking: make sure the path you gave as the context docBase exists:

$ ls -l /dspacecris-dut/webapps/rest

Cheers,

On Tue, Nov 13, 2018 at 8:45 AM Sean Carte  wrote:

> I'm trying to enable the REST interface, but am just getting a 404:
> curl -s -H "Accept: application/xml"
> http://localhost:8080/rest/communities
> Apache Tomcat/7.0.68 (Ubuntu) - Error
> 

[dspace-tech] Enabling REST interface

2018-11-12 Thread Sean Carte
I'm trying to enable the REST interface, but am just getting a 404:
curl -s -H "Accept: application/xml" http://localhost:8080/rest/communities
Apache Tomcat/7.0.68 (Ubuntu) - Error