2 Replies Latest reply on Jul 7, 2011 1:31 AM by Esteve Aviles

    Seam 3 + AS 7 CR1 Two default beans with the same type and qualifiers

    Esteve Aviles Newbie
      Hi,
      I am getting this error while testing an application in AS 7 CR1 that works fine in AS 6.

      I use seam with this resulting classpath:
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/commons-lang-2.6.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/joda-time-1.6.2.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/mysql-connector-java-5.1.14.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/ocpsoft-pretty-time-1.0.7.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/picketlink-idm-api-1.5.0.Alpha02.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/picketlink-idm-common-1.5.0.Alpha02.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/picketlink-idm-core-1.5.0.Alpha02.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/picketlink-idm-spi-1.5.0.Alpha02.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/prettyfaces-jsf2-3.3.0.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/primefaces-2.2.1.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/seam-catch-3.0.0.Final.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/seam-config-xml-3.0.0.Final.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/seam-faces-3.0.0.Final.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/seam-international-3.0.0.Final.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/seam-persistence-3.0.0.Final.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/seam-persistence-api-3.0.0.Final.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/seam-persistence-impl-3.0.0.Final.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/seam-security-3.0.0.Final.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/seam-servlet-3.0.0.Final.jar
      /servers/jboss-7.0.0.CR1/standalone/deployments/teamgol.war/WEB-INF/lib/seam-solder-3.0.0.Final.jar

      The error is:
      standalone@localhost:9999 /] deploy teamgol.war 
      {"Failed services" => {"jboss.deployment.unit.\"teamgol.war\".WeldService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"teamgol.war\".WeldService: org.jboss.weld.exceptions.DefinitionException: Exception List with 3 exceptions:
      Exception 0 :
      java.lang.RuntimeException: Two default beans with the same type and qualifiers: Type: interface org.jboss.seam.persistence.FlushModeManager Qualifiers: [@javax.enterprise.inject.Default()] Beans are Managed Bean [class org.jboss.seam.persistence.FlushModeManagerImpl] with qualifiers [@Any @Synthetic] and Managed Bean [class org.jboss.seam.persistence.FlushModeManagerImpl] with qualifiers [@Any @Synthetic]
          at org.jboss.seam.solder.bean.defaultbean.DefaultBeanExtension.afterBeanDiscovery(DefaultBeanExtension.java:445)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
          at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
          at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
          at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
          at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)
          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)
          at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)
          at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:88)
          at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:52)
          at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:43)
          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:372)
          at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81)
          at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
          at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)
      Exception 0 :
      java.lang.RuntimeException: Two default beans with the same type and qualifiers: Type: interface org.jboss.seam.transaction.SeamTransaction Qualifiers: [@org.jboss.seam.transaction.DefaultTransaction()] Beans are Managed Bean [class org.jboss.seam.transaction.DefaultSeamTransaction] with qualifiers [@Any @Synthetic] and Managed Bean [class org.jboss.seam.transaction.DefaultSeamTransaction] with qualifiers [@Any @Synthetic]
          at org.jboss.seam.solder.bean.defaultbean.DefaultBeanExtension.afterBeanDiscovery(DefaultBeanExtension.java:445)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
          at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
          at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
          at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
          at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)
          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)
          at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)
          at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:88)
          at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:52)
          at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:43)
          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:372)
          at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81)
          at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
          at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)
      Exception 0 :
      java.lang.RuntimeException: Two default beans with the same type and qualifiers: Type: interface org.jboss.seam.transaction.Synchronizations Qualifiers: [@javax.enterprise.inject.Default()] Beans are Managed Bean [class org.jboss.seam.transaction.TransactionManagerSynchronizations] with qualifiers [@Any @Synthetic] and Managed Bean [class org.jboss.seam.transaction.TransactionManagerSynchronizations] with qualifiers [@Any @Synthetic]
          at org.jboss.seam.solder.bean.defaultbean.DefaultBeanExtension.afterBeanDiscovery(DefaultBeanExtension.java:445)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
          at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
          at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
          at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
          at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)
          at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)
          at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)
          at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:88)
          at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:52)
          at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:43)
          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:372)
          at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81)
          at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
          at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)


      Thanks in advance