Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-3329

EJBs with same Java class name not intercepted by CDI interceptors

XMLWordPrintable

    • Hide
      1. Check out Maven test project from GitHub:
        https://github.com/wrungel/bugs/tree/master/ejb-names-interceptor
      2. Build the project with mvn clean install
      3. Deploy EAR file (ear/target/ejb-names-interceptor.ear) to Wildfly
      4. Call the Webservice http://localhost:8080/MyWebservice/v1/MyEjbImpl?wsdl
      5. Call the Webservice http://localhost:8080/MyWebservice/v2/MyEjbImpl?wsdl
      6. Check server.log:
        expected two lines containing: Intercepted v1.MyEjbImpl and Intercepted v2.MyEjbImpl
        but actually only one line (either containing v1.MyEjbImpl or v2.MyEjbImpl) exists.
      Show
      Check out Maven test project from GitHub: https://github.com/wrungel/bugs/tree/master/ejb-names-interceptor Build the project with mvn clean install Deploy EAR file ( ear/target/ejb-names-interceptor.ear ) to Wildfly Call the Webservice http://localhost:8080/MyWebservice/v1/MyEjbImpl?wsdl Call the Webservice http://localhost:8080/MyWebservice/v2/MyEjbImpl?wsdl Check server.log : expected two lines containing: Intercepted v1.MyEjbImpl and Intercepted v2.MyEjbImpl but actually only one line (either containing v1.MyEjbImpl or v2.MyEjbImpl ) exists.
    • Workaround Exists
    • Hide

      Rename Java class names of the EJBs so all names are unique.

      Also tried to override the names of EJBs according to JSR 318 (EJB 3.1) spec:

      <bean-name> is the ejb-name of the enterprise bean. For enterprise beans defined via annotation,
      it defaults to the unqualified name of the session bean class, unless specified in the contents of the
      Stateless/Stateful/Singleton annotation name() attribute.
      For enterprise beans defined via ejb-jar.xml, it’s specified in the <ejb-name> deployment descriptor element.)

      without success:

      • Overriding the EJB names of the beans in ejb-jar.xml
      • Overriding the EJB names of the beans using @Stateless(name="...")
      Show
      Rename Java class names of the EJBs so all names are unique . Also tried to override the names of EJBs according to JSR 318 (EJB 3.1) spec: <bean-name> is the ejb-name of the enterprise bean. For enterprise beans defined via annotation, it defaults to the unqualified name of the session bean class, unless specified in the contents of the Stateless/Stateful/Singleton annotation name() attribute. For enterprise beans defined via ejb-jar.xml, it’s specified in the <ejb-name> deployment descriptor element.) without success: Overriding the EJB names of the beans in ejb-jar.xml Overriding the EJB names of the beans using @Stateless(name="...")

      Given

      Two or more EJBs with the same Java class name but from different Java deployments.

      Problem

      Interceptor intercepts method calls to only one of the EJBs.

      An EJB to be intercepted seems to be chosen randomly after each redeployment.

            mkouba@redhat.com Martin Kouba
            frolovmx_jira Maxim Frolov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: