java - Producing media type conflict error in Jersey resolution -
i have these 2 methods below defined in restful resource class. i'm using jersey. when seek run unit says error, have same media type. missing ?
severe: next errors , warnings have been detected resource and/or provider classes: severe: producing media type conflict. resource methods public javax.ws.rs.core.response com.thomsonreuters.codes.sourcedocweb.resource.documentsresource.finddocumentmetadatabycorid(java.lang.string) , public javax.ws.rs.core.response com.thomsonreuters.codes.sourcedocweb.resource.documentsresource.finddocumentmetadata(java.lang.string) can produce same media type feb 11, 2013 5:43:56 pm com.sun.jersey.test.framework.spi.container.inmemory.inmemorytestcontainerfactory$inmemorytestcontainer stop info: stopping low level inmemory test container
@get @path("/{docid}/metadata") @produces(mediatype.application_xml) public response finddocumentmetadata(@pathparam("docid") final string docid) { response response = findmetadatafordocument(docid); homecoming response; } @get @path("/{corid}/metadata") @produces(mediatype.application_xml) public response finddocumentmetadatabycorid(@pathparam("corid") final string corid) { response response = findmetadatafordocument(corid); homecoming response; }
the first thing notice 2 paths conflict. bailiwick of jersey doesn't have frame of reference know if /1/metadata should routed first or sec method. might seek defining paths /doc/metadata/{docid} , /cor/metadata/{corid}. hope helps.
java jersey
No comments:
Post a Comment