<html><head></head><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1478810954494_720682">Greetings,</div><div id="yui_3_16_0_ym19_1_1478810954494_720690"><br></div><div id="yui_3_16_0_ym19_1_1478810954494_720754">I am using:</div><div id="yui_3_16_0_ym19_1_1478810954494_720935"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720932"><dependency><br id="yui_3_16_0_ym19_1_1478810954494_720699"> <groupId>org.jboss.weld.se</groupId><br id="yui_3_16_0_ym19_1_1478810954494_720700"> <artifactId>weld-se-core</artifactId><br id="yui_3_16_0_ym19_1_1478810954494_720701"> <version>3.0.0.Alpha15</version><br id="yui_3_16_0_ym19_1_1478810954494_720702"></dependency></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720925"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720980">and I think I found a bug with the interceptors. I wanted to ask about it first before I put it in Jira.</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720924"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720828">Basically, the interceptor I have defined works great if I annotate a method called by the CDI container, which in my case is an method observing for an event. I have an ExceptionRetryInterceptor class and an ExceptionRetry annotation. If I annotate an observer method like this:</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720829"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720830">@ExceptionRetry</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720834">public void send(<br id="yui_3_16_0_ym19_1_1478810954494_720839"> @Observes @Priority(SEND_EMAIL_MESSAGE) EmailEvent evnt<br id="yui_3_16_0_ym19_1_1478810954494_720840"> ) throws MessagingException, IOException {....}</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720841"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720856"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720857">No problem, everything works fine. I can see the interceptor code being called in my logs. <br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720886"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720887">Now here's the problem, If I use this annotation on just a regular method which I call myself, it DOES NOT work. So if I refactor the above example so the annotation is NOT on the observer method called by the container, then the doSend() method below does NOT get wrapped by the interceptor:</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720889"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720896"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720897">public void send(<br id="yui_3_16_0_ym19_1_1478810954494_720898"> @Observes @Priority(SEND_EMAIL_MESSAGE) EmailEvent evnt<br id="yui_3_16_0_ym19_1_1478810954494_720899"> ) throws MessagingException, IOException {</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720909"> //....</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720908"> doSend();</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720907">}</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720911"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_720910">@ExceptionRetry</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_721008">public void doSend() {....} // this method does not get wrapped by the interceptor</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_721027"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_721046"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_721038">I'm trying to figure out why. My ExceptionRetryInterceptor class has a @Priority set on it and that works fine. But I've also tried setting <interceptors> in beans.xml but the doSend(){...} method still doesn't get wrapped.</div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_721073"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_721074">Any thoughts/help?<br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1478810954494_721025"><br></div><div id="yui_3_16_0_ym19_1_1478810954494_720662"><br></div><div id="yui_3_16_0_ym19_1_1478810954494_720658"><br></div><div id="yui_3_16_0_ym19_1_1478810954494_720641"><br></div></div></body></html>