Uploaded image for project: 'JBeret'
  1. JBeret
  2. JBERET-553

Support injection into target of type jakarta.enterprise.inject.Instance

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Major
    • 2.1.0.Final
    • None
    • jberet-core
    • None

    Description

       

      Some tck tests (com.ibm.jbatch.tck.tests.jslxml.CDITests#testCDILazyInject) currently failed with:

      jakarta.batch.operations.BatchRuntimeException: JBERET000618: Failed to inject value It's a parm into field jakarta.enterprise.inject.Instance com.ibm.jbatch.tck.artifacts.cdi.ApplicationScopedBatchlet.prop1Inst, because the field type interface jakarta.enterprise.inject.Instance is not supported for property injection.
          at org.jberet.creation.ValueConverter.convertFieldValue(ValueConverter.java:237)
          at org.jberet.creation.BatchBeanProducer.getProperty(BatchBeanProducer.java:420)
          at org.jberet.creation.BatchBeanProducer.getString(BatchBeanProducer.java:215) 

      It's no longer valid to infer the injection target type (e.g., the field type of a field injection) from the injection point, now that the injection can be lazy. For example,

      @Inject
      @BatchProperty
      private Instance<String> val;

      The type inferred from the injection point is Instance, which is wrong; the expected injection target value type is String.

      Attachments

        Activity

          People

            cfang@redhat.com Cheng Fang
            cfang@redhat.com Cheng Fang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: