Something wrong with REST API - DSpace 5.4

119 views
Skip to first unread message

Evgeni Dimitrov

unread,
Feb 23, 2016, 11:03:39 AM2/23/16
to dspac...@googlegroups.com
I have used REST API with DSpace 5.2 and Windows. Now I am trying with DSpace 5.4 and Linux. Doing not the same but very similar thing. Trying to get a community by handle.

I am getting in the DSpace log

2016-02-23 17:24:12,947 INFO  org.dspace.rest.RestIndex @ REST Login Success for user: xxxx@yyyy
2016-02-23 17:24:12,973 INFO  org.dspace.rest.HandleResource @ DSO Lookup by handle: [nls] / [94] got result of: COMMUNITY_17
2016-02-23 17:24:13,091 ERROR org.dspace.rest.Resource @ Something get wrong. Aborting context in finally statement.
2016-02-23 17:24:13,104 INFO  org.dspace.rest.RestIndex @ REST Logout: xxxx@yyyy

In the Tomcat log there is more - see bellow.

Has anybody any ideas?

============================================
23-Feb-2016 17:24:13.091 SEVERE [http-nio-8080-exec-4] com.sun.jersey.spi.container.ContainerResponse.logException Mapped exception to response: 500 (Internal Server Error)
 javax.ws.rs.WebApplicationException
    at org.dspace.rest.Resource.processFinally(Resource.java:169)
    at org.dspace.rest.HandleResource.getObject(HandleResource.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
    at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
    at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
    at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)


Faiyaz Ahmed

unread,
Feb 23, 2016, 4:37:15 PM2/23/16
to DSpace Technical Support
I was just about to submit this post and you done it. 

I'm facing same while access via REST API. URL for the rest api is :  http://localhost:8080/rest/handle/3015/23

Tomcat Logs : 

192.168.163.1 - - [24/Feb/2016:00:34:33 +0300] "GET /rest/handle/3015/23 HTTP/1.1" 500 -
192.168.163.1 - - [24/Feb/2016:00:34:36 +0300] "GET /rest/handle/3015/23 HTTP/1.1" 500 -

Dspace 5.4 version logs :


2016-02-24 00:34:33,783 ERROR org.dspace.rest.Resource @ Something get wrong. Aborting context in finally statement.
2016-02-24 00:34:36,643 ERROR org.dspace.rest.Resource @ Something get wrong. Aborting context in finally statement.


Please update if any one have idea on this error.

Evgeni Dimitrov

unread,
Feb 23, 2016, 4:45:25 PM2/23/16
to DSpace Technical Support
Yes, see my other post "A bug in REST API introduced in 5.3 or 5.4"
I think the fix is in org.dspace.rest.HandleResource in the following code to add context.complete()
after the switch.

if(AuthorizeManager.authorizeActionBoolean(context, dso, org.dspace.core.Constants.READ)) {
    switch(dso.getType()) {
        case Constants.COMMUNITY:
            return new Community((org.dspace.content.Community) dso, expand, context);
        case Constants.COLLECTION:
            return new Collection((org.dspace.content.Collection) dso, expand, context, null, null);
        case Constants.ITEM:
            return new Item((org.dspace.content.Item) dso, expand, context);
        default:
            return new DSpaceObject(dso);
    }
} else {

Evgeni Dimitrov

unread,
Feb 23, 2016, 4:49:46 PM2/23/16
to DSpace Technical Support
Well, not literary this - it will not be executed there - but this is the idea - to close the context after normal execution.


On Tuesday, February 23, 2016 at 11:37:15 PM UTC+2, Faiyaz Ahmed wrote:

Alan Orth

unread,
Apr 20, 2016, 2:03:18 PM4/20/16
to Evgeni Dimitrov, DSpace Technical Support
A few days ago I started getting an alarming number of these errors as well:

# grep -c "Aborting context in finally statement" dspace.log.2016-04-20
21151

Does anyone know what might be causing this? I'm not running any REST requests myself, so I'm not sure what is causing it (seems to be external users of our REST API). DSpace version 5.1, Tomcat 7, PostgreSQL 9.3.

Thanks,

--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.
--

Alan Orth

unread,
Apr 20, 2016, 4:33:09 PM4/20/16
to Evgeni Dimitrov, DSpace Technical Support
Hmm, seems DSpace 5.5 had a fix for this:

Reply all
Reply to author
Forward
0 new messages