jersey
  1. jersey
  2. JERSEY-1644

JdkHttpHandlerContainerProvider not providing container

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-m11
    • Fix Version/s: 2.0-rc1, 2.0
    • Component/s: containers
    • Labels:
      None
    • Environment:

      Windows 7 Pro, JDK 6, Jersey-SNAPSHOT(m11)

      Description

      When creating a Jersey server using JdkHttpServerFactory.create(), the following exception occurs:

      Jan 09, 2013 11:59:04 PM org.glassfish.jersey.server.ApplicationHandler initialize
      INFO: Initiating Jersey application, version Jersey: 2.0-m11 2012-12-21 12:34:15...
      Exception in thread "main" java.lang.IllegalArgumentException: No container provider supports the type class org.glassfish.jersey.jdkhttp.JdkHttpHandlerContainer
      at org.glassfish.jersey.server.ContainerFactory.createContainer(ContainerFactory.java:96)
      at org.glassfish.jersey.jdkhttp.JdkHttpServerFactory.createHttpServer(JdkHttpServerFactory.java:79)
      at test.App.main(App.java:20)

      The provider seems to be in error, currently (SNAPSHOT m11), it is defined as:

      public final class JdkHttpHandlerContainerProvider implements ContainerProvider {

      @Override
      public <T> T createContainer(Class<T> type, ApplicationHandler application) throws ProcessingException {
      if (type != HttpHandler.class)

      { return null; }

      return type.cast(new JdkHttpHandlerContainer(application));
      }
      }

      if the conditional is changed to:

      if((type != HttpHandler.class) && (type != JdkHttpHandlerContainer.class)){
      return null;
      }

      It seems to work.

        Activity

        Hide
        Michal Gajdos added a comment -

        Fixed as a part of JERSEY-1673.

        Show
        Michal Gajdos added a comment - Fixed as a part of JERSEY-1673 .

          People

          • Assignee:
            Michal Gajdos
            Reporter:
            Frank Bolander
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 3 hours
              3h
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 15 minutes Time Not Required
              15m