Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-522

RestEasy Client Framework throws null point exception when the @CookieParam() is null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.2.RC1
    • None
    • None
    • None
    • Hide

      I have to create 2 interface (with/without post the cookie), and check the cookie to see which interface to call.

      Show
      I have to create 2 interface (with/without post the cookie), and check the cookie to see which interface to call.

      If I have a remote interface defined as

      <code>
      @POST
      @Path("/myCookie")
      public ClientResponse<String> postWithCookie(@CookieParam("testCookie") String testCookie);
      </code>

      in the initial call, when there is no cookie was set, resteasy will throw NPE.
      if the cookie was set already, then the request works.

      <code>java.lang.NullPointerException
      at org.jboss.resteasy.client.ClientRequest.toString(ClientRequest.java:213)
      at org.jboss.resteasy.client.ClientRequest.cookie(ClientRequest.java:280)
      at org.jboss.resteasy.client.core.marshallers.CookieParamMarshaller.build(CookieParamMarshaller.java:34)
      at org.jboss.resteasy.client.core.ClientInvoker.createRequest(ClientInvoker.java:121)
      at org.jboss.resteasy.client.core.ClientInvoker.invoke(ClientInvoker.java:87)
      at org.jboss.resteasy.client.core.ClientProxy.invoke(ClientProxy.java:72)</code>

              patriot1burke@gmail.com Bill Burke (Inactive)
              jy1999us_jira jeff yin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: