1 Reply Latest reply on Sep 17, 2013 10:02 AM by Stephen Kay

    @Dispose method not called for CDI beans used by remote EJB?

    Piotr Nowicki Newbie

      Howdy Guys,

       

      I have a CDI bean which has a @Produces method with @RequestScoped. This bean is then injected into SLSB.

      The @Dispose method of the CDI bean should be called when the bean is out of scope. The RequestScoped should work for Servlets, WebServices as well as for remote EJBs.

       

      Surprisingly, the @Dispose method for CDI bean injected into remote EJB is NOT called.

       

      I've created a simple application using Arquillian that runs on JBoss AS 7.1 and shows how I thought it should work. It's on my github: https://github.com/PiotrNowicki/jboss7-cdi-dispose

       

      For RESTful WS it works correct - for remote EJB it doesn't.

       

      Thanks in advance for any help.