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

    Wierd WELD behaviour

    softplan

      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.

        • 1. Re: Wierd WELD behaviour
          softplan

          I kinda figure this out... i guess.

           

          all methods annotated with @Named are returning org.jboss.weld.bean.ProducerMethod instead of their actual return type. How can i fix ths?