0 Replies Latest reply on Sep 6, 2011 1:11 AM by chkal

    Vetoing Interceptors

    chkal

      Hey there,


      I have a quick question for CDI/Weld experts. I ran into an issue with Weld 1.1.2 and I'm not sure whether it is a Weld bug, spec issue or I did something wrong.


      I've implemented an interceptor and registered it in beans.xml. It's working fine. Now I want to be able to veto this interceptor in some situations. Sending the veto using a ProcessAnnotatedType event works fine but then I get the following exception:


      SCHWERWIEGEND: Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener
      org.jboss.weld.exceptions.DeploymentException: WELD-001417 Enabled interceptor class <class>de.chkal.seam.faces.log.LogMethodCallInterceptor</class> in jndi:/localhost/seam-faces-tests/WEB-INF/beans.xml@5 is neither annotated @Interceptor nor registered through a portable extension
           at org.jboss.weld.bootstrap.Validator.validateEnabledInterceptorClasses(Validator.java:500)
           at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:373)
           at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:390)
           at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:270)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4544)
           at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5016)
           at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
           at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
           at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:738)
              [...]
      



      Is this intended? In my understanding this exception prevents any interceptors to be vetoed.


      Any ideas?


      Thanks


      Christian