Bug #7268
The second time to call mn.updateSystem got an exception
100%
Description
First time to call the mn.updateSystem succeeded. However, the second to call it failed. I didn't change the dateUploaded at all.
metacat 20150721-21:50:02: [ERROR]: D1ResourceHandler: Serializing exception with code 400: The request is trying to modify an immutable field in the SystemMeta: the new system meta's date of uploaded Tue Jul 21 00:00:00 UTC 2015 is different to the orginal one 2015-07-21 00:00:00.0 [edu.ucsb.nceas.metacat.restservice.D1ResourceHandler]
org.dataone.service.exceptions.InvalidRequest: The request is trying to modify an immutable field in the SystemMeta: the new system meta's date of uploaded Tue Jul 21 00:00:00 UTC 2015 is different to the orginal one 2015-07-21 00:00:00.0
at edu.ucsb.nceas.metacat.dataone.D1NodeService.checkModifiedImmutableFields(D1NodeService.java:1699)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.updateSystemMetadata(D1NodeService.java:1649)
at edu.ucsb.nceas.metacat.dataone.MNodeService.updateSystemMetadata(MNodeService.java:2235)
at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.updateSystemMetadata(MNResourceHandler.java:1638)
at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.handle(MNResourceHandler.java:269)
at edu.ucsb.nceas.metacat.restservice.D1RestServlet.doPut(D1RestServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:649)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at edu.ucsb.nceas.metacat.restservice.D1URLFilter.doFilter(D1URLFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:193)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
History
#1 Updated by Jing Tao over 9 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
When the code did the comparing, it compared the Date object directly. I changed to comparing Date.getTime() and it worked.