1 Reply Latest reply on Aug 12, 2010 9:09 AM by khalid Horri

    JBOSS Deployement ERROR : org.jboss.weld.exceptions.ForbiddenArgumentException: WELD-001301 Annotation @javax.enterprise.inject.New

    khalid Horri Newbie

      Hi,

      I have an error when deploying a web application using spring 3 and  jsf 2, the error appear when I change @ManagedBean by @Named, for more information I have a bean like this :

       

      User.java

       

      /*******************************************************************************
       * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc. Distributed under license by Red Hat, Inc. All rights reserved. This program
       * is made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at
       * http://www.eclipse.org/legal/epl-v10.html
       * 
       * Contributors: Exadel, Inc. and Red Hat, Inc. - initial API and implementation
       ******************************************************************************/
      package demo;
      
      import javax.enterprise.context.RequestScoped;
      import javax.inject.Named;
      
      /**
       * Created by JBoss Developer Studio
       */
      @Named
      @RequestScoped
      public class User {
      
          private String name;
          private UserService userService;
      
          /**
           * @return User Name
           */
          public String getName() {
          return this.name;
          }
      
          /**
           * @param User
           *            Name
           */
          public void setName(String name) {
          this.name = name;
          }
      
          /**
           * @return the userService
           */
          public UserService getUserService() {
          return this.userService;
          }
      
          /**
           * @param userService
           *            the userService to set
           */
          public void setUserService(UserService userService) {
          this.userService = userService;
          }
      
          public String sayHello() {
          return this.userService.sayHello();
          }
      }
      

       

      the stack error :

       

      11:37:26,663 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=vfs:///C:/jboss-6/server/default/deploy/application.war_WeldBootstrapBean state=Create: org.jboss.weld.exceptions.ForbiddenArgumentException: WELD-001301 Annotation @javax.enterprise.inject.New(value=demo.User.class) is not a qualifier
          at org.jboss.weld.manager.BeanManagerImpl.checkBindingTypes(BeanManagerImpl.java:510)
          at org.jboss.weld.manager.BeanManagerImpl.checkResolveDecoratorsArguments(BeanManagerImpl.java:933)
          at org.jboss.weld.manager.BeanManagerImpl.resolveDecorators(BeanManagerImpl.java:922)
          at org.jboss.weld.bean.AbstractClassBean.initDecorators(AbstractClassBean.java:202)
          at org.jboss.weld.bean.AbstractClassBean.initializeAfterBeanDiscovery(AbstractClassBean.java:187)
          at org.jboss.weld.bean.ManagedBean.initializeAfterBeanDiscovery(ManagedBean.java:380)
          at org.jboss.weld.bootstrap.BeanDeployment.doAfterBeanDiscovery(BeanDeployment.java:167)
          at org.jboss.weld.bootstrap.BeanDeployment.afterBeanDiscovery(BeanDeployment.java:156)
          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:382)
          at org.jboss.weld.integration.deployer.env.helpers.BootstrapBean.boot(BootstrapBean.java:121) [:6.0.0.Beta11]
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_16]
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_16]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_16]
          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_16]
          at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59) [jboss-reflect.jar:2.2.0.Alpha4]
          at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.0.Alpha4]
          at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.0.Alpha4]
          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.Alpha9]
          at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.Alpha9]
          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.Alpha9]
          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.Alpha9]
          at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202) [jboss-kernel.jar:2.2.0.Alpha9]
          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.Alpha9]
          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:892) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:639) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:180) [:2.2.0.Alpha4]
          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.Alpha4]
          at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.Alpha4]
          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1857) [:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1575) [:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1596) [:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1516) [:2.2.0.Alpha4]
          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:937) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:652) [jboss-dependency.jar:2.2.0.Alpha9]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:2008) [:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1101) [:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.Alpha4]
          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117) [:6.0.0.20100429-M3]
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:409) [:6.0.0.20100429-M3]
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:294) [:6.0.0.20100429-M3]
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_16]
          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [:1.6.0_16]
          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [:1.6.0_16]
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [:1.6.0_16]
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) [:1.6.0_16]
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) [:1.6.0_16]
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_16]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_16]
          at java.lang.Thread.run(Thread.java:619) [:1.6.0_16]
      
      11:37:26,719 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/application
      11:37:26,772 INFO  [org.apache.catalina.core.StandardContext] The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.
      11:37:26,790 INFO  [javax.enterprise.resource.webcontainer.jsf.config] Initializing Mojarra 2.0.2 (FCS b10) for context '/application'
      11:37:30,742 INFO  [javax.enterprise.resource.webcontainer.jsf.config] Monitoring jndi:/localhost/application/WEB-INF/faces-config.xml for modifications
      11:37:30,743 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/application]] Initializing Spring root WebApplicationContext
      11:37:30,775 WARN  [org.jboss.weld.Servlet] WELD-000700 Not starting Weld/Servlet integration as Weld failed to initialize
      11:37:30,780 WARN  [org.jboss.system.server.profileservice.hotdeploy.HDScanner] Failed to process changes: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      DEPLOYMENTS MISSING DEPENDENCIES:
        Deployment "vfs:///C:/jboss-6/server/default/deploy/application.war_WBInjector" is missing the following dependencies:
          Dependency "vfs:///C:/jboss-6/server/default/deploy/application.war_WeldBootstrapBean" (should be in state "Installed", but is actually in state "**ERROR**")
      
      DEPLOYMENTS IN ERROR:
        Deployment "vfs:///C:/jboss-6/server/default/deploy/application.war_WeldBootstrapBean" is in error due to the following reason(s): org.jboss.weld.exceptions.ForbiddenArgumentException: WELD-001301 Annotation @javax.enterprise.inject.New(value=demo.User.class) is not a qualifier, **ERROR**
      
          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1395) [:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1341) [:2.2.0.Alpha4]
          at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:968) [:2.2.0.Alpha4]
          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128) [:6.0.0.20100429-M3]
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:416) [:6.0.0.20100429-M3]
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:294) [:6.0.0.20100429-M3]
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_16]
          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [:1.6.0_16]
          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [:1.6.0_16]
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [:1.6.0_16]
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) [:1.6.0_16]
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) [:1.6.0_16]
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_16]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_16]
          at java.lang.Thread.run(Thread.java:619) [:1.6.0_16]
      

       

      note that I use JBOSS 6 M3

       

      thanks in advance