Task #7038
Feature #6498: V2 Metacat MN and CN Support
Task #6863: Check Metacat V1 API returns v1 object
MN v1.getLogRecords return an error
100%
Description
I got an error when I access the log:
https://valley.duckdns.org/metacat/d1/mn/v1/log
error on line 1 at column 232579: XML declaration allowed only at the start of the document
History
#1 Updated by Jing Tao over 9 years ago
I dug around and found error message is:
D1ResourceHandler: Serializing exception with code 500: null value for element "event" from object of type org.dataone.service.types.v1.LogEntry [edu.ucsb.nceas.metacat.restservice.D1ResourceHandler]
It turns out v1.Event is an enum class. It only has those values:
REATE("create"), READ("read"), UPDATE("update"), DELETE("delete"), REPLICATE(
"replicate"), SYNCHRONIZATION_FAILED("synchronization_failed"), REPLICATION_FAILED(
"replication_failed")
But, my access log have more types, such as updateSystemMetadata and insert. So the Event will be return null by this method on Event class:
public static Event convert(String value) {
for (Event inst : values()) {
if (inst.xmlValue().equals(value)) {
return inst;
}
}
return null;
}
This is the reason we got the null event.
#2 Updated by Jing Tao over 9 years ago
My solution is if the Event object is null, we will not add it to log.
#3 Updated by Jing Tao over 9 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
- translation missing: en.field_remaining_hours set to 0.0