Help coderanch get a
new server
by contributing to the fundraiser
  • 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: 965
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: 965
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/
 
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic