[forge-issues] [JBoss JIRA] (FURNACE-145) CDI Interceptors are not enabled in an addon

George Gastaldi (JIRA) issues at jboss.org
Mon Jul 17 19:05:00 EDT 2017


George Gastaldi created FURNACE-145:
---------------------------------------

             Summary: CDI Interceptors are not enabled in an addon
                 Key: FURNACE-145
                 URL: https://issues.jboss.org/browse/FURNACE-145
             Project: Forge: Furnace
          Issue Type: Bug
          Components: Container - CDI
    Affects Versions: 2.26.1.Final
            Reporter: George Gastaldi
             Fix For: 2.x Future


If you create an addon and define an interceptor inside its beans.xml, like the following:

{code:java}
@Interceptor
@MyInterceptorBinding
public class MyInterceptor
{
   @AroundInvoke
   public Object doIt(InvocationContext invocationContext) throws Exception
   {
      System.out.println("*********************************** BLAH");
      return invocationContext.proceed();
   }
}

@InterceptorBinding
@Inherited
@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR })
@Retention(RetentionPolicy.RUNTIME)
public @interface MyInterceptorBinding
{

}

public class InfinispanExtension implements Extension
{

   void registerInterceptorBindings(@Observes BeforeBeanDiscovery event)
   {
      event.addInterceptorBinding(MyInterceptorBinding.class);
   }
}
{code}

The following error is shown: 

{code}
WELD-001417: Enabled interceptor class org.jboss.forge.addon.infinispan.MyInterceptor (<class>org.jboss.forge.addon.infinispan.MyInterceptor</class> in jar:file:/home/ggastald/.forge/addons/org-foo-foo-1-0-0-SNAPSHOT/foo-1.0.0-SNAPSHOT-forge-addon.jar!/META-INF/beans.xml at 7) does not match an interceptor bean: the class is not found, or not annotated with @Interceptor and still not registered through a portable extension, or not annotated with @Dependent inside an implicit bean archive
{code}



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the forge-issues mailing list