jersey
  1. jersey
  2. JERSEY-2427

Message "null for uri: http://example.com/favicon.ico" creates an unprofessional image

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 1.17
    • Fix Version/s: 1.19.1, 1.20
    • Component/s: core
    • Labels:
      None
    • Environment:

      DropWizard 0.6.2 set up with added RuntimeExceptionMapper.
      Java 1.7
      RedHat Linux.

      Description

      For our API we have a policy of surfacing the result of exception.getMessage() as part of a JSON entity, since these are generally formatted for consumption by a human being. The message for an com.sun.jersey.api.NotFoundException is generated as follows:

      return super.getMessage() + " for uri: " + notFoundUri;

      Which means that the message from the default constructor is prepended to the URL and an English sentence stem. The problem is that in com.sun.jersey.server.impl.application.WebApplicationImpl no such message is supplied. See line 1512 (at at version 1.17.1):

      if (!rootsRule.accept(path, null, localContext))

      { throw new NotFoundException(request.getRequestUri()); }

      The result is a message like: "null for uri: http://example.com/favicon.ico" which could be improved upon greatly simply by adding a message such as:

      if (!rootsRule.accept(path, null, localContext))

      { throw new NotFoundException("No match", request.getRequestUri()); }

      This would result in "No match for uri: http://example.com/favicon.ico".

        Activity

        Hide
        Michal Gajdos added a comment -

        Moving to 1.19.

        Show
        Michal Gajdos added a comment - Moving to 1.19.
        Hide
        Marek Potociar added a comment -

        Jersey 1.x branch is not under active development anymore. Only security issues and issues reported by the customers of commercially supported products that ship with Jersey are fixed on this code base right now.
        Please, move your code to Jersey 2.x and if you still see the issue there, feel free to file a bug against Jersey 2.x.

        Show
        Marek Potociar added a comment - Jersey 1.x branch is not under active development anymore. Only security issues and issues reported by the customers of commercially supported products that ship with Jersey are fixed on this code base right now. Please, move your code to Jersey 2.x and if you still see the issue there, feel free to file a bug against Jersey 2.x.

          People

          • Assignee:
            Unassigned
            Reporter:
            sjgibbsft
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: