1

AS: Websphere 8.5.5

MQ impl: SIB

During application startup MDB starts to invoke onMessage method, which in turn invokes initialContext.lookup in order to find specific bean. Sometimes (during variety of startup iterations) it returns null instead of reference to bean object.

This behavior is nondeterministic: in some startup iterations bean's context has time for all JNDI names initialization due to more longer MDB initialization and respectively a pause in message consumption.

Is there any workaround or magic IBM key to resolve issue ?

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
uptoyou
  • 1,427
  • 19
  • 24

3 Answers3

0

One of the ways of working around this is by using startup ordering. Based on the start up order sequence , different deployed applications can be started in sequence. In your case , i would ensure that the EJB component you want is given a lower sequence to start it up first followed by the MDB so that the lookup will never fail

Ramachandran.A.G
  • 4,788
  • 1
  • 12
  • 24
  • Thanks for post, but its not allowed to separate MDB as standalone app due to architect preferences. I solved the problem (but i can't guarantee the real reason of this issue), i guess it was non-thread-safe InitialContext. After replacement InitialContext as INSTANCE VARIABLE to static call of InitialContext.doLokup() the problem has gone. – uptoyou Sep 06 '16 at 20:46
0

If you have any additional initialisation happening inside the MDB it is helpful to consider the @PostContruct annotation. I too had the onMessage firing too early, before initialisation was complete, resulting in the message not being processed. After putting my additional initialisation logic in a method with this annotation, it solved my problem.

@PostConstruct
    public void initialize() {
....
}
aUXcoder
  • 1,048
  • 1
  • 20
  • 32
Jo-dee
  • 1
  • thank for your answer, there where few conditions that didn't allow me to use @Postconstruct (posted my solution) – uptoyou Nov 17 '17 at 21:41
0

So, as everyone "love's" Websphere, it was without a doubt an IBM bug. Sorry, i lied.... it was TWO bugs at the same time.

uptoyou
  • 1,427
  • 19
  • 24