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

RuntimeException is thrown for Provider that doesn't have Path annotation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0-beta-3
    • 2.0-beta-2
    • jaxrs
    • None
    • Hide

      return the @Provider annotated classes in the Application.getClasses method and not in Application.getSingletons

      Show
      return the @Provider annotated classes in the Application.getClasses method and not in Application.getSingletons

      Singleton registration of a Provider that does not have the @Path annotation fails. e.g. custom exception mappers or consumers/producers
      I've defined a javax.ws.rs.core.Application, it's getSingletons method returns the custom exception mapper, consumers and producers.
      This was working in resteasy 1.2.1.GA.

      java.lang.RuntimeException: Class is not a root resource. It, or one of its interfaces must be annotated with @Path: x.y.service.rest.ApplicationExceptionMapper implements: javax.ws.rs.ext.ExceptionMapper
      at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:104)
      at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83)
      at org.jboss.resteasy.core.ResourceMethodRegistry.addSingletonResource(ResourceMethodRegistry.java:47)
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.processApplication(ServletContainerDispatcher.java:152)
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:90)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
      at java.lang.Thread.run(Thread.java:619)

            patriot1burke@gmail.com Bill Burke (Inactive)
            sanjoa Joakim Sandstroem (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: