나는 다음과 같은 몇 가지 도움이 필요 - 여기에 내가 점점 오전 오류입니다 첫째 :ArrayList 및 내 목록 <CustomType>에 대한 메시지 본문 작성자 및 MIME 미디어 유형 application/xml을 찾을 수 없습니까?
SEVERE: A message body writer for Java class java.util.ArrayList, and Java type java.util.List<CustomType>, and MIME media type application/xml was not found
가 여기에 내가 작성한 엔드 포인트입니다 : 이제
@GET
@Path("/getListOfObjects")
@Produces(MediaType.APPLICATION_XML)
public Response getListOfObjects()
{
List<CustomType> results = customTypeService.getListOfObjects();
GenericEntity<List<CustomType>> genericList
= new GenericEntity<List<CustomType>>(results){};
return Response.ok(genericList).build();
}
, 그 I를 추가합니다 실제로 처음의 목록 ("결과")을 사용하여 응답을 작성하려고 할 때 실제로이 오류가있었습니다. 그러나 여러 다른 사람들이 여기에 비슷한 질문을했고, 모두 내가 위에했던 방식으로 일반 엔터티라고 말했습니다. ... 그러나 그것은 나를 위해 아무런 영향을 미치지 않은 것 같습니다.
누구나 나를위한 입력이 있습니까?
@GET
@Path("/getListOfObjects")
@Produces(MediaType.APPLICATION_XML)
public Response getListOfObjects(){
List<CustomType> results = customTypeService.getListOfObjects();
GenericEntity<List<CustomType>> genericList= new GenericEntity<List<CustomType>>(results){};
return Response.ok().entity(genericList).build();
}
당신이'CustomType' 정의하는 방법을 포함 할 수 있습니까? – manouti
사용자 정의 유형은 길이가 긴 ID와 ID에 사용되는 속성과 레코드의 이름 인 두 속성이있는 객체입니다. – MickeyThreeSheds