Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-4594

(7.0.z) EJB with AroundConstruct interceptor with Object return type fails to deploy

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.0.2.CR1, 7.0.2.GA
    • None
    • EE, EJB
    • None
    • EAP 7.0.2

      Having:

      @Stateless
      @Interceptors(AroundConstructInterceptor.class)
      public class AroundConstructSLSB {
      ...
      }
      

      and

      public class AroundConstructInterceptor {
      
          public static volatile boolean intercepted = false;
      
          @AroundConstruct
          private Object aroundConstruct(InvocationContext ctx) throws Exception {
              intercepted = true;
              return ctx.proceed();
          }
      }
      

      fails with following exception:

      08:18:55,464 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."bcc899ab-39cf-44dc-a2ba-e364d53091cc.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."bcc899ab-39cf-44dc-a2ba-e364d53091cc.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "bcc899ab-39cf-44dc-a2ba-e364d53091cc.war"
      	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0024: Could not configure component AroundConstructSLSB
      	at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:96)
      	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
      	... 5 more
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0175: No method found with id: Method aroundConstruct(javax.interceptor.InvocationContext) on class (or its super class) class org.jboss.as.test.integration.ejb.interceptor.aroundconstruct.returnObject.AroundConstructInterceptor
      	at org.jboss.as.server.deployment.reflect.ClassReflectionIndexUtil.findRequiredMethod(ClassReflectionIndexUtil.java:79)
      	at org.jboss.as.ee.component.DefaultInterceptorConfigurator$1.handleInterceptorClass(DefaultInterceptorConfigurator.java:177)
      	at org.jboss.as.ee.component.DefaultInterceptorConfigurator$1.handle(DefaultInterceptorConfigurator.java:158)
      	at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)
      	at org.jboss.as.ee.component.DefaultInterceptorConfigurator.configure(DefaultInterceptorConfigurator.java:188)
      	at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:82)
      	... 6 more
      

      I cannot see any statement in Interceptor spec forbidding this. Testcase is available at https://github.com/tremes/wildfly/tree/intercept_ejb. I think the problem is class description having this method return type as void. I guess it occurs at first at https://github.com/wildfly/wildfly/blob/master/ee/src/main/java/org/jboss/as/ee/component/ClassDescriptionTraversal.java#L46

              dtikhomi@redhat.com Dmitrii Tikhomirov
              vtunka Václav Tunka
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: