That said - most likely cause is that you have a method with a parameter
not annotated with any of JAXRS parameter annotations - hence you see
this exception. If it's the case then may be that code which used to
throw it should've stayed :-), to prevent attempts to read from an empty
input stream or something...

Cheers, Sergey

-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]] 
Sent: 23 January 2009 23:50
To: [email protected]
Subject: RE: org.apache.cxf.interceptor.Fault: No Content-Type

Hi - it's definitely fixed in 2.1.4/2.2 snapshots. Sorry about it, just
hang on please a little bit longer and 2.1.4 will be released.
Here's one workaround :

Register an implementation of CXF JAXRS RequestFilter (as a provider)
and add, say, a wildcard type like this :

message.put(Message.CONTENT_TYPE, "*/*");

Hope it helps, Sergey 




-----Original Message-----
From: Todd Orr [mailto:[email protected]] 
Sent: 23 January 2009 20:12
To: [email protected]
Subject: Re: org.apache.cxf.interceptor.Fault: No Content-Type

I'm experiencing the same bug while trying to view a resource in my
browser. Firefox does not send Content-Type with a GET request, so
this fails every time. Seems like a real bug.

On Mon, Dec 15, 2008 at 4:52 AM, Sergey Beryozkin
<[email protected]> wrote:
> Hi
>
> I think it's actually a  legacy bug. I think the reason it works in a
unit
> test is because some default content type is set when Java
> (HTTP)UrlConnection is involved but not when a browser is used.
>
> That said, I'm not sure one can call it a bug. Please set Content-Type
to
> any acceptable content type, */* even, to keep you going, but in
reality you
> can't have a GET request with a request body available at the same
time.
> Most likely the InputStream value in your method is null.
>
> Either way, what I will do is I'll update the code to log a warning
message
> and set the type to */*.
>
> Cheers, Sergey
>
>
>> Hi Wayne,
>>
>> I think you'd better try with the last version 2.1.3
>>
>> because there's a issue on 2.1.2 and it was fixed on that version
>>
>> http://issues.apache.org/jira/browse/CXF-1699
>>
>>
>>
>> On Mon, Dec 15, 2008 at 1:35 PM, Wang Wayne <[email protected]>
wrote:
>>
>>> Hello All,
>>>
>>>
>>>
>>> I have met a question when I request my local web service from
Browser.
>>> The
>>> error from Tomcat server as following:
>>>
>>> Interceptor has thrown exception, unwinding now
>>>
>>> org.apache.cxf.interceptor.Fault: No Content-Type specified for HTTP
GET
>>>
>>>
>>>
>>> But still the same web service when I request from Junit test, It's
work.
>>> The request code as following:
>>>
>>> URL url = *new* URL("
>>> http://localhost:8000/sso/webservice/policyservice/test
>>> ");
>>>
>>>       InputStream in = url.openStream();
>>>
>>>       log.info(*getStringFromInputStream*(in));
>>>
>>>
>>>
>>> This is server code:
>>>
>>>        @GET
>>>
>>>   @Path("/test/")
>>>
>>>   *public* Response test(InputStream is) {
>>>
>>>       *return* Response.*status*(Response.Status.*OK*).entity(
>>> "<result>success</result>").build();
>>>
>>> }
>>>
>>> Would someone could help me, please. I really appreciate!
>>>
>>>
>>>
>>> Best wishes for you!
>>>
>>> Wayne Wang
>>>
>>
>>
>>
>> --
>> Regards!
>>
>> Chouxinxin Huang
>>
>
>

Reply via email to