-
1. Re: Weld 2.2.5.Final released
wangliyu Sep 18, 2014 11:52 AM (in response to jharting)Hi
I have a web application deployed on Tomcat 7 (tomcat 7.0.55 + java7 + JSF2.1+Richfaces4.3.7 + WeldServlet 2.2.5.Final), in the .war file's WEB-INF/lib, it has a bean jar that contain interceptor, in the beans.xml of that jar, I have declared the <interceptors>, the rest of jars that using that interceptor, it was working with WeldServlet 2.2.4.Final, once move to 2.2.5.Final, it can't resolve the interceptor and seems ignored call the interceptor, I tried -Dorg.jboss.weld.environment.servlet.archive.isolation=false, it doesn't work.
Any ideas?
-
2. Re: Weld 2.2.5.Final released
wangliyu Sep 18, 2014 11:55 AM (in response to wangliyu)I just tested, if I put the same <interceptors> section in other beans.xml, it worked, but that's not in the spec or is it?
-
3. Re: Weld 2.2.5.Final released
mkouba Sep 18, 2014 12:05 PM (in response to wangliyu)Hi!
you should enable the interceptor for the entire application by applying the javax.annotation.Priority annotation to comply with the spec, see also http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#enabled_interceptors and Interceptors spec. If you want to use the old "flat" deployment structure, set a "org.jboss.weld.environment.servlet.archive.isolation" <init-param> in web.xml (not a system property).
-
4. Re: Weld 2.2.5.Final released
wangliyu Sep 18, 2014 12:15 PM (in response to wangliyu)I added @Priority to the interceptor, it does enable it globally, but everytime it called twice. so now if I don't modify each beans.xml in each jar, it will either not call at all or call twice with @Priority?
-
5. Re: Weld 2.2.5.Final released
wangliyu Sep 18, 2014 12:43 PM (in response to wangliyu)To correct myself, the @Priority is only cause 1 call in the 2.2.5.final, so now I'm wondering which way is better/standard way to do to enable the global interceptor?
-
6. Re: Weld 2.2.5.Final released
mkouba Sep 19, 2014 2:36 AM (in response to wangliyu)I'm not sure I follow you. Using the @Priority annotation is the only correct way to enable the interceptor for an application (as introduced in CDI 1.1). The "flat" deployment structure was just an imperfect integration for servlet containers (note that the target platform required by the spec is Java EE). Please create a separate discussion if you have any other questions.