GeeCON Prague 2014*
The moose likes EJB and other Java EE Technologies and the fly likes Probelem with MDB l(on weblogic 7.0) listening to MQ (Start-up class issue ) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Probelem with MDB l(on weblogic 7.0) listening to MQ (Start-up class issue )" Watch "Probelem with MDB l(on weblogic 7.0) listening to MQ (Start-up class issue )" New topic

Probelem with MDB l(on weblogic 7.0) listening to MQ (Start-up class issue )

Doshi Milan
Ranch Hand

Joined: May 29, 2001
Posts: 112
Hello ,
I am supposed to write a Message driven bean that would reside on Weblogic7.0 and listen to a particular queue of IBM MQ.
I understand that we need to write a Start-up class for this. I have written the start-up class but I am getting the following error:
<Apr 16, 2003 3:17:14 PM EDT> <Warning> <EJB> <010061> <The Message-Driven EJB: SimpleMDB is unable
to connect to the JMS destination: ivtQ. The EJB container will automatically attempt to re-establis
h the connection with the JMS server. This warning may occur during WebLogic Cluster start-up if the
JMS destination is located on another server. When the JMS server connection is re-established, the
Message-Driven EJB will again receive JMS messages.
The Error was:
The JMS destination with the JNDI name: ivtQ could not be found. Please ensure that the JNDI name in
the weblogic-ejb-jar.xml is correct, and the JMS destination has been deployed.>
I understand that there are some configuration issues:
Can you please guide where am I going wrong:
1.What should be the value of the <destination-jndi-name> in the Weblogic-ejb-jar. I have not passed any Queue name through the start-up class …Is it ok?
2.Then what queue name should I specify. (ofcousrse it should be the MQ queue name but do I need to add that in the JNDI or in the weblogic console…?
3.Please confirm that the <connection-factory-jndi-name> mentioned in the weblogic-ejb-jar.xml should be the same as what I am passing as JNDIName (through weblogic console).
4.Kindly advice if I am missing anything (especially in my start-ip class)
Here are my Deployemnt descriptors:
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN" "">
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "">
<!-- In WebLogic Server 6.0, this next parameter is named "jms-destination-type" -->

My Start-up class is as follows:
import java.util.*;
import javax.jms.*;
import javax.naming.*;
import weblogic.common.*;

public class MQJMSStartup implements T3StartupDef
/** * The name of the queue manager to connect to. The startup class * will throw an exception if this parameter is not set. */
public final static String QM_NAME_PROPERTY = "QManager";

/** * The host name where the queue manager runs. If not set, the * startup class will create a "bindings mode" connection to a * queue manager on the local host. */
public final static String QM_HOST_PROPERTY = "QManagerHost";

/** * The port number where the queue manager listens. If not set, this * defaults to 1414, the default MQSeries port */
public final static String QM_PORT_PROPERTY = "QManagerPort";

/** * The name in JNDI to store this queue manager object under. * If not set, the startup class will throw an exception. */
public static final String JNDI_NAME_PROPERTY = "JNDIName";
// Required
public MQJMSStartup()
// Required, but not needed
public void setServices(T3ServicesDef services)
public String startup(String name, Hashtable args) throws Exception
String qmName = (String)args.get(QM_NAME_PROPERTY);
System.out.println("*****The qmName is "+qmName);
if (qmName == null)
throw new Exception("Startup parameter " + QM_NAME_PROPERTY + " must be set");
String jndiName = (String)args.get(JNDI_NAME_PROPERTY);
System.out.println("***The JNDI Nname is "+jndiName);
if (jndiName == null)
throw new Exception("Startup parameter " + JNDI_NAME_PROPERTY + " must be set");
String qmHost = (String)args.get(QM_HOST_PROPERTY);
System.out.println("*****The qmHost is "+qmHost);
String qmPort = (String)args.get(QM_PORT_PROPERTY);
System.out.println("*****The qmPort is "+qmPort);
MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
if (qmHost == null)
if (qmPort != null)
int portNum = Integer.parseInt(qmPort);
catch (NumberFormatException ignore)
InitialContext context = new InitialContext();
context.bind(jndiName, factory);
StringBuffer buf = new StringBuffer();
buf.append( "A connection factory was created for the MQ Queue Manager ");
buf.append(" and stored in JNDI at ");
System.out.println("*****The mqstartup is executed succesfully"+buf.toString());
return buf.toString();

The args that I pass through the weblogic console is as follows:
QManager=QM_mphasis_eight, JNDIName=MyQCF

Thanks and regards,
Milan Doshi
Doshi Milan
Ranch Hand

Joined: May 29, 2001
Posts: 112
Hello friends,
Can someone guide me how to register the queue in Weblogic JNDI. (this is with reference to my above probelem),
Thanks in advance,
Milan Doshi
Ramdas Hegde

Joined: Apr 07, 2003
Posts: 5
There are details on Bea's website at with details on how to integrate a WLS MDB with a foreign JMS provider which might give you some tips.
GeeCON Prague 2014
subject: Probelem with MDB l(on weblogic 7.0) listening to MQ (Start-up class issue )