Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1672

Interceptor for generic bean is not invoked

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.1.2.Final
    • Fix Version/s: 2.2.2.Final
    • Component/s: None
    • Labels:
      None

      Description

      The following code does not work in Wildfly 8.1.0 CR. I'm getting exception: javax.persistence.TransactionRequiredException. I looks like the Weld issue as the stack trace does not contain Transactional interceptor invocation.

      @Transactional
      public static class Parent<E> {
      protected EntityManager em;

      public void create(E entity)

      { em.persist(entity); }

      }

      @Transactional
      public static class Child extends Parent<EndEntity> {
      @Override
      public void create(EndEntity entity)

      { super.create(entity); }

      }

      then I invoking create() method in submitEntity():

      public class EndEntityController {
      @Inject
      private Child child;

      private Parent<EndEntity> parent()

      { return child; }

      protected void submitEntity(EndEntity entity)

      { EndEntity endEntity = new EndEntity(); parent().create(endEntity); }

      }

      When the Parent class is not generic then the code above works.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mkouba Martin Kouba
                  Reporter:
                  maniek45 Marcin T
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: