|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQThread.run error |
« View previous topic :: View next topic » |
Author |
Message
|
rita |
Posted: Sun Jan 27, 2002 11:37 pm Post subject: |
|
|
Novice
Joined: 31 Dec 2001 Posts: 17
|
hi
I am getting this error when running a jms app which puts a message into the queue.
Uncaught exception (java.lang.UnknownError: )
MQThread.run()
this=(com.ibm.mq.server.MQThread) Thread[Thread-2,5,main]
|
|
Back to top |
|
 |
kolban |
Posted: Mon Jan 28, 2002 8:23 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Do you have any additional information? Perhaps an exception backtrace? By any chance are you using the JMS objects in a thread other than the thread in which they were created? |
|
Back to top |
|
 |
rita |
Posted: Mon Jan 28, 2002 9:49 am Post subject: |
|
|
Novice
Joined: 31 Dec 2001 Posts: 17
|
this is the program which is bugging me ....
..............................................................................
QueueConnectionFactory connectionFactory= null;
QueueConnection connection=null;
QueueSession testSession =null;
Queue testQueue;
InitialDirContext ctx = null;
try{
java.util.Hashtable env = new java.util.Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
env.put(Context.PROVIDER_URL,"iiop://url");
ctx = new InitialContext(env);
connectionFactory = (QueueConnectionFactory)ctx.lookup("testQCF");
}
catch(NamingException e)
{
System.err.println("Error during lookup of Connection Factory " + e.getMessage());
}
catch(JMSException jmsException) { System.err.println("Error from JMS " + jmsException.getMessage());}
catch(java.lang.Exception ex) { System.err.println("Error from Java " + ex.getMessage());}
try {
//queue connection
connection = connectionFactory.createQueueConnection();
testSession = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
testQueue= (Queue)ctx.lookup("testQ");
QueueSender testSender = testSession.createSender(testQueue);
TextMessage myMessage = testSession.createTextMessage();
myMessage.setText("MQSeries");
testSender.send(myMessage); ( *** this is where i am getting error***)
testSender.close();
testSession.close();
connection.close();
ctx.close();
}
catch (JMSException e)
{
.............
It runs fine 1st time without any error, but when i run it 2nd time ..its throwing error.
The error is coming up after executing the line testSender.send(myMessage). it is able to put message in the queue, but still shows the error....
how to solve this ? |
|
Back to top |
|
 |
kolban |
Posted: Mon Jan 28, 2002 11:05 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Can you catch all exceptions ... something like:
Code: |
catch (Exception e)
{
System.out.println("Exception: " + e.toString());
printStackTrace();
}
|
and post the results. What environment is your application executing within? Stand-alone Java app, applet, inside an application server, part of an EJB, part of a Servlet etc etc |
|
Back to top |
|
 |
rita |
Posted: Mon Jan 28, 2002 12:02 pm Post subject: |
|
|
Novice
Joined: 31 Dec 2001 Posts: 17
|
hi kolban
even if i put any catch block, its not able to catch it.directly shows up the error on to the visualage debugger.
environment is winnt for both mq and application. its a simple stand alone application.
you can check this problem with running mqsyncjms.java in the software repository of this site. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|