• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

MDB’s are fired before the resources

 
Ranch Hand
Posts: 930
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am facing problem of Message driven beans fired before the resources(hibernate, property files etc) are initialized by the startup bean. I am using websphere application server 7.0.0.2.


How to avoid MDB’s are fired before the resources are initialized by the start up bean.


any ideas, links, resources, sample code highly appreciated. thanks in advance
 
sai rama krishna
Ranch Hand
Posts: 930
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found below link

http://stackoverflow.com/questions/13142246/suspend-mdb-message-processing-until-startupbean-has-finished-initialization

above link talks about JBoss Server 7. I am using websphere 7.0.0.7 though. Does that work with Websphere application server 7.0.0.11 as well. Please advise.
I thought of using ejbPostCreate(). But

Based on below link
http://www.geekinterview.com/question_details/659


MDBs do not have

ejbPostCreate()



I am thinking to Add a thread delay in the initialisation of the MBean, hoping that all resources will be initialised by the time the delay is finished. But not sure if that is good approach.
what would be work around solution for this problem.

Please advise
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
MDB does have @PostConstruct. Did you tried using that and tested the behavior.
http://answers.oreilly.com/topic/2156-enterprise-javabeans-31-the-lifecycle-of-a-message-driven-bean/
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic