Project

General

Profile

Task #3373

If id contains "/", the MNode.getSysteMetadata method fails.

Added by Jing Tao over 11 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-11-06
Due date:
% Done:

0%

Milestone:
None
Product Version:
*
Story Points:
Sprint:

Description

I have a very simple code:

Identifier id = new Identifier();
id.setValue(identifier);
activeMNode.getSystemMetadata(id);

When I test it, if the id has a "/", e.g., doi:10.6085/AA/YBHX00_XXXITBDXMMR01_20040720.50.5
The test fails:
[junit] - rest call info: GET https://mn-demo-5.test.dataone.org/knb/d1/mn/v1/meta/doi:10.6085%2FAA%2FYBHX00_XXXITBDXMMR01_20040720.50.5
[junit] - response httpCode: 400

400: Bad Request: Deserializing Text/Plain: Just providing message body:

{EndOfMessage}
org.dataone.service.exceptions.ServiceFailure: 400: Bad Request: Deserializing Text/Plain: Just providing message body:

{EndOfMessage}
at org.dataone.service.util.ExceptionHandler.deserializeTextPlainAndThrowException(ExceptionHandler.java:470)
at org.dataone.service.util.ExceptionHandler.deserializeAndThrowException(ExceptionHandler.java:379)
at org.dataone.service.util.ExceptionHandler.deserializeAndThrowException(ExceptionHandler.java:314)
at org.dataone.service.util.ExceptionHandler.filterErrors(ExceptionHandler.java:108)
at org.dataone.client.D1RestClient.doGetRequest(D1RestClient.java:234)
at org.dataone.client.D1RestClient.doGetRequest(D1RestClient.java:223)
at org.dataone.client.D1Node.getSystemMetadata(D1Node.java:562)
at org.dataone.client.D1Node.getSystemMetadata(D1Node.java:493)
at org.dataone.client.MNode.getSystemMetadata(MNode.java:322)
at edu.ucsb.nceas.morpho.datastore.DataONEDataStoreService.exists(DataONEDataStoreService.java:506)
at edu.ucsb.nceas.morphotest.datastore.DataONEDataStoreServiceTest.testExists(DataONEDataStoreServiceTest.java:70)

If there is no "/" in the identifier, it works.

I believe the getSystemMetadata should handle the id with "/" correctly.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)