解析媒体类型'application.xml'Jersey REST客户端时出错

时间:2013-03-14 19:31:11

标签: rest jersey

我在运行客户端时遇到此异常。

enter image description here

Exception in thread "main" java.lang.IllegalArgumentException: Error parsing media type 'application.xml'
    at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:79)
    at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:53)
    at javax.ws.rs.core.MediaType.valueOf(MediaType.java:119)
    at com.sun.jersey.api.client.PartialRequestBuilder.type(PartialRequestBuilder.java:92)
    at com.sun.jersey.api.client.WebResource.type(WebResource.java:347)
    at com.rest.client.EmpGETClient.main(EmpGETClient.java:15)
Caused by: java.text.ParseException: End of header
    at com.sun.jersey.core.header.reader.HttpHeaderReaderImpl.getNextCharacter(HttpHeaderReaderImpl.java:168)
    at com.sun.jersey.core.header.reader.HttpHeaderReaderImpl.next(HttpHeaderReaderImpl.java:129)
    at com.sun.jersey.core.header.reader.HttpHeaderReaderImpl.next(HttpHeaderReaderImpl.java:124)
    at com.sun.jersey.core.header.reader.HttpHeaderReader.nextSeparator(HttpHeaderReader.java:116)
    at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.valueOf(MediaTypeProvider.java:90)
    at com.sun.jersey.core.impl.provider.header.MediaTypeProvider.fromString(MediaTypeProvider.java:77)
    ... 5 more

1 个答案:

答案 0 :(得分:1)