[ 
https://issues.apache.org/jira/browse/CXF-6356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14501048#comment-14501048
 ] 

iris ding commented on CXF-6356:
--------------------------------

After debugging, I found out we missed to support Date Header in 
org.apache.cxf.jaxrs.impl.RuntimeDelegateImpl:
  public RuntimeDelegateImpl() {
        headerProviders.put(MediaType.class, new MediaTypeHeaderProvider());
        headerProviders.put(CacheControl.class, new 
CacheControlHeaderProvider());
        headerProviders.put(EntityTag.class, new EntityTagHeaderProvider());
        headerProviders.put(Cookie.class, new CookieHeaderProvider());
        headerProviders.put(NewCookie.class, new NewCookieHeaderProvider());
        headerProviders.put(Link.class, new LinkHeaderProvider());
        //Proposed fix start
        headerProviders.put(Date.class, new DateHeaderProvider());
        //Proposed fix  end
    }

I have attached the added DateHeaderProvider.java in this defect as well. 

After this, my test scenario can run smoothly.

Thanks & Best Regards,

Iris Ding

> NPE when calling ServiceUnavailableException.getRetryTime()
> -----------------------------------------------------------
>
>                 Key: CXF-6356
>                 URL: https://issues.apache.org/jira/browse/CXF-6356
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.1, 3.0.3, 2.7.15
>            Reporter: iris ding
>
> Hi, I have a resource method as below:  
>  @GET
>         @Path("setmethod")
>         public String setMethod1() {
>                ServiceUnavailableException e = new 
> ServiceUnavailableException(new Date());
>                e.getRetryTime(new Date());
>             ....}
> In this method, I simply construct a ServiceUnavailableException with Date 
> parameter. Then when it runs into  e.getRetryTime(new Date()) it give below 
> error:
> java.lang.NullPointerException
> at 
> javax.ws.rs.ServiceUnavailableException.getRetryTime(ServiceUnavailableException.java:262)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to