CDI: Using Interceptors across different modules / bean archives

前端 未结 6 482
[愿得一人]
[愿得一人] 2021-02-05 11:18

My Java EE 6 application consists of a war and an ejb module packaged in ear file. I\'m using CDI for DI (i.e. I have a beans.xml file in both modules). I want to use a logging

6条回答
  •  再見小時候
    2021-02-05 12:02

    It is too late, but if somebody still having this problem. Both modules should be loaded by the same classloader to make usage of interceptor across different modules possible, at least in WebSphere 8b2. In WebSphere this setting can be switched in administration console: Applications > Application Types > WebSphere enterprise applications > [your app name] > Class loading and update detection > WAR class loader policy = Single class loader for application.
    Interceptor must be enabled only ONCE in beans.xml.

提交回复
热议问题