[Jersey-issues] [JIRA] Created: (JERSEY-1644) JdkHttpHandlerContainerProvider not providing container

  • From: "mongo (JIRA)" <jira-no-reply@...>
  • To: issues@...
  • Subject: [Jersey-issues] [JIRA] Created: (JERSEY-1644) JdkHttpHandlerContainerProvider not providing container
  • Date: Thu, 10 Jan 2013 05:10:52 +0000 (GMT+00:00)
  • Auto-submitted: auto-generated

JdkHttpHandlerContainerProvider not providing container
-------------------------------------------------------

                 Key: JERSEY-1644
                 URL: http://java.net/jira/browse/JERSEY-1644
             Project: jersey
          Issue Type: Bug
          Components: containers
    Affects Versions: 2.0-m11
         Environment: Windows 7 Pro, JDK 6, Jersey-SNAPSHOT(m11)
            Reporter: mongo


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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[Jersey-issues] [JIRA] Created: (JERSEY-1644) JdkHttpHandlerContainerProvider not providing container

mongo (JIRA) 01/10/2013

[Jersey-issues] [JIRA] Updated: (JERSEY-1644) JdkHttpHandlerContainerProvider not providing container

Marek Potociar (JIRA) 01/28/2013

[Jersey-issues] [JIRA] Updated: (JERSEY-1644) JdkHttpHandlerContainerProvider not providing container

Marek Potociar (JIRA) 01/29/2013
Terms of Use; Privacy Policy; Copyright ©2013-2014 (revision 20131025.e7cbc9d)
 
 
Close
loading
Please Confirm
Close