1 Reply Latest reply on May 8, 2014 2:45 PM by Julio Marques

    Wierd WELD behaviour

    Julio Marques Newbie

      I'm having a strange message when i try to do this:

       

      @Resource(mappedName = "java:/jdbc/zionGeneratedIdDataSource-ds")

          DataSource zionGeneratedDataSource;

       

          @Produces

          @Named("zionGeneratedIdDataSource")

          public DataSource getIdGenerationDataSource() {

              return this.zionGeneratedDataSource;

          }

       

      but, when i try to recover the DataSource i get this:

       

      10:25:04,223 ERROR [org.jboss.as.ejb3.invocation] (http-/0.0.0.0:8080-3) JBAS014134: A Invocação EJB falhou no AnomaliaServiceImpl do componente para o public abstract void br.com.softplan.ungp.oae.service.obraArte.AnomaliaService.salvaAnomalia(br.com.softplan.ungp.oae.model.tabela.AnomaliaEntity) do método: javax.ejb.EJBException: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001305 The given type class org.jboss.weld.bean.ProducerMethod is not a type of the bean Producer Method [DataSource] with qualifiers [@Any @Default @Named] declared as [[method] @Produces @Named public br.com.softplan.ungp.oae.config.AppConfig.getIdGenerationDataSource()]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:189) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:274) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:339) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:238) [jboss-as-ejb3-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.2.Final-redhat-1.jar:1.1.2.Final-redhat-1]

       

      I have no idea what is wrong in this case.