0

运行客户端时出现此异常。

在此处输入图像描述

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
4

1 回答 1

1

尝试“应用程序/xml”另见http://en.wikipedia.org/wiki/Internet_media_type#Type_application

于 2013-03-14T19:36:30.253 回答