[jboss-jira] [JBoss JIRA] (WFLY-6501) EJB with AroundConstruct interceptor with Object return type fails to deploy

Tomas Remes (JIRA) issues at jboss.org
Wed Apr 20 01:52:00 EDT 2016


    [ https://issues.jboss.org/browse/WFLY-6501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194145#comment-13194145 ] 

Tomas Remes commented on WFLY-6501:
-----------------------------------

Yes the names are little bit weird. You could use my test but nevermind. I would use something like  {{AroundConstructInterceptorWithObjectReturnType}} and {{SessionBeanWithInterceptor}}. There is now no need to fix this in Weld because currently there is no way how to distinguish whether the class is only bean or the interceptor class in case of using {{@Interceptors}}.

> EJB with AroundConstruct interceptor with Object return type fails to deploy
> ----------------------------------------------------------------------------
>
>                 Key: WFLY-6501
>                 URL: https://issues.jboss.org/browse/WFLY-6501
>             Project: WildFly
>          Issue Type: Bug
>          Components: EE, EJB
>    Affects Versions: 10.0.0.Final
>            Reporter: Tomas Remes
>            Assignee: Dmitrii Tikhomirov
>         Attachments: myintercepter.tar.gz
>
>
> Having:
> {code}
> @Stateless
> @Interceptors(AroundConstructInterceptor.class)
> public class AroundConstructSLSB {
> ...
> }
> {code}
> and 
> {code}
> public class AroundConstructInterceptor {
>     public static volatile boolean intercepted = false;
>     @AroundConstruct
>     private Object aroundConstruct(InvocationContext ctx) throws Exception {
>         intercepted = true;
>         return ctx.proceed();
>     }
> }
> {code}
> fails with following exception:
> {noformat}
> 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
> {noformat}
> 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 



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list