aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Urgent Pls..... MDBs calling One Session Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Urgent Pls..... MDBs calling One Session Bean" Watch "Urgent Pls..... MDBs calling One Session Bean" New topic
Author

Urgent Pls..... MDBs calling One Session Bean

Mohsin Kayal
Greenhorn

Joined: Oct 22, 2005
Posts: 23
Dear All,

We developed an Enterprise Application which contains 11MDBs which reads messages from different queues and call only one Stateless Session Bean to perform business processes.

We use IBM WAS 5.1.0.5,IBM Websphere MQ 5.3 (CSD011) which run under OS windows 2000 server. The business process is in Oracle 9i Stored Procedure.

If I start one listener out of 11, it works fine. If I start morethan one listener, I am getting the following exception:


[11/30/05 10:26:47:719 AST] 7f3123b4 ServerSession W WMSG0031E: Exception processing JMS Message for MDB Group02MDB, JMSDestination Group02 : java.lang.NullPointerException
at exe.rpt.Group02MDBBean.onMessage(Unknown Source)
at com.ibm.ejs.jms.listener.MDBWrapper$PriviledgedOnMessage.run(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.jms.listener.MDBWrapper.callOnMessage(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.jms.listener.MDBWrapper.onMessage(MDBWrapper.java(Compiled Code))
at com.ibm.mq.jms.MQSession.run(MQSession.java(Compiled Code))
at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java(Inlined Compiled Code))
at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java(Compiled Code))
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)

[11/30/05 10:26:48:062 AST] 7f3123b4 ExceptionUtil E CNTR0020E: Non-application exception occurred while processing method "onMessage" on bean "BeanId(CSEFixEAR#CSEFixEJB.jar#Group02MDB, null)". Exception data: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSessionDispatcher.dispatch(ServerSessionDispatcher.java(Compiled Code))
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
Caused by: java.lang.NullPointerException
at exe.rpt.Group02MDBBean.onMessage(Unknown Source)
at com.ibm.ejs.jms.listener.MDBWrapper$PriviledgedOnMessage.run(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.jms.listener.MDBWrapper.callOnMessage(MDBWrapper.java(Compiled Code))
at com.ibm.ejs.jms.listener.MDBWrapper.onMessage(MDBWrapper.java(Compiled Code))
at com.ibm.mq.jms.MQSession.run(MQSession.java(Compiled Code))
at com.ibm.ejs.jms.JMSSessionHandle.run(JMSSessionHandle.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.connectionConsumerOnMessage(ServerSession.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.onMessage(ServerSession.java(Compiled Code))
at com.ibm.ejs.jms.listener.ServerSession.dispatch(ServerSession.java(Inlined Compiled Code))
... 8 more


Questions:

1) Do we need to write 11 session beans for 11 MDBs. (Bsiness process are same).
2) Is there any way to tune listeners or MDBs so as every thing works fine.
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Why would you want 11 session beans which do the same thing? As SLSBs are pooled, you have to make sure that the pool size is adequate for your application.

As for the MDBs ... You must have only one bean type associated with a particular JMS queue. Do not associate more than one bean type with a queue.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Mohsin Kayal
Greenhorn

Joined: Oct 22, 2005
Posts: 23
Hi Mr.Roger,

We have 11 MDBs which are looking 11 queues. I don't know how to increase the pool size of the SLSB in IBM WAS 5.1. Could u pls. give me the details.

Thanks indeed
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Hi Mohsin,

I�m no WAS expert and I cannot tell you how you can do this with WebSphere (this is the reason why I�m not answering to your other posting). However this is a very easy to accomplish task and it might be vendor dependent. As per J2EE specs each ejb should be accompanied by a specific deployment descriptor file: ejb-jar.xml. Most of the containers though provide an extra deployment descriptor to control other container specific settings. Weblogic for example provides a weblogic-ejb-jar.xml. Here you can configure each SLSBs� free pool, using the initial-beans-in-free-pool and max-beans-in-free-pool deployment tags (the names are self descriptive though). I guess that WebShphere is using a similar approach.
I hope this will narrow your search and will point you to the right direction.
Regards.


I think, therefore I exist -- Rene Descartes
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

Originally posted by Roger Chung-Wee:
Why would you want 11 session beans which do the same thing? As SLSBs are pooled, you have to make sure that the pool size is adequate for your application.


I'd have to agree, 11 queues that are all used by the same session bean seems like a waste of resources. I'd configure them all to go to the same queue, and have the MDB read message header information (and not the message) in order to determine the exact address/process.


My Blog: Down Home Country Coding with Scott Selikoff
Mohsin Kayal
Greenhorn

Joined: Oct 22, 2005
Posts: 23
Thanks to all,

My requirement is to process the message in strict order and moreover it has to be very fast (say 100 msgs/sec). That is why I opted to go with 11 queues.

Now I have 11 MDBs and only one session bean and I got the solution.

My Sincere thanks again to all.
david lightman
Ranch Hand

Joined: Nov 03, 2004
Posts: 82
the guys above didn't read your question correctly. You are simply talking MDB's servicing 11 queues, 1 SLSB services the 11 MDB's.

This is a good strategy, I understand what you are trying to do. Setting the maxsession (1) in the MLP/qcf will guarantee process order alhthoug perf suffers obviously becuase there is no connection pooling on the MDB's but it meets your business requirement.

You also need to check within th QCF to ensure you are using CLIENT bindings or the 1st MDB will start but the rest will fail, be sure to use separate SVRCONN channels for these too.

this should fix the issue
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Urgent Pls..... MDBs calling One Session Bean