glassfish
  1. glassfish
  2. GLASSFISH-19551

ServletContainerInitializer#onStartup doesn't provide all classes specified in @HandlesTypes

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0_b84_RC1
    • Component/s: hk2
    • Labels:
      None

      Description

      Let's have the following ServletContainerInitializer implementation, where ServerApplicationConfiguration is an Interface.

      ===============
      @HandlesTypes(

      {WebSocketEndpoint.class, ServerApplicationConfiguration.class, Endpoint.class}

      )
      public class ReadListenerServletContainerInitializer implements ServletContainerInitializer {
      public void onStartup(Set<Class<?>> classes, ServletContext ctx) throws ServletException {
      ===============

      According to javadoc for @HandlesTypes, all application classes implementing the ServerApplicationConfiguration should be passed in onStartup(...), but they aren't. However, this works for annotations and for application classes that extend the class specified in @HandlesTypes.

        Issue Links

          Activity

          Hide
          Mahesh Kannan added a comment -

          OK, The root cause is that the ClassModel for the super classes's interfaces are not instantiated unless it is referenced directly from the application classes. Working on the fix...

          Show
          Mahesh Kannan added a comment - OK, The root cause is that the ClassModel for the super classes's interfaces are not instantiated unless it is referenced directly from the application classes. Working on the fix...
          Hide
          Mahesh Kannan added a comment -

          I see that DefaultServerEndpointConfiguration is defined as a non-public class:

          final class DefaultServerEndpointConfiguration implements ServerEndpointConfiguration

          { ..... }

          So, how can Config extend DefaultServerConfiguration ?

          Show
          Mahesh Kannan added a comment - I see that DefaultServerEndpointConfiguration is defined as a non-public class: final class DefaultServerEndpointConfiguration implements ServerEndpointConfiguration { ..... } So, how can Config extend DefaultServerConfiguration ?
          Hide
          Mahesh Kannan added a comment -

          With the latest jar, I am now seeing:

          [2013-03-13T19:54:24.884-0700] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=43 _ThreadName=admin-listener(2)] [timeMillis: 1363229664884] [levelValue: 1000] [[
          Exception while loading the app : CDI deployment failure:sun.reflect.annotation.TypeNotPresentExceptionProxy
          java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
          at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:673)
          at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:480)
          at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:306)
          at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:241)
          at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88)
          at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
          at java.lang.Class.initAnnotationsIfNecessary(Class.java:3089)
          at java.lang.Class.getAnnotation(Class.java:3048)
          at java.lang.Class.isAnnotationPresent(Class.java:3061)
          at org.jboss.weld.util.Beans.isVetoed(Beans.java:520)
          at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:105)
          at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:147)
          at org.jboss.weld.bootstrap.BeanDeployment.createClasses(BeanDeployment.java:211)
          at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:419)
          at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:192)
          at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
          at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
          at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
          at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
          at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
          at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
          at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
          at java.security.AccessController.doPrivileged(Native Method)
          at javax.security.auth.Subject.doAs(Subject.java:356)
          at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
          at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
          at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
          at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
          at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1761)
          at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
          at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:396)
          at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:234)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:601)
          at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
          at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125)
          at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
          at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91)
          at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:350)
          at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:345)
          at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
          at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:214)
          at org.glassfish.jersey.internal.Errors$1.call(Errors.java:207)
          at org.glassfish.jersey.internal.Errors$1.call(Errors.java:203)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:251)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:233)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:203)
          at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
          at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:190)
          at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:865)
          at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:325)
          at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandService.java:161)
          at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181)
          at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
          at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
          at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
          at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
          at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
          at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
          at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
          at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
          at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
          at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
          at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
          at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
          at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
          at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
          at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
          at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
          at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
          at java.lang.Thread.run(Thread.java:722)
          ]]

          Show
          Mahesh Kannan added a comment - With the latest jar, I am now seeing: [2013-03-13T19:54:24.884-0700] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=43 _ThreadName=admin-listener(2)] [timeMillis: 1363229664884] [levelValue: 1000] [[ Exception while loading the app : CDI deployment failure:sun.reflect.annotation.TypeNotPresentExceptionProxy java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:673) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:480) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:306) at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:241) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3089) at java.lang.Class.getAnnotation(Class.java:3048) at java.lang.Class.isAnnotationPresent(Class.java:3061) at org.jboss.weld.util.Beans.isVetoed(Beans.java:520) at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:105) at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:147) at org.jboss.weld.bootstrap.BeanDeployment.createClasses(BeanDeployment.java:211) at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:419) at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:192) at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131) at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:356) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1761) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674) at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:396) at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:234) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:350) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:345) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:214) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:207) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:203) at org.glassfish.jersey.internal.Errors.process(Errors.java:251) at org.glassfish.jersey.internal.Errors.process(Errors.java:233) at org.glassfish.jersey.internal.Errors.process(Errors.java:203) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:190) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:865) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:325) at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandService.java:161) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Thread.java:722) ]]
          Hide
          Mahesh Kannan added a comment -

          Committed revision 4445 to fix this issue.
          Will close this once hk2 is integrated

          svn commit -m "Fix for GlassFish-19551. QL passed and devtests/web passed"
          Sending class-model/osgi.bundle
          Sending class-model/pom.xml
          Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/Parser.java
          Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/ParsingContext.java
          Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/impl/AnnotatedElementImpl.java
          Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/impl/ModelClassVisitor.java
          Adding class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/ClassModelActivator.java
          Adding class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/CommonModelRegistry.java
          Transmitting file data ........
          Committed revision 4445.

          Show
          Mahesh Kannan added a comment - Committed revision 4445 to fix this issue. Will close this once hk2 is integrated svn commit -m "Fix for GlassFish-19551. QL passed and devtests/web passed" Sending class-model/osgi.bundle Sending class-model/pom.xml Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/Parser.java Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/ParsingContext.java Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/impl/AnnotatedElementImpl.java Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/impl/ModelClassVisitor.java Adding class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/ClassModelActivator.java Adding class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/CommonModelRegistry.java Transmitting file data ........ Committed revision 4445.
          Hide
          Mahesh Kannan added a comment -

          This is resolved with hk2-79 integration.

          The original svn commit info:

          svn commit -m "Fix for GlassFish-19551. QL passed and devtests/web passed"
          Sending class-model/osgi.bundle
          Sending class-model/pom.xml
          Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/Parser.java
          Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/ParsingContext.java
          Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/impl/AnnotatedElementImpl.java
          Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/impl/ModelClassVisitor.java
          Adding class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/ClassModelActivator.java
          Adding class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/CommonModelRegistry.java
          Transmitting file data ........
          Committed revision 4445.

          Show
          Mahesh Kannan added a comment - This is resolved with hk2-79 integration. The original svn commit info: svn commit -m "Fix for GlassFish-19551. QL passed and devtests/web passed" Sending class-model/osgi.bundle Sending class-model/pom.xml Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/Parser.java Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/ParsingContext.java Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/impl/AnnotatedElementImpl.java Sending class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/impl/ModelClassVisitor.java Adding class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/ClassModelActivator.java Adding class-model/src/main/java/org/glassfish/hk2/classmodel/reflect/util/CommonModelRegistry.java Transmitting file data ........ Committed revision 4445.

            People

            • Assignee:
              Mahesh Kannan
              Reporter:
              stepan.kopriva
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: