3 Replies Latest reply on Jul 4, 2012 8:00 AM by ora

    No Proxy for Dependent Scoped Bean when loaded from a JAR

    ora

      Hi,

       

      I have a strange behaviour at the following scenario:

       

      I'm running Weld 1.1.5.Final, JBoss AS 7.1.0.Final

       

      Eclipse Project A contains:

      • TestInterceptor : CDI-Interceptor
      • DependentScopedBean : a dependent scoped bean with annotated usage of the TestInterceptor
      • TestCase to inject a DependentScopeBean into an Arquillian TestCase and execute the interceptor on method invocation

       

      -> TestCase works fine. DependenScopedBean is injected as a Proxy, Interceptor is executed

       

       

      Eclipse Project B contains:

      • dependency on Project A
      • Same TestCase as in Project A

       

      -> TestCase fails, because DependentScopedBean is injected as normal instance without proxy. Interceptor is not executed.

      -> if I copy the DependentScopedBean in Project B and use it in the TestCase it works again

      -> same if I don't run a TestCase with Arquillian (WebArchive) but a  call of a Web-Application.

       

      Any help would be appreciated.

       

      Thanks,

      Oliver