Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-2001

Weld does not throw a definition error for unresolved dependencies when injecting into web components on AS7

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.0.2.Final
    • Fix Version/s: 7.1.0.Beta1
    • Component/s: CDI / Weld
    • Labels:
      None

      Description

      I am deploying a weld-seam3 application to JBoss AS 7.0.2.Final (without the weld-.jar files and the weld Listener). The same application deploys perfectly to jetty and tomcat (with the weld-.jar files and weld Listener).

      The deploy works fine most of the time .
      However, as soon as I use the application, the first servlet used (our SecurityServiceServlet which uses the SecurityServiceImpl bean) throws this exception:

      11:46:08,457 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/guvnor-webapp-5.4.0-SNAPSHOT].[securityService]] (http--127.0.0.1-8080-4) Allocate exception for servlet securityService: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean must not be null
      at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:747) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
      at org.jboss.as.weld.injection.InjectableField.inject(InjectableField.java:62) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.weld.injection.WeldEEInjection.inject(WeldEEInjection.java:79) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:60) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
      at org.jboss.as.ee.component.ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptor.java:53)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
      at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
      at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.0.Final.jar:1.1.0.Final]
      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:152)
      at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:77)
      at org.jboss.as.web.deployment.component.WebComponentInstantiator$1.<init>(WebComponentInstantiator.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.web.deployment.component.WebComponentInstantiator.getReference(WebComponentInstantiator.java:55) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.web.deployment.WebInjectionContainer.instantiate(WebInjectionContainer.java:99) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:78) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:72) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1156) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
      at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
      

      To repreduce, just
      git clone https://github.com/ge0ffrey/guvnor/tree/upgradeToSeam3
      cd guvnor
      mvn clean install -DskipTests
      cd guvnor-webapp
      remove the weld-.jar files from the target/guvnor-webapp-.war and deploy it to a fresh JBoss AS 7.0.2.Final

      Sometimes the deploy gives this stacktrace before the other stacktrace during the deploy of the war already:

      17:29:07,426 ERROR org.jboss.as.controller Operation ("add") failed - address: ([("deployment" => "guvnor-webapp-5.4.0-SNAPSHOT.war")]): java.lang.IllegalStateException: duplicate resource [("deployment" => "guvnor-webapp-5.4.0-SNAPSHOT.war")]
      at org.jboss.as.controller.OperationContextImpl.createResource(OperationContextImpl.java:821) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.server.deployment.DeploymentAddHandler.execute(DeploymentAddHandler.java:170)
      at org.jboss.as.controller.OperationContextImpl.executeStep(OperationContextImpl.java:353) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.controller.OperationContextImpl.doCompleteStep(OperationContextImpl.java:298) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.controller.OperationContextImpl.completeStep(OperationContextImpl.java:223) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.controller.ModelControllerImpl$DefaultPrepareStepHandler.execute(ModelControllerImpl.java:350) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.controller.OperationContextImpl.executeStep(OperationContextImpl.java:353) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.controller.OperationContextImpl.doCompleteStep(OperationContextImpl.java:298) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.controller.OperationContextImpl.completeStep(OperationContextImpl.java:223) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:119) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doProcessRequest(ModelControllerClientOperationHandler.java:154) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.processRequest(ModelControllerClientOperationHandler.java:107) [jboss-as-controller-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.protocol.mgmt.ManagementChannel$RequestReceiver.processRequest(ManagementChannel.java:281) [jboss-as-protocol-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.protocol.mgmt.ManagementChannel$RequestReceiver.access$500(ManagementChannel.java:255) [jboss-as-protocol-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.protocol.mgmt.ManagementChannel.doHandle(ManagementChannel.java:156) [jboss-as-protocol-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.protocol.ProtocolChannel.handleMessage(ProtocolChannel.java:158) [jboss-as-protocol-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.remoting3.remote.RemoteConnectionChannel$4.run(RemoteConnectionChannel.java:224) [jboss-remoting-3.2.0.Beta2.jar:3.2.0.Beta2]
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
      at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  swd847 Stuart Douglas
                  Reporter:
                  ge0ffrey Geoffrey De Smet
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: