6 Replies Latest reply on Feb 25, 2010 3:25 PM by Pieter Martin

    Parameterized Producer question?

    Pieter Martin Novice

      Hi,


      I have the following producer and injection point



           @Produces
           public ModelSolution<DataVector<Double>> getModelSolution() {
                return this.modelSolution;
           }
      
      ...
      
           @Inject
           private ModelSolution<DataVector<Double>> modelSolution;
      
      



      This fails on startup with the following exception,



      Exception in thread "main" org.jboss.weld.exceptions.DefinitionException: WELD-000023 Type parameter must be a concrete type:  public com.rorotika.ci.model.ModelSolution com.rorotika.executor.ci.CIExecutor.getModelSolution()
           at org.jboss.weld.bean.AbstractProducerBean.checkProducerReturnType(AbstractProducerBean.java:180)



      However if I remove the <Double> from <DataVector<Double>> parameterized part it works, The following code works.


           @Produces
           public ModelSolution<DataVector> getModelSolution() {
                return this.modelSolution;
           }
      
      ...
      
           @Inject
           private ModelSolution<DataVector> modelSolution;
      
      



      Is this expected behavior?


      Thanks
      Pieter