I am sorry folks about the earlier post. The problem was cause I didnt knew the 
working of jboss very well, I suppose, I may be wrong again. If someone with 
good knowledge can confirm it that will be good. I know the solution now for 
the post I have made. 

Jboss Jms works on the ping pong concept that took a bit long time for me to 
find out how exactly it worked. I knew there was a thread running behind which 
carried out the ping pong thing. 

If you see my code, I will stick and paste the part of the code where I 
identified the bug 

/** 
* Send the given String as a JMS message to the testQueue queue. 
*/ 
public void send(String msg) throws JMSException { 

// Create a message 
TextMessage message = queueSession.createTextMessage(); 
message.setText(msg); 

// Send the message 
queueSender.send(queue, message); 
} 


If you see in above code I was forwarding the Jms exception thrown as it is, by 
the time the other part of program where it could catch the the exception and 
do something needful, the separate ping pong thread which was running used to 
throw its own exception. and I was getting the un-needed exception in my output 
log so when I changed the code as follows, the error was finally resolved after 
2 days for me hope i save someone elses time.

/** 
* Send the given String as a JMS message to the testQueue queue. 
*/ 
public void send(String msg) throws Exception { 
try{
// Create a message 
TextMessage message = queueSession.createTextMessage(); 
message.setText(msg); 

// Send the message 
queueSender.send(queue, message); 
}catch(JMSException jmse){
try{
if (queueConnection != null)
queueConnection.close();
//throw my own exception other than JMSException
throw new NullPointerException();
}catch(JMSException jmse){
//for connection exception
}
}
} 


what I am doing in my above i am catching the exception thrown at that very 
moment at close the connection so the ping pong thread will stop functioning 
and later I throw my own exception as I want a centralised place for exception 
handling and wish to do something with that exception in my other part of 
program..

Hope the query is resolved. If someone can check it it will be good

Thanks in adavance
Irfan Bagalkote


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3878643#3878643

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3878643


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to