More on this (forgot to tell you)... ApplicationMessageBean is a property of ApplicationScopeBean, while ApplicationScopeBean is property to CDI @SessionScoped beans and servlet filter.
Maybe this has something to do with it. :) On Sun, Mar 10, 2013 at 7:47 AM, Howard W. Smith, Jr. < [email protected]> wrote: > Romain, update/FYI/question on this old topic... > > 1. @PreDestroy, on CDI @ApplicationScoped bean, is executed, whenever I > shutdown TomEE. > 2. I don't undeploy apps much anymore, I shutdown TomEE, drop new WAR, and > remove/delete the folder that previous WAR was unpacked in/to. > > 3. Here is the kicker... when I approached you about this in the past, I > only had 1 CDI @ApplicationScoped bean, and it is working great in > production. Recently, I added another CDI @ApplicationScoped bean, and for > whatever reason, @PreDestroy is 'only' executed on the 1st/original CDI > @ApplicationScoped bean, but not on the 2nd CDI @ApplicationScopedBean. > > 4. So, recently, I added CDI @ApplicationScoped bean, > ApplicationMessageBean (for JMS/ActiveMQ) > > 5. I added @PreDestroy to CDI @ApplicationScoped bean, > ApplicationMessageBean, and shutdown TomEE does not invoke the @PreDestroy > method > > 6. Originally, i only had (and still have) CDI @ApplicationScoped > ApplicationScopeBean; @PreDestroy is always triggered on this bean, when I > shutdown TomEE. > > > > On Sat, Nov 24, 2012 at 11:44 PM, Howard W. Smith, Jr. < > [email protected]> wrote: > >> Romain, i'm seeing @PreDestroy executed now, but honestly, I think I see >> it executing sometimes. Sometimes, I don't see it execute, but I'll try to >> watch more closely to see if @PreDestroy (on CDI @ApplicatonScoped) is >> executing every time. :) >> >> Thanks! >> >>
