Project

General

Profile

Bug #7225

/object/id command get a null exception if there the object format is not found

Added by Jing Tao about 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
11/07/2017
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:

Description

Val from ess-dive reported:
```mn_1 | In D1URLFilter.
mn_1 | HTTP Verb: GET
mn_1 | original pathInfo: /object
mn_1 | original requestURI: /metacat/d1/mn/v2/object
mn_1 | stripping /metacat/d1/mn/v2 from requestURI
mn_1 | new pathinfo: /object
mn_1 | In D1URLFilter.
mn_1 | HTTP Verb: GET
mn_1 | original pathInfo: /object/10.5072/D3P26Q35R-Test2
mn_1 | original requestURI: /metacat/d1/mn/v2/object/10.5072/D3P26Q35R-Test2
mn_1 | stripping /metacat/d1/mn/v2 from requestURI
mn_1 | new pathinfo: /object/10.5072/D3P26Q35R-Test2
mn_1 | After decoded: 10.5072/D3P26Q35R-Test2
mn_1 | metacat 20171107-20:49:17: [DEBUG]: In isAdminAuthorized(), session is null [edu.ucsb.nceas.metacat.dataone.D1NodeService:isAdminAuthorized:1010]
mn_1 | metacat 20171107-20:49:17: [DEBUG]: D1NodeService.isAuthoritativeMNodeAdmin - the session object is null and return false. [edu.ucsb.nceas.metacat.dataone.D1NodeService:isAuthoritativeMNodeAdmin:924]
mn_1 | metacat 20171107-20:49:17: [DEBUG]: Comparing the rights holder in the system metadata 0000-0001-9061-8952 against one of the client's subject public [edu.ucsb.nceas.metacat.dataone.D1NodeService:userHasPermission:1248]
mn_1 | metacat 20171107-20:49:17: [DEBUG]: D1NodeService.expandRightHolder - at the start of method: after getting the cn node and cn node is https://cn-stage-2.test.dataone.org/cn/v2 [edu.ucsb.nceas.metacat.dataone.D1NodeService:expandRightsHolder:1312]
mn_1 | metacat 20171107-20:49:17: [DEBUG]: D1NodeService.expandRightHolder - search the subject 0000-0001-9061-8952 in the cn and the returned result is not null [edu.ucsb.nceas.metacat.dataone.D1NodeService:expandRightsHolder:1321]
mn_1 | metacat 20171107-20:49:17: [DEBUG]: D1NodeService.isInGroups - the given groups' (the returned result including groups) size is 0 [edu.ucsb.nceas.metacat.dataone.D1NodeService:isInGroups:1374]
mn_1 | metacat 20171107-20:49:17: [DEBUG]: D1NodeService.expandRightHolder - we are already at the end of the returned restult since the size of returned results 1 is less than the count 200. So we have to break the loop and finish the try. [edu.ucsb.nceas.metacat.dataone.D1NodeService:expandRightsHolder:1346]
mn_1 | metacat 20171107-20:49:17: [DEBUG]: D1NodeService.expandRightHolder - We can NOT find any member in the group 0000-0001-9061-8952 (if it is a group) matches the user public [edu.ucsb.nceas.metacat.dataone.D1NodeService:expandRightsHolder:1359]
mn_1 | metacat 20171107-20:49:17: [DEBUG]: Checking allow access rule for subject: public [edu.ucsb.nceas.metacat.dataone.D1NodeService:userHasPermission:1270]
mn_1 | metacat 20171107-20:49:17: [DEBUG]: Access rule contains subject: public [edu.ucsb.nceas.metacat.dataone.D1NodeService:userHasPermission:1272]
mn_1 | metacat 20171107-20:49:17: [DEBUG]: Checking permission: read [edu.ucsb.nceas.metacat.dataone.D1NodeService:userHasPermission:1274]
mn_1 | metacat 20171107-20:49:17: [INFO]: Permission granted: read to public [edu.ucsb.nceas.metacat.dataone.D1NodeService:userHasPermission:1278]
mn_1 | metacat 20171107-20:49:17: [ERROR]: class java.lang.NullPointerException: null [edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler:handle:526]
mn_1 | java.lang.NullPointerException
mn_1 | at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.getObject(MNResourceHandler.java:1271)
mn_1 | at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.handle(MNResourceHandler.java:285)
mn_1 | at edu.ucsb.nceas.metacat.restservice.D1RestServlet.doGet(D1RestServlet.java:76)
mn_1 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
mn_1 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
mn_1 | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
mn_1 | at edu.ucsb.nceas.metacat.restservice.D1URLFilter.doFilter(D1URLFilter.java:48)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
mn_1 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
mn_1 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
mn_1 | at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
mn_1 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
mn_1 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
mn_1 | at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
mn_1 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
mn_1 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
mn_1 | at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:188)
mn_1 | at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
mn_1 | at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2549)
mn_1 | at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2538)
mn_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
mn_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
mn_1 | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
mn_1 | at java.lang.Thread.run(Thread.java:748)
mn_1 | metacat 20171107-20:49:17: [ERROR]: D1ResourceHandler: Serializing exception with code 500: null [edu.ucsb.nceas.metacat.restservice.D1ResourceHandler:serializeException:533]
mn_1 | org.dataone.service.exceptions.ServiceFailure
mn_1 | at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.handle(MNResourceHandler.java:533)
mn_1 | at edu.ucsb.nceas.metacat.restservice.D1RestServlet.doGet(D1RestServlet.java:76)
mn_1 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
mn_1 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
mn_1 | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
mn_1 | at edu.ucsb.nceas.metacat.restservice.D1URLFilter.doFilter(D1URLFilter.java:48)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
mn_1 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
mn_1 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
mn_1 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
mn_1 | at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
mn_1 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
mn_1 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
mn_1 | at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
mn_1 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
mn_1 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
mn_1 | at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:188)
mn_1 | at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
mn_1 | at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2549)
mn_1 | at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2538)
mn_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
mn_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
mn_1 | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
mn_1 | at java.lang.Thread.run(Thread.java:748)
```

History

#1 Updated by Jing Tao about 2 years ago

  • Status changed from New to Resolved

In the class src/edu/ucsb/nceas/metacat/restservice/v2/MNResourceHandler.java, the code to handle null exception was added.

#2 Updated by Jing Tao almost 2 years ago

  • Target version changed from 2.9.0 to 2.8.6

Also available in: Atom PDF