glassfish
  1. glassfish
  2. GLASSFISH-19760

Exception when deploying an application that injects a JMSContext

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b79
    • Fix Version/s: 4.0_b80_EE7MS6
    • Component/s: cdi
    • Labels:
      None

      Description

      If I deploy a session bean which injects a JMSContext I get an exception {[org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-001408 Unsatisfied dependencies for type [JMSContext] with qualifiers [@Default] at injection point [[BackedAnnotatedField]}}

      Here's an extract from the server log.

      INFO: WELD-000900 2.0.0 (Beta4)
      WARNING: Class 'javax.ejb.PostActivate' not found, interception based on it is not enabled
      WARNING: Class 'javax.ejb.PrePassivate' not found, interception based on it is not enabled
      INFO: Loading application [TestGFInjectionBug] at [/TestGFInjectionBug]
      SEVERE: Exception during lifecycle processing
      org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-001408 Unsatisfied dependencies for type [JMSContext] with qualifiers [@Default] at injection point [[BackedAnnotatedField] @Inject servlets.NewServlet.context]
      	at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:247)
      	at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
      	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:364)
      	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
      	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:528)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:524)
      	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:523)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:547)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1424)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1759)
      	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1675)
      	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
      	at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
      	at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:273)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:820)
      	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)
      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [JMSContext] with qualifiers [@Default] at injection point [[BackedAnnotatedField] @Inject servlets.NewServlet.context]
      	at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:381)
      	at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:309)
      	at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:172)
      	at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:203)
      	at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:493)
      	at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:69)
      	at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:67)
      	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
      	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	... 1 more
      
      SEVERE: Exception while loading the app
      WARNING: JCDI shutdown error
      java.lang.IllegalStateException: Singleton not set for WebappClassLoader (delegate=true)
      	at org.glassfish.weld.ACLSingletonProvider$ACLSingleton.get(ACLSingletonProvider.java:110)
      	at org.jboss.weld.Container.instance(Container.java:54)
      	at org.jboss.weld.bootstrap.WeldBootstrap.shutdown(WeldBootstrap.java:597)
      	at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:293)
      	at org.glassfish.kernel.event.EventsImpl$1.run(EventsImpl.java:123)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:722)
      
      SEVERE: Exception while loading the app : CDI deployment failure:WELD-001408 Unsatisfied dependencies for type [JMSContext] with qualifiers [@Default] at injection point [[BackedAnnotatedField] @Inject servlets.NewServlet.context]
      org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [JMSContext] with qualifiers [@Default] at injection point [[BackedAnnotatedField] @Inject servlets.NewServlet.context]
      	at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:381)
      	at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:309)
      	at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:172)
      	at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:203)
      	at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:493)
      	at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:69)
      	at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:67)
      	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
      	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:722)
      

        Issue Links

          Activity

          Hide
          Nigel Deakin added a comment -

          I have created a NetBeans project which may be used to reproduce the issue.

          It may be downloaded here:
          http://java.net/projects/jms-spec/downloads/download/TestGFInjectionBug.zip

          This contains a servlet NewServlet which injects a JMSContext
          (but doesn't actually cause it to be instantiated)

          The war file is TestGFInjectionBug\dist\TestGFInjectionBug.war

          Show
          Nigel Deakin added a comment - I have created a NetBeans project which may be used to reproduce the issue. It may be downloaded here: http://java.net/projects/jms-spec/downloads/download/TestGFInjectionBug.zip This contains a servlet NewServlet which injects a JMSContext (but doesn't actually cause it to be instantiated) The war file is TestGFInjectionBug\dist\TestGFInjectionBug.war
          Hide
          jjsnyder83 added a comment -

          There is a Weld Jira issue for this: https://issues.jboss.org/browse/WELD-1182

          Show
          jjsnyder83 added a comment - There is a Weld Jira issue for this: https://issues.jboss.org/browse/WELD-1182
          Hide
          jjsnyder83 added a comment -

          Committed revision 60274.

          Show
          jjsnyder83 added a comment - Committed revision 60274.
          Hide
          David Zhao added a comment -

          I tested currently the @WeldGFExtension workaround doesn't work if I change nothing on JMS injection impl yet. It still throw the Unsatisfied dependencies exception.

          [exec] remote failure: Error occurred during deployment: Exception while loading the app : CDI deployment failure:W
          ELD-001408 Unsatisfied dependencies for type [JMSContext] with qualifiers [@Default] at injection point [[BackedAnnotate
          dField] @Inject @JMSConnectionFactory @JMSSessionMode private org.glassfish.tests.jms.injection.SimpleEjb.jmsContext]. P
          lease see server.log for more details.
          [exec] Command deploy failed.

          But if I remove the @WeldGFExtension workaround codes and register the JMS beans via JMSCDIExtension at AfterBeanDiscoveryEvent, It seems the InjectPoint bean cannot be resolved.

          deploy-v3-impl-windows:
          [exec] remote failure: Error occurred during deployment: Exception while loading the app : CDI definition failure:E xception List with 1 exceptions:
          [exec] Exception 0 :
          [exec] org.jboss.weld.exceptions.IllegalArgumentException: WELD-001405 Cannot inject [BackedAnnotatedParameter] Par ameter 1 of [BackedAnnotatedConstructor] @Inject public org.glassfish.jms.injection.InjectableJMSContext(InjectionPoint,
          RequestedJMSContextManager, TransactedJMSContextManager) in a class which isnt a bean
          [exec] at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.ja
          va:66)
          [exec] at org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1015)
          [exec] at org.jboss.weld.util.ForwardingBeanManager.createInjectionTarget(ForwardingBeanManager.java:201)
          [exec] at org.glassfish.jms.injection.JMSCDIExtension.createLocalBean(JMSCDIExtension.java:66)
          [exec] at org.glassfish.jms.injection.JMSCDIExtension.afterBeanDiscovery(JMSCDIExtension.java:71)
          [exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          [exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          [exec] at java.lang.reflect.Method.invoke(Method.java:601)
          [exec] at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)
          [exec] at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
          [exec] at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137
          )
          [exec] at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)
          [exec] at org.jboss.weld.annotated.runtime.InvokableAnnotatedMethod.invokeOnInstance(InvokableAnnotatedMethod.j
          ava:82)
          [exec] at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.j
          ava:77)
          [exec] at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:273)
          [exec] at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:129)
          [exec] at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:260)
          [exec] at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:239)
          [exec] at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:155)
          [exec] at org.jboss.weld.event.TransactionalObserverNotifier.notifyObserver(TransactionalObserverNotifier.java:
          44)
          [exec] at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:116)
          [exec] at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:101)
          [exec] at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:69)
          [exec] at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEven
          t.java:38)
          [exec] at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:53)
          [exec] at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:464)
          [exec] at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:194)
          [exec] at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
          [exec] at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
          [exec] at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
          [exec] at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
          [exec] at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
          [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
          [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
          [exec] at java.security.AccessController.doPrivileged(Native Method)
          [exec] at javax.security.auth.Subject.doAs(Subject.java:356)
          [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
          [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
          [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
          [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
          [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1761)
          [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
          [exec] at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:396)
          [exec] at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.jav
          a:234)
          [exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          [exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          [exec] at java.lang.reflect.Method.invoke(Method.java:601)
          [exec] at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMe
          thodInvocationHandlerFactory.java:81)
          [exec] at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaRe
          sourceMethodDispatcher.java:133)
          [exec] at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.do
          Dispatch(JavaResourceMethodDispatcherProvider.java:152)
          [exec] at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJava
          ResourceMethodDispatcher.java:101)
          [exec] at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:350)
          [exec] at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:345)
          [exec] at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
          [exec] at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:207)
          [exec] at org.glassfish.jersey.internal.Errors$1.call(Errors.java:207)
          [exec] at org.glassfish.jersey.internal.Errors$1.call(Errors.java:203)
          [exec] at org.glassfish.jersey.internal.Errors.process(Errors.java:251)
          [exec] at org.glassfish.jersey.internal.Errors.process(Errors.java:233)
          [exec] at org.glassfish.jersey.internal.Errors.process(Errors.java:203)
          [exec] at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
          [exec] at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:183)
          [exec] at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:859)
          [exec] at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:321)
          [exec] at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandServic
          e.java:161)
          [exec] at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181)
          [exec] at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
          [exec] at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
          [exec] at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
          [exec] at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
          [exec] at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
          [exec] at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
          [exec] at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
          [exec] Command deploy failed.
          [exec] at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
          [exec] at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
          [exec] at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
          [exec] at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
          [exec] at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
          [exec] at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
          [exec] at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
          [exec] at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrate
          gy.java:135)
          [exec] at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
          [exec] at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
          [exec] at java.lang.Thread.run(Thread.java:722)
          [exec] Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-001405 Cannot inject [BackedAnnotatedParamete r] Parameter 1 of [BackedAnnotatedConstructor] @Inject public org.glassfish.jms.injection.InjectableJMSContext(Injection
          Point, RequestedJMSContextManager, TransactedJMSContextManager) in a class which isnt a bean
          [exec] at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDefinitionErrors(Validator.java:344)
          [exec] at org.jboss.weld.injection.producer.InjectionTargetService.validateProducer(InjectionTargetService.java
          :39)
          [exec] at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.ja
          va:63)
          [exec] ... 85 more
          [exec] . Please see server.log for more details.

          Show
          David Zhao added a comment - I tested currently the @WeldGFExtension workaround doesn't work if I change nothing on JMS injection impl yet. It still throw the Unsatisfied dependencies exception. [exec] remote failure: Error occurred during deployment: Exception while loading the app : CDI deployment failure:W ELD-001408 Unsatisfied dependencies for type [JMSContext] with qualifiers [@Default] at injection point [[BackedAnnotate dField] @Inject @JMSConnectionFactory @JMSSessionMode private org.glassfish.tests.jms.injection.SimpleEjb.jmsContext]. P lease see server.log for more details. [exec] Command deploy failed. But if I remove the @WeldGFExtension workaround codes and register the JMS beans via JMSCDIExtension at AfterBeanDiscoveryEvent, It seems the InjectPoint bean cannot be resolved. deploy-v3-impl-windows: [exec] remote failure: Error occurred during deployment: Exception while loading the app : CDI definition failure:E xception List with 1 exceptions: [exec] Exception 0 : [exec] org.jboss.weld.exceptions.IllegalArgumentException: WELD-001405 Cannot inject [BackedAnnotatedParameter] Par ameter 1 of [BackedAnnotatedConstructor] @Inject public org.glassfish.jms.injection.InjectableJMSContext(InjectionPoint, RequestedJMSContextManager, TransactedJMSContextManager) in a class which isnt a bean [exec] at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.ja va:66) [exec] at org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1015) [exec] at org.jboss.weld.util.ForwardingBeanManager.createInjectionTarget(ForwardingBeanManager.java:201) [exec] at org.glassfish.jms.injection.JMSCDIExtension.createLocalBean(JMSCDIExtension.java:66) [exec] at org.glassfish.jms.injection.JMSCDIExtension.afterBeanDiscovery(JMSCDIExtension.java:71) [exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [exec] at java.lang.reflect.Method.invoke(Method.java:601) [exec] at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264) [exec] at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [exec] at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137 ) [exec] at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260) [exec] at org.jboss.weld.annotated.runtime.InvokableAnnotatedMethod.invokeOnInstance(InvokableAnnotatedMethod.j ava:82) [exec] at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.j ava:77) [exec] at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:273) [exec] at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:129) [exec] at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:260) [exec] at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:239) [exec] at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:155) [exec] at org.jboss.weld.event.TransactionalObserverNotifier.notifyObserver(TransactionalObserverNotifier.java: 44) [exec] at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:116) [exec] at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:101) [exec] at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:69) [exec] at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEven t.java:38) [exec] at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:53) [exec] at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:464) [exec] at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:194) [exec] at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131) [exec] at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328) [exec] at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493) [exec] at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219) [exec] at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491) [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527) [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523) [exec] at java.security.AccessController.doPrivileged(Native Method) [exec] at javax.security.auth.Subject.doAs(Subject.java:356) [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522) [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546) [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423) [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108) [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1761) [exec] at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674) [exec] at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:396) [exec] at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.jav a:234) [exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [exec] at java.lang.reflect.Method.invoke(Method.java:601) [exec] at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMe thodInvocationHandlerFactory.java:81) [exec] at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaRe sourceMethodDispatcher.java:133) [exec] at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.do Dispatch(JavaResourceMethodDispatcherProvider.java:152) [exec] at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJava ResourceMethodDispatcher.java:101) [exec] at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:350) [exec] at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:345) [exec] at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) [exec] at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:207) [exec] at org.glassfish.jersey.internal.Errors$1.call(Errors.java:207) [exec] at org.glassfish.jersey.internal.Errors$1.call(Errors.java:203) [exec] at org.glassfish.jersey.internal.Errors.process(Errors.java:251) [exec] at org.glassfish.jersey.internal.Errors.process(Errors.java:233) [exec] at org.glassfish.jersey.internal.Errors.process(Errors.java:203) [exec] at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [exec] at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:183) [exec] at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:859) [exec] at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:321) [exec] at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandServic e.java:161) [exec] at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181) [exec] at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246) [exec] at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) [exec] at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) [exec] at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) [exec] at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) [exec] at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) [exec] at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) [exec] Command deploy failed. [exec] at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) [exec] at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) [exec] at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) [exec] at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) [exec] at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) [exec] at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) [exec] at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) [exec] at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrate gy.java:135) [exec] at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) [exec] at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) [exec] at java.lang.Thread.run(Thread.java:722) [exec] Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-001405 Cannot inject [BackedAnnotatedParamete r] Parameter 1 of [BackedAnnotatedConstructor] @Inject public org.glassfish.jms.injection.InjectableJMSContext(Injection Point, RequestedJMSContextManager, TransactedJMSContextManager) in a class which isnt a bean [exec] at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDefinitionErrors(Validator.java:344) [exec] at org.jboss.weld.injection.producer.InjectionTargetService.validateProducer(InjectionTargetService.java :39) [exec] at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.ja va:63) [exec] ... 85 more [exec] . Please see server.log for more details.
          Hide
          David Zhao added a comment -

          Now it works by applying JJ's workaround in JMSCDIExtension: Use getInjectionTargetFactory instead of createInjectionTarget.

          Show
          David Zhao added a comment - Now it works by applying JJ's workaround in JMSCDIExtension: Use getInjectionTargetFactory instead of createInjectionTarget.

            People

            • Assignee:
              jjsnyder83
              Reporter:
              Nigel Deakin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: