|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQJMS2005: failed to create MQQueueM |
« View previous topic :: View next topic » |
Author |
Message
|
Itchy |
Posted: Tue Mar 18, 2003 7:29 pm Post subject: MQJMS2005: failed to create MQQueueM |
|
|
Newbie
Joined: 16 Mar 2003 Posts: 8
|
hi,
I am getting this error -
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for ''
When I run my following servlet code on WAS v4.0.3 using MQSeries v5.2 and MA88. (Win 2K)
import javax.servlet.*;
import javax.servlet.http.*;
import javax.jms.*;
import com.ibm.mq.jms.*;
import javax.naming.*;
import java.util.Hashtable;
public
class SendMQJMSMessage extends HttpServlet {
public final String JNDI_FACTORY="com.ibm.ejs.ns.jndi.CNInitialContextFactory";
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException
{
try{
InitialContext ctx = new InitialContext();
Context env = (Context)ctx.lookup("java:comp/env");
QueueConnectionFactory qcf = (QueueConnectionFactory)env.lookup("myQCF");
QueueConnection qc = qcf.createQueueConnection();
QueueSession session = qc.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
Queue q = (Queue)ctx.lookup("myQ");
QueueSender sender = session.createSender(q);
Message message = (Message)session.createTextMessage("Test Message 11212");
sender.send(message);
}catch(NamingException ne){
ne.printStackTrace();
}catch(JMSException jmse){
jmse.printStackTrace();
}
}
public InitialContext getInitialContext(String str) throws NamingException{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
env.put(Context.PROVIDER_URL, str);
return new InitialContext(env);
}
}
Let me know where I am wrong?
My default queue manager is up and running.
Thanks in advance.
regards.
Itchy. |
|
Back to top |
|
 |
EddieA |
Posted: Thu Mar 20, 2003 5:10 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Extract the 'Linked Exception' from the JMSException. That will give you the MQSeries Completion and Reason codes. They should help to pin-point the problem.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
nimconsult |
Posted: Thu Mar 20, 2003 11:43 pm Post subject: |
|
|
 Master
Joined: 22 May 2002 Posts: 268 Location: NIMCONSULT - Belgium
|
Follow the advice of EddieA
Check that you have a default queue manager (apparently the application connects with an empty queue manager)
A usual problem on AIX is the segment 8 problem. Execute:
Code: |
export LDR_CNTRL=MAXDATA=0x30000000 |
before starting the java virtual machine and see if it works (do not run other application with this variable set, in particular, do not run MQ Series commands). _________________ Nicolas Maréchal
Senior Architect - Partner
NIMCONSULT Software Architecture Services (Belgium)
http://www.nimconsult.be |
|
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
|
|
|
|