Search code examples
wildflycdiwelddeltaspike

Interceptor warnings in wildfly 11 deployment originating from deltaspike


During the deployment of my test.war in Wildfly 11 I see a couple of warnings:

09:45:32,714 WARN  [org.jboss.weld.Validator] (MSC service thread 1-4) WELD-001478: Interceptor class org.apache.deltaspike.core.impl.throttling.ThrottledInterceptor is enabled for the application and for the bean archive test.war/WEB-INF/lib/deltaspike-core-impl-1.8.1.jar. It will only be invoked in the @Priority part of the chain.
09:45:32,714 WARN  [org.jboss.weld.Validator] (MSC service thread 1-4) WELD-001478: Interceptor class org.apache.deltaspike.core.impl.lock.LockedInterceptor is enabled for the application and for the bean archive test.war/WEB-INF/lib/deltaspike-core-impl-1.8.1.jar. It will only be invoked in the @Priority part of the chain.
09:45:32,715 WARN  [org.jboss.weld.Validator] (MSC service thread 1-4) WELD-001478: Interceptor class org.apache.deltaspike.core.impl.future.FutureableInterceptor is enabled for the application and for the bean archive test.war/WEB-INF/lib/deltaspike-core-impl-1.8.1.jar. It will only be invoked in the @Priority part of the chain.
09:45:32,722 WARN  [org.jboss.weld.Validator] (MSC service thread 1-4) WELD-001478: Interceptor class org.apache.deltaspike.jpa.impl.transaction.TransactionalInterceptor is enabled for the application and for the bean archive test.war/WEB-INF/lib/deltaspike-jpa-module-impl-1.8.1.jar. It will only be invoked in the @Priority part of the chain.
09:45:32,728 WARN  [org.jboss.weld.Validator] (MSC service thread 1-4) WELD-001478: Interceptor class org.apache.deltaspike.proxy.util.EnableInterceptorsInterceptor is enabled for the application and for the bean archive test.war/WEB-INF/lib/deltaspike-proxy-module-api-1.8.1.jar. It will only be invoked in the @Priority part of the 

This seems to be because in each beans.xml of the in my test.war existing deltaspike jars some interceptors are present, e.g for deltaspike-core-impl-1.8.1.jar:

<class>org.apache.deltaspike.core.impl.throttling.ThrottledInterceptor</class>
<class>org.apache.deltaspike.core.impl.lock.LockedInterceptor</class>
<class>org.apache.deltaspike.core.impl.future.FutureableInterceptor</class>

Is it possible to delete the interceptors from beans.xml with no harm?

In Wildfly 11 CDI 1.2 is used and I think the explicit listing of interceptors in beans.xml is not needed any longer.

At least there seems to exist some (minor) problem which should be looked into by deltaspike devs?


Solution

  • This is DeltaSpike nasty black magic - they are trying to stay CDI 1.0 compatible which means they cannot use @Priority (which was introduced later on, CDI 1.1) as a means of enabling their interceptors/decorators/alternatives globally. In order for it to work, they have to include a beans.xml into their JAR and enable it there on a per-archive basis.

    But that's not all, they are then working around the @Priority limitation by using an extension which promotes all their interceptors to globally enabled ones (e.g. as if they had @Priority).

    Now, I am not sure from the top of my head whether you can delete it or not - you can easily try and see if they still work. But I would not touch it as DS seems to be fragile in this regard.

    As for Weld warning - it is pretty harmless, Weld is just telling you that in processing all interceptors:

    • those it has found listed in beans.xml (per bean archive enablement)
    • those it has identified via scanning classpath; looking for @Interceptor + @Priority (globally enabled)
    • and ultimately those enabled via extension (globally enabled)

    It has found that some interceptor are enabled both ways and that despite this fact, they will only be invoked once.

    To sum up, you don't need to do anything and it should still work for you.