Hello prrm,
your connection pool of producers exceeds.
Modify your code:
Make your test ejb stateful.
Add two methods: init and close
{code}
public void init() {
qConn = jmsLocator.getQueueConnection();
session = qConn.createSession(false, Session.AUTO_ACKNOWLEDGE);
producer = session.createProducer(jmsLocator.getMessageQueue());
msg = session.createObjectMessage();
msg.setObject(message);
}
public void close() {
qConn.close();
session.close();
}
{code}
I don't take care about exception handling in this demo code.
Modify your enqueue method:
{code}
public void enqueue(MessageObj message) {
msg = session.createObjectMessage();
msg.setObject(message);
producer.send(msg);
}
{code}
And your client:
{code}
testEjbBean.init();
for(int i=0;i<120;i++){
MessageObj msobj=new MessageObj(rr,0);
testEjbBean.enqueue(msobjj);
}
testEjbBean.close();
{code}
… should run now.
Greetings from Hamburg,
Andreas
… ahh, and by the way, have a look at interceptors to avoid your logging code on starting and ending a method.
[Message sent by forum member 'angerhard' (java.net_at_servicepack7.de)]
http://forums.java.net/jive/thread.jspa?messageID=368595