-
1. Re: CDI Interceptor doesn't get executed
kaip Oct 5, 2012 10:06 AM (in response to si.ret)Hi Simon!
I have the same problem with my tests.
I have checked the contect of the data directory of my JBoss AS. I have unpacked the content. The structure looks like:
content
WEB-INF
bean.xml (empty)
lib
test.jar
com
META-INF
bean.xml (my file with interceptors)
org
That means, Arquillian adds two bean.xml to the deployment. Perhaps this is a problem.
-
2. Re: CDI Interceptor doesn't get executed
jeremy.kie Oct 26, 2012 9:43 AM (in response to si.ret)I had the same problem you described. This article help me resolve my issue:
https://community.jboss.org/wiki/HowDoICreateOrCopyAndModifyPersistencexmlBeansxmlEtc
-
3. Re: CDI Interceptor doesn't get executed
vineet.reynolds Nov 25, 2012 2:30 AM (in response to si.ret)The placement of the beans.xml and test class matters. If the test class is in a BDA (like WEB-INF/classes) that has an empty beans.xml file, then interceptors are disabled for that BDA (the default behavior). Therefore, you'd want to have finer control over the ShrinkWrap deployment to enable interceptors for all CDI beans whose method invocations are to be intercepted. The best way to handle this for micro-deployments, is to create a WebArchive and add all your classes to WEB-INF/classes. You'd then need to add the interceptor to the beandescriptor placed in WEB-INF/beans.xml.
Additionally, I found it important to apply the @NonBinding annotation to certain attributes of the @InterceptorBinding annotated type. This is of course not applicable if your interceptor binding annotation does not have any attributes.
-
4. Re: CDI Interceptor doesn't get executed
dannydan Apr 20, 2014 5:26 AM (in response to si.ret)Had the same issue. Found that injecting real cdi bean works with interceptors, but when injected through interface it fails.
You can find some info here: https://community.jboss.org/wiki/UsingArquilliantotestapossiblebuginWeld