Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 4.0.0.Beta5, 3.6.3.Final, 4.0.0.CR2
    • Fix Version/s: 3.12.0.Final, 4.5.5.Final
    • Component/s: jaxrs
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Using a setup like below...

      interface API {
      
        @Produces("text/event-stream")
        @GET
        @Path("events")
        void events(@Context SseEventSink sseSink, @Context Sse sse);
      
      }
      
      class APIImpl implements API {
        void events(SseEventSink sseSink, Sse sse) {
          active.saveForLater(sseSink, sse);
        }
      }
      
      

      The error seems to be located at SseEventOutputImpl.java:116. It uses method.getMethod().getAnnotation(). Which doesn't look for inherited annotations.

      The fix appears simple. "method" which is a "ResourceMethodInvoker" already has all the inherited annotations gathered. It just needs to be checked in place of the current.

      Show
      Using a setup like below... interface API { @Produces( "text/event-stream" ) @GET @Path( "events" ) void events(@Context SseEventSink sseSink, @Context Sse sse); } class APIImpl implements API { void events(SseEventSink sseSink, Sse sse) { active.saveForLater(sseSink, sse); } } The error seems to be located at SseEventOutputImpl.java:116. It uses method.getMethod().getAnnotation(). Which doesn't look for inherited annotations. The fix appears simple. "method" which is a "ResourceMethodInvoker" already has all the inherited annotations gathered. It just needs to be checked in place of the current.

      Description

      When defining JAX-RS methods via an interface the framework incorrectly reports that the method is missing annotations. The exact message is:

      Expected @Stream or @Produces("text/event-stream")
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jim.ma Jim Ma
                  Reporter:
                  kwooten Kevin Wooten
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: