ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » dead locked while createConnection

Post new topic  Reply to topic
 dead locked while createConnection « View previous topic :: View next topic » 
Author Message
ext2xhb
PostPosted: Thu Jun 24, 2010 6:24 pm    Post subject: dead locked while createConnection Reply with quote

Newbie

Joined: 24 Jun 2010
Posts: 2

Hi:
I am using MQ 6.0.2.9 on windows xp;
if I create a new thread, and in the new thread to lookup the QCF and using the qcf to create connection, then the createConnection operation will blocked;
to illustrate the problem , I give a very simple program as following:

public class CheckCreateConnectionDeadLockOfMQ4 {

public static void main(String[] args) {

Runnable r = new Runnable(){
public void run(){
try {
Properties props = new Properties();
props.setProperty (InitialContext.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.fscontext.RefFSContextFactory");
props.setProperty(InitialContext.PROVIDER_URL, "file:C:/JNDI-Directory");
props.setProperty(InitialContext.REFERRAL, "throw");
InitialContext ctx = new InitialContext(props);
ConnectionFactory fac = (ConnectionFactory)ctx.lookup("icqcf");
Connection conn = fac.createConnection();
//do some message process
conn.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("create & close connection success");
}
};
System.out.println("press q to exit");
int c;
while((c = System.in.read()) != 'q')
{
if(c == 'r')
new Thread(r).start();
}

}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » dead locked while createConnection
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.