私は次のプロジェクト構造(Maven)を持っています:
- war with `WEB-INF/beans.xml`, `WEB-INF/web.xml` and REST service configuration
- ext-spi (packaged as jar, not bean archive) which provides some simple SPI, finally goes to `war/WEB-INF/lib`
- ext - parent project (pom)
-- ext-impl (jar, bean archive - META-INF/beans.xml exists) - contains CDI Interceptor (both binding and implementation) + some REST service (RequestScoped CDI Bean) which is annotated with mentioned Interceptor Binding finally goes to `war/WEB-INF/lib`
-- ext-model (jar) - contains REST service API and data model, finally goes to `war/WEB-INF/lib`
問題は、Interceptor が機能しないことです。もちろん、(との異なる組み合わせ)で有効にしましbeans.xml
た。エラーも警告もありません。jar から読み取られていないように見えます-インターセプターを有効にするときに指定した偽のクラスパスや、不正な形式の xml タグについても文句はありません。同じ Bean アーカイブから別の CDI Bean を ing する場合、同じ CDI Bean に問題はありません。war
ext-impl
META-INF/beans.xml
@Inject
直接作成された CDI Bean で同じインターセプターを使用しようとすると、war
すべてが完全に機能します。
仕様によると、それは動作するはずです。
アプリケーション サーバー: Glassfish 3.1.2.2
インターセプター:
@Inherited
@InterceptorBinding
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface ResourceInterceptorBinding {
}
何が間違っているのか分かりますか?