JMS MQSeries XA transaction

Hi,
Our requirement is to integrate the enqueueing of an
MQSeries 5.1 message within an XA transaction which
will be managed by Tuxedo. The other resource involved
in the transaction will be an Oracle8i database which
will be written to by a WeblogicEnterprise Java server.
Ideally we would like to write to the queue within the
same Java server, using the JMS for MQSeries patch.
I've read that if you want to use WLE to coordinate
then the anwer is that you must use the C/C++ interfaces
to MQSeries as opposed to the Java/JMS interfaces, but I
don't know if this is (still) the case.
Has anyone tried a Java solution ?
Thanks, Conor.

Hi atheek1
Thanks for the reply, it worked. Before I mark this question as answered, pls. answer the below queries (Thanks a lot!)
1) Well, i just ticked transaction required and same transaction for response and it started working. I did not add routing options like you mentioned to QOS Exactly Once. Its working without it fine. So, my questions is what is the use of adding this QOS to exactly once. Is it mandatory?
2) I have a couple of OSB services in which rollback is working automatically (XA JMS to JCA FTP Adapter) and (XA JMS to JCA DB adapter XA data source), here rollback works automatically. I dont have to tick transaction required. So my question is, when an XA based connection factory picks a message from the queue, a transaction is started at the container level. So why tick transaction required at the message flow level, when the weblogic has already initiated a transaction. Since you said that HTTP transport commits a transaction even if 500 or 404 occurs, it makes sense to tick is transaction required and same transaction for response in OSB proxy service. But the remaining scenarios work without these options. Hence will it be wise to say that these settings are only required for HTTP transport coz of the way it behaves (commits 404 and 500).
Thanks

Similar Messages

  • JMS MQSERIES UNCOMMITTED MESSAGES

    Hi,
    I am having some problems when working with JMS over MQSeries 5.2.
    I am developing a program using JMS that tries to send messages to a MQSeries queue under unit of work. The program works rigth while the number of uncommited messages is not too high but when I try to send more tan 3000 messages the following error occurrs:
    Message: javax.jms.JMSException: MQJMS2007: failed to send message to MQ queue
    I was checking MQSeries Queue Manager configuration and I saw the maximum Number of Uncommited Messages in this Manager being this of 1000000 so the problem is not in this way. Apart of this, if a send all the messages without unit of work I do not have any trouble so far.
    Can anybody help at this point?
    Cheers

    can you post your code ?
    i am trying to send a message and i get the same error code ...
    My code is:
    import java.util.Properties;
    import javax.jms.DeliveryMode;
    import javax.jms.JMSException;
    import javax.jms.Message;
    import javax.jms.Queue;
    import javax.jms.QueueSender;
    import javax.jms.QueueSession;
    import javax.jms.TextMessage;
    import javax.jms.XAQueueConnection;
    import javax.jms.XAQueueConnectionFactory;
    import javax.jms.XAQueueSession;
    import javax.naming.Context;
    import javax.transaction.xa.XAResource;
    import org.apache.log4j.Logger;
    import es.banesto.utils.LeerProperties;
    * QSender se encarga de toda la operativa respecto al
    * envio de mensajes a colas MQ.
    public class QSender
         public static Logger log = Logger.getLogger("QSender");     
         protected String icf = "com.sun.jndi.fscontext.RefFSContextFactory";
         protected String rUrl = "file://D:/jms";
         protected String factoryName = "QCFADAPTADOR";
         protected String queueName = "INCIDENCIAS";
         private QueueSender sender = null ;
         private XAQueueConnection connection = null;
         private XAQueueSession session =      null;
         * Method leerPropiedades.
         * Lectura de los parametros de configuracion necesarios
         * @return boolean
         public boolean leerPropiedades()
              try
                   LeerProperties ref = new LeerProperties();
                   Properties props = ref.cargarArchivo("qsender.properties");
                   icf = (String) props.getProperty("icf");
                   rUrl = (String) props.getProperty("rUrl");
                   factoryName = (String) props.getProperty("factoryName");
                   return true;
              catch (Exception e)
                   log.info( "No se encontro el archivo qsender.properties");
                   log.info( e.getMessage());
              return false;
         * Method contextoQSender.
         * Determina el contexto JNDI a utilizar
         * @param colaSalida
         public void contextoQSender ( String colaSalida)
              try
                   queueName = colaSalida ;
                   Context ctx = GestorContextoJNDI.initJNDI(icf, rUrl);
                   XAQueueConnectionFactory factory =
                        (XAQueueConnectionFactory) ctx.lookup("A");
                   Queue queue = (Queue) ctx.lookup(queueName);
                   ctx.close();                         
                   this.connection = factory.createXAQueueConnection();                         
                   this.session = connection.createXAQueueSession();
                   QueueSession qsession = session.getQueueSession();
                   this.sender = qsession.createSender(queue);
              catch (JMSException e)
                   log.info ("Problema en contextoQSender ..");
                   Exception ee = e.getLinkedException();
                   log.info ( ee.getMessage());
                   log.info ("No se pudo conectar con la cola.");
                   log.info ("Revisar existencia, archivos de configuracion.");               
              catch (Exception e )
                   log.info ( e.getMessage());
                   log.info ("No se pudo conectar con la cola.");
                   log.info ("Revisar existencia, archivos de configuracion.");                              
         * Method send.
         * Envia un mensaje
         * @param p_mensaje
         public void send( String p_mensaje)
              TextMessage mensaje = null ;
              try
                   //Send messages
                   log.info ( "session.getTransacted() ->" +session.getTransacted());
                   mensaje = session.createTextMessage(p_mensaje);
    //               sender.send(mensaje,
    //                              DeliveryMode.PERSISTENT,
    //                              Message.DEFAULT_PRIORITY,
    //                              Message.DEFAULT_TIME_TO_LIVE);               
                   sender.send(mensaje);                              
                   session.commit();                              
              catch (JMSException e)
                   Exception ex = e.getLinkedException();               
                   log.info ("Error al enviar a cola :" + ex.getMessage());
                   try
                        Queue q= sender.getQueue();
                        log.fatal ("Nombre JMS de cola : " + q.getQueueName());
                   catch (JMSException ejmsx)
                        /* Nada que hacer */
                   log.fatal ("Mensaje por excepcion : ");               
                   log.fatal( e.getMessage());
                   log.info ( "El mensaje a enviar era: ");
                   log.info ("->" + p_mensaje + "<-");
              catch (Exception e)
                   try
                        session.rollback();
                   catch(JMSException ejms)
                        log.fatal ( ejms.getMessage());     
    //               log.info ("Error al enviar a cola :" );
    //               try
    //                    Queue q= sender.getQueue();
    //                    log.fatal ("Nombre JMS de cola : " + q.getQueueName());
    //               catch (JMSException ex)
    //                    /* Nada ... no se puedo resolver nombre ... */               
    //               log.fatal ("Mensaje por excepcion : ");               
    //               log.fatal( e.getMessage());
    //               log.info ( "El mensaje a enviar era: ");
    //               log.info ("->" + p_mensaje + "<-");
         * Method cerrarConexion.
         * Cierra conexion
         public void cerrarConexion ()
              try
                   if ( connection != null )
                        connection.close();
              catch (Exception e)
                   log.info("Error al cerra cola");
                   log.info (e.getMessage());
         * Method main.
         * @param args
         public static void main(String[] args)
              QSender ref = new QSender();
              ref.leerPropiedades();
              ref.contextoQSender("INCIDENCIAS");
              ref.send("hola");
         * Returns the log.
         * @return Logger
         public static Logger getLog()
              return log;
         * Returns the connection.
         * @return XAQueueConnection
         public XAQueueConnection getConnection()
              return connection;
         * Returns the factoryName.
         * @return String
         public String getFactoryName()
              return factoryName;
         * Returns the icf.
         * @return String
         public String getIcf()
              return icf;
         * Returns the queueName.
         * @return String
         public String getQueueName()
              return queueName;
         * Returns the rUrl.
         * @return String
         public String getRUrl()
              return rUrl;
         * Returns the sender.
         * @return QueueSender
         public QueueSender getSender()
              return sender;
         * Returns the session.
         * @return XAQueueSession
         public XAQueueSession getSession()
              return session;
         * Sets the log.
         * @param log The log to set
         public static void setLog(Logger log)
              QSender.log = log;
         * Sets the connection.
         * @param connection The connection to set
         public void setConnection(XAQueueConnection connection)
              this.connection = connection;
         * Sets the factoryName.
         * @param factoryName The factoryName to set
         public void setFactoryName(String factoryName)
              this.factoryName = factoryName;
         * Sets the icf.
         * @param icf The icf to set
         public void setIcf(String icf)
              this.icf = icf;
         * Sets the queueName.
         * @param queueName The queueName to set
         public void setQueueName(String queueName)
              this.queueName = queueName;
         * Sets the rUrl.
         * @param rUrl The rUrl to set
         public void setRUrl(String rUrl)
              this.rUrl = rUrl;
         * Sets the sender.
         * @param sender The sender to set
         public void setSender(QueueSender sender)
              this.sender = sender;
         * Sets the session.
         * @param session The session to set
         public void setSession(XAQueueSession session)
              this.session = session;
    [email protected]

  • WebLogic - MQSeries Classes transaction

    Hello All,
              This is not directly related with JMS, but I hope someone can give me
              a help.
              I'm using WebLogic 6.1 SP2 with MQSeries 5.2.1. I have some EJBs doing
              some database access, and putting/getting some MQSeries messages. I'm
              using MQ Classes for Java (not the JMS version). Is there any way that
              I can group all the database access and message puts/gets in the same
              transaction? I need to or do all the actions/ or do not do any action.
              Please help me.
              Thanks,
              Paulo Moreira
              

    There are white papers on the topic of using MQSeries JMS transactionally.
              The WL messaging bridge is sometimes the cleanest solution.
              Look for subject "How to use IBM MQ as a JMS Provider?" for info.
              Post to the "transaction" newsgroup to get info on getting
              the non-JMS java classes to work here,
              Tom
              Paulo Moreira wrote:
              > Hello All,
              >
              > This is not directly related with JMS, but I hope someone can give me
              > a help.
              > I'm using WebLogic 6.1 SP2 with MQSeries 5.2.1. I have some EJBs doing
              > some database access, and putting/getting some MQSeries messages. I'm
              > using MQ Classes for Java (not the JMS version). Is there any way that
              > I can group all the database access and message puts/gets in the same
              > transaction? I need to or do all the actions/ or do not do any action.
              >
              > Please help me.
              >
              > Thanks,
              >
              > Paulo Moreira
              

  • JMS and XA Transaction

              Hy,
              I see that the JMS is integrated as XA Transaction directly from the container management
              on the Weblogic version 7.0.
              I test the same testcase on the Weblogic 6.0 but it didn't work automatically (the
              publish never commit).
              Starting from wich version of Weblogic the JMS-XA Transaction is integrated ?
              Thank you.
              Luigi
              

              Hy,
              I see that the JMS is integrated as XA Transaction directly from the container management
              on the Weblogic version 7.0.
              I test the same testcase on the Weblogic 6.0 but it didn't work automatically (the
              publish never commit).
              Starting from wich version of Weblogic the JMS-XA Transaction is integrated ?
              Thank you.
              Luigi
              

  • OSB JMS Proxy XA Transaction Rollback not occuring to queue

    Hi All
    We are dequeuing a message from JMS queue via an XA connection factory and then calling a web service. If any error occurs in the web service we catch the error handler, log and notify it and want to send this message back to the queue for retrial (The retry settings are defined at the Queue Level from weblogic console).
    Problem is rollback is not occurring, we have tried the below:
    1) There is no OSB reply with either success or failure in the error handler (This should have done the trick)
    2) We have also tried addiing an explicit Raise Error (Uncaught Error) to roll the message back, but its not working.
    This rollback is not occurring because JMS Resource is XA and web service call is NON XA, hence the entire message flow becomes NON XA. Is this understanding correct?
    How can we fix this? Please help

    Hi atheek1
    Thanks for the reply, it worked. Before I mark this question as answered, pls. answer the below queries (Thanks a lot!)
    1) Well, i just ticked transaction required and same transaction for response and it started working. I did not add routing options like you mentioned to QOS Exactly Once. Its working without it fine. So, my questions is what is the use of adding this QOS to exactly once. Is it mandatory?
    2) I have a couple of OSB services in which rollback is working automatically (XA JMS to JCA FTP Adapter) and (XA JMS to JCA DB adapter XA data source), here rollback works automatically. I dont have to tick transaction required. So my question is, when an XA based connection factory picks a message from the queue, a transaction is started at the container level. So why tick transaction required at the message flow level, when the weblogic has already initiated a transaction. Since you said that HTTP transport commits a transaction even if 500 or 404 occurs, it makes sense to tick is transaction required and same transaction for response in OSB proxy service. But the remaining scenarios work without these options. Hence will it be wise to say that these settings are only required for HTTP transport coz of the way it behaves (commits 404 and 500).
    Thanks

  • JDBC, JMS and EJB transactions - possible problem?

    Hello,
              I am using Oracle 9, Weblogic 8.1 SP 4, MyEclipse and
              XDoclet.
              In my current project I have the following piece of code
              in one of my message driven beans (code cited as pseudocode
              without unnecessary details):
              * @ejb.bean name="MyMessageProcessor"
              * display-name="Display name for a MyMessageProcessor"
              * jndi-name="ejb/MyMessageProcessor"
              * description="Bean MyMessageProcessor"
              * destination-type="javax.jms.Queue"
              * transaction-type="Container"
              * acknowledge-mode="Auto-acknowledge"
              * subscription-durability="Durable"
              * generate="false"
              * @ejb.transaction type="Required"
              public class MyMessageProcessor implements MessageDrivenBean, MessageListener {
              public void onMessage(Message msg) {
                   try {
                        //obtaining connections to two different databases via JNDi
                        java.sql.Connection connOne =
                        ((DataSource)ctx.lookup("DataSourceOne")).getConnection();          
                        java.sql.Connection connTwo =
                             ((DataSource)ctx.lookup("DataSourceTwo")).getConnection();
                        // performing some UPDATEs and INSERTs on connOne and connTwo
                        // calling some other methods of this bean
                        //creating the reply JMS message and sending it to another JMS queue
                        Message msgTwo = this.createReplyMessage(msg)
                        this.queueSender.send(msgTwo);
                        //commiting everything
                        this.queueSession.commit();          
                   } catch (Exception ex) {
                   try {
                        if (this.queueSession!=null) this.queueSession.rollback();
                   } catch (JMSException JMSEx) {};     
                   this.context.setRollbackOnly();
              Some days ago (before the final remarks from my client) there used to be only one DataSource configurated on the basis of the
              connection pool with non-XA jdbc driver. Everything worked fine
              including the transactions (if anything wrong happend not only wasn't the replymessage sent, but also no changes were written
              to database and the incomming message was thrown back to the my bean's
              queue).
              When I deployed the second DataSource I was informed by an error message, that only one non-transactional resource may
              participate in a global transaction. When I changed both datasources
              to depend on underlying datasources with transatcional (XA) jdbc drivers, everything stopped working. Even if
              EJB transaction was theoretically successfully rolledbacked, the changed were written to the database
              and the JMS message wasn't resent to the JMS queue.
              So here are my questions:
                   1. How to configure connection pools to work in such situations? What JDBC drivers should I choose?
                   Are there any global server configurations, which may influence this situation?
                   2. Which jdbc drivers should I choose so that the container was able to rollback the database transactions
                   (of course, if necessary)?
                   3. Are there any JMS Queue settings, which would disable the container to send message back to the
                   queue in case of setRollbackOnly()? How should be the Queue configurated?
              As I am new to the topic and the deadline for the project seems to be too close I would be grateful
              for any help.
              This message was sent to EJB list and JDBC list.
              Sincerely yours,
              Marcin Zakidalski

    Hi,
              I found these information extremely useful and helpful.
              The seperate transaction for sending messages was, of course, unintentional. Thanks a lot.
              Anyway, I still have some problems. I have made some changes to the
              code cited in my previous mail. These changes included changing QueueSessions
              to non-transactional. I also set the "Honorate global transactions" to true.
              I am using XA JDBC driver. After setting "Enable local transactions" to false
              (I did it, because I assume that JDBC transactions should be part on the global
              EJB transaction) I got the following error:
              java.sql.SQLException: SQL operations are not allowed with no global transaction by default for XA drivers. If the XA
              driver supports performing SQL operations with no global transaction, explicitly allow it by setting
              "SupportsLocalTransaction" JDBC connection pool property to true. In this case, also remember to complete the local
              transaction before using the connection again for global transaction, else a XAER_OUTSIDE XAException may result. To
              complete a local transaction, you can either set auto commit to true or call Connection.commit() or Connection.rollback().
              I have also inspected the calls of methods of bean inside of onMessage() method just to check, whether
              the transactions are correctly initialized (using the weblogic.transaction.Transaction class).
              My questions are as follows:
              1. Any suggestions how to solve it? I have gone through the google answers on that problem and only
              thing I managed to realize that JDBC must start its own transaction. Is there any way to prohibit it
              from doing that? Can using setAutocommit(true/false) change the situation for better?
              2. How to encourage the JDBC driver to be a part of EJB transaction?
              3. As I have noticed each of ejb method has its own transactions (transactions have different
              Xid). Each method of the bean has "required" transaction attribute. Shouldn't it work in such
              way that if already started transaction exists it is used by the called method?
              4. The DataSources are obtained in my application via JNDI and in the destination environment I will have slight
              impact on the configuration of WebLogic. What is least problematic and most common WebLogic configuration which would
              enable JDBC driver to participate in the EJB transaction? Is it the WebLogic configuration problem or can it be
              solved programmically?
              Currently my module works quite fine when "enable local transactions" for DataSources is set to true, but this way
              I am loosing the ability to perform all actions in one transaction.
              Any suggestions / hints are more than welcomed. This message was posted to jdbc list and ejb list.
              Marcin

  • JMS, MQSeries, R/3 Link, NT and AIX...

    Hi all,
    To put you in situation, I have a java application which can run from any type of OS as of now. It sends documents to a queue (IDOCS) and those documents are then sent to SAP by an R/3 Link adapter. Using native binding and running the java application on the same computer as the QueueManager (AIX) it was all working fine.
    Now, I have translated my app to use JMS instead and tried to run it on my Windows 2000 PC. The message are sent allrigth to the queue, but R/3 Link is now giving me a handfull of errors, complaining about conversion, character sets and things like that.
    Here is a sample of errors I get:
    02/18/03 17:00:39 SMQ4165: Warning on MQGET from inbound queue. Reason code 2110.
    EXPLANATION: The attempt to get a message from the inbound message queue returned a warning. The warning code was 2110. The message will be passed to the use
    r exit if one has been specified. If no exit was specified, the message will be passed to the bad message queue. If no bad message queue was specified, the
    message will be left on the inbound queue, and the server will terminate.
    ACTION: None.
    02/18/03 17:00:39 SMQ4192: A data conversion problem occurred on the MQGET. Attempting to process message.
    EXPLANATION: A warning was issued because the message needs codepage conversion, but the message is either not in MQSTR format, or a user-defined data- conver
    sion exit call failed.
    ACTION: Ensure that incoming messages from machines with a different code page, are in MQSTR format or that there is a user exit defined to convert messages i
    n other formats.
    02/18/03 17:00:40 SMQ4167: IDoc has an invalid structure version. IDoc value="16777216". Expected value="1".
    EXPLANATION: The value of the version field in the IDoc header structure contains an invalid value.
    ACTION: Ensure that the IDoc message starts with a valid version of the Saplink header structure (MQSAPH).
    02/18/03 17:00:40 SMQ4191: A message was put to the bad message queue. Bad message type 1, reason 4108.
    EXPLANATION: The message was not in a valid IDoc format. The bad message type is 1 and the bad message reason is 4108.
    ACTION: Check the bad message reason code in the bad message header of the message. Attempt to correct the error and send the message again.
    I finally set the CCSID to 819 in the connection string, now I suspect that my problem is related to the encoding I use but I can't find what to set it to instead. I write everything in a ByteMessage by the way, just as I was doing it with the native bindings.
    Does anyone know how I am supposed to set this up? What encoding type should I set it to? Is the CCSID correct? previously, I was setting the format this way: bytesMessage.format = "MQHSAP ";
    But using JMS, there is no such property so I tried to just write it to the ByteMessage, not sure this works either...
    Thanks in advance,
    Daniel
    If it can be of any help, here is a code fragment of what I am doing:
    using native binding, which was working fine
    //Add the mandatory R3/Link header to our message
    bytesMessage.writeBytes("SAPH");
    bytesMessage.writeInt(1);
    bytesMessage.writeInt(108);
    bytesMessage.writeInt(273);
    bytesMessage.writeInt(819);
    bytesMessage.writeBytes("MQSTR ");
    for(int i = 28; i < 108; i++)
    bytesMessage.writeByte(32);
    bytesMessage.writeBytes(textMessage);
    bytesMessage.encoding = MQC.MQENC_INTEGER_NORMAL;
    bytesMessage.format = "MQHSAP ";
    And using JMS:
    //Test code
    queue = session.createQueue("queue://" + manager + "/" + name + "?priority=5&persistence=2&targetClient=1&encoding=" +
    MQC.MQENC_INTEGER_REVERSED + "&CCSID=819");
    //Add the mandatory R3/Link header to our message
    bytesMessage.writeBytes("SAPH".getBytes());
    bytesMessage.writeInt(1);
    bytesMessage.writeInt(108);
    bytesMessage.writeInt(273);
    bytesMessage.writeInt(819);
    bytesMessage.writeBytes("MQSTR ".getBytes());
    StringBuffer padding = new StringBuffer(80);
    for(int i = 28; i < 108; i++)
    padding.append(" ");
    bytesMessage.writeBytes(padding.toString().getBytes());
    bytesMessage.writeBytes("MQHSAP ".getBytes());
    bytesMessage.writeBytes(textMessage.getBytes());
    queueSender.send(bytesMessage);

    Hi There,
    I know you used JMS and Link for R/3.
    Now I am doing the same but I am getting the same problem besides I am doing what you mention in the forum.
    Can you give me a hand to fix this?
    I have configured and MQSeries under win2003 and in the same machine a Link 4 R/3. I have a Java app using a .bindings file to connect to the Q and send a message the same way you did, but i am getting this error:
    IDoc has an invalid structure header. IDoc value="RFH ". Expected value="SAPH".
    IDoc has an invalid structure version. IDoc value="2". Expected value="1".
    IDoc has an invalid system number. IDoc value=<T.
    IDoc has an invalid client. IDoc value=�Y&#9830;.
    IDoc has an invalid language. IDoc value=.
    A message was put to the bad message queue. Bad message type 1, reason 4110.
    It seems as if the all the JMS headers are at the begining of the msg and it always throw the same error. it doesn't matter what data I put in the bytesMessage.
    I would really appreciate your help.
    Here a portion code of my SendMessage operation.
         public String EnviarMsg(String Msg) throws JMSException {
              String resp = null;
              try {
                   if (getQueueSend() == null) {
                        // Create un objeto QueueSender como productor del mensaje.
                        setQueueSend(QSess.createSender(MQueue));
                        // Crear y enviar un mensaje a la cola.
                   * Aqui viene codigo para enviar msgs a la cola en formato SAP
                   txtMsg = QSess.createBytesMessage();
                   txtMsg.writeBytes("SAPH".getBytes());
                   txtMsg.writeInt(1);
                   txtMsg.writeInt(108);
                   txtMsg.writeInt(273);
                   txtMsg.writeInt(819);
                   txtMsg.writeBytes("MQSTR ".getBytes());
                   byte b = 32;
                   for(int i=28; i<108; i++)
                        txtMsg.writeByte(b);
                   txtMsg.writeBytes(Msg.getBytes());
                   //txtMsg.encoding = MQC.MQENC_INTEGER_NORMAL;
                   txtMsg.setStringProperty("JMS_IBM_Format", "MQHSAP ");
                   //txtMsg.setText(Msg);
                   // QueueSend.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
                   // QueueSend.setTimeToLive(30000);Funciona. Probado con el MQSeries
                   // 6.0
                   QueueSend.send(txtMsg);
                   resp = "OK";

  • JMS, MQSeries 5.2 and Websphere 4.0.2

    How to configuring the WebSphere to work with MQSeries, Does anybody know how to do it.

    I am getting the following Exception when trying ti run JMSAdmin with
    INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory
    PROVIDER_URL=IIOP://localhost:900/
    I Have websphere Advanced Single Server Edition
    01:39:01 [1019853541907] [P=533785:O=0:CT] com.ibm.mq.jms.admin.AdminService@690726 initJNDI() javax.naming.ServiceUnavailableException exception caught: NULL returned when resolving initial reference=NameService
    javax.naming.ServiceUnavailableException: NULL returned when resolving initial reference=NameService
         at com.ibm.ws.naming.util.WsnInitCtxFactory.getCosRootContext(WsnInitCtxFactory.java:476)
         at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:361)
         at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:227)
         at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:98)
         at com.ibm.ws.naming.util.WsnInitCtx.<init>(WsnInitCtx.java:79)
         at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContext(WsnInitCtxFactory.java:135)
         at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:80)
         at com.ibm.ejs.ns.jndi.CNInitialContextFactory.getInitialContext(CNInitialContextFactory.java:68)
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at com.ibm.mq.jms.admin.AdminService.initJNDI(AdminService.java:192)
         at com.ibm.mq.jms.admin.JMSAdmin.<init>(JMSAdmin.java:126)
         at com.ibm.mq.jms.admin.JMSAdmin.main(JMSAdmin.java:1176)

  • JMS-MQSeries without J2EE

    Hi,
    I tried to compile the SimpleTopicPublisher and SimpleTopicSubscriber from the following link. I used the javax.jms.jar and the jms.jar from sun.
    http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/client.html#1027256
    The code got compiled.
    I had a queue in MQSeries, its sample queue called postcard.
    When I tried running SimplePublisherTopic, the following exception was thrown:
    <code>
    D:\>java SimpleTopicPublisher postcard 1
    Topic name is postcard
    JNDI API lookup failed: javax.naming.NoInitialContextException: Need to specify
    class name in environment or system property, or as an applet parameter, or in a
    n application resource file: java.naming.factory.initial
    javax.naming.NoInitialContextException: Need to specify class name in environmen
    t or system property, or as an applet parameter, or in an application resource f
    ile: java.naming.factory.initial
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
    43)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:283)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at SimpleTopicPublisher.main(SimpleTopicPublisher.java:60)
    </code>
    The program is J2EE server independent. The MQSeries for Win 2000 is used for JMS services.
    Please help me in understanding the following :
    1) How to get the JNDI server running and registering our topic there?
    2) There was no reference of 'Topic' in MQSeries. There are only 'Queue'. If this is the case, how to create topics in MQSeries.
    3) Who are providers? There are JNDI provider and IBMMQSeries provider. What is to be used? Can they both be used?
    4) MQSeries has a Java API. Is it a replacement/substitute for Sun JMS API? Which should we use to write a generic JMS code?
    Thanks in advance,
    Rajesh

    I could solve some of the exceptions based on Steve's suggestions. I am giving below on how I solved.
    "JNDI API lookup failed: javax.naming.NoInitialContextException: "
    The SimpleTopicPublisher has set env property for InitialContext and expects our System's properties to specify the provider URL. I have added the property this way in code:
              try {
                   // Identify service provider to use
                   Hashtable env = new Hashtable(11);
                   env.put(Context.INITIAL_CONTEXT_FACTORY,
                                 "com.sun.jndi.fscontext.RefFSContextFactory");
                   env.put(Context.PROVIDER_URL,
                                 "file:/C:/Program Files/IBM/MQSeries/Java/lib");
                   jndiContext = new InitialContext(env);
              } catch (NamingException e) {
                        System.out.println("Could not create JNDI API " +
                             "context: " + e.toString());
                        e.printStackTrace();
                        System.exit(1);
              }1) How to get the JNDI server running and registering our topic there?
    Unlike RMI Naming server/registry, JNDI is a standard API for naming services. Hence it is not designed as a server listening on a port. I understand the File System based name space. The bindings of key-value is maintained in .bindings file in the place you specify as a PROVIDER_URL. Both publisher and subscriber has to refer this name space. This is how you start registering and retrieving MQ objects.
    3) Who are providers? There are JNDI provider and IBMMQSeries provider. What is to be used? Can they both be used?
    Providers are vendors who have implemented javax.naming.Spi package. The default provider you get from Sun is one reference implementation. It is "com.sun.jndi.fscontext.RefFSContextFactory". There is no IBM MQSeries provider. The same "com.sun.jndi.fscontext.RefFSContextFactory" is only supplied with MQSeries also.
    I don't know the answers for questions 2 and 4. I shall post it as soon as I understand.
    Those of you who read this, if you find deviation from righteouness, please correct.
    Thanks/Regards,
    Rajesh

  • Foreign JMS, MQSeries

    Hi,
              I am configuring Foreign JMS in weblogic 8.1.4 to communicate with MQSeries,
              and got following error when weblogic was started. When I configured JMS,
              just copied binding file to local direcotry (Windows XP professional) and
              confiured the the node <provider-url>file:/D:/jndi/</provider-url> in
              weblogic-ejb-jar.xml. I din't find any error when setup Foreign JMS server
              from weblogic console. But there is no class was bound to the desctination
              and facotry jndi in weblogic jndi tree. How I can bound the class object to
              destination and factory jndi.
              ####<Jan 20, 2006 7:40:12 PM CST> <Warning> <EJB> <wwhq728h> <marsJms>
              <ExecuteThread: '14' for queue: 'weblogic.kernel.Default'> <<WLS Kernel>> <>
              <BEA-010061> <The Message-Driven EJB: SubscriberBean is unable to connect to
              the JMS destination: com.xxx.jms.subscriber.destination. The Error was:
              [EJB:011010]The JMS destination with the JNDI name:
              com.xxx.jms.subscriber.destination 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.>
              Thanks in advance for any idea.
              James

    Hi,
              I am configuring Foreign JMS in weblogic 8.1.4 to communicate with MQSeries,
              and got following error when weblogic was started. When I configured JMS,
              just copied binding file to local direcotry (Windows XP professional) and
              confiured the the node <provider-url>file:/D:/jndi/</provider-url> in
              weblogic-ejb-jar.xml. I din't find any error when setup Foreign JMS server
              from weblogic console. But there is no class was bound to the desctination
              and facotry jndi in weblogic jndi tree. How I can bound the class object to
              destination and factory jndi.
              ####<Jan 20, 2006 7:40:12 PM CST> <Warning> <EJB> <wwhq728h> <marsJms>
              <ExecuteThread: '14' for queue: 'weblogic.kernel.Default'> <<WLS Kernel>> <>
              <BEA-010061> <The Message-Driven EJB: SubscriberBean is unable to connect to
              the JMS destination: com.xxx.jms.subscriber.destination. The Error was:
              [EJB:011010]The JMS destination with the JNDI name:
              com.xxx.jms.subscriber.destination 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.>
              Thanks in advance for any idea.
              James

  • Foreign JMS and Enlisting Transactions?

    I'm working on implementing an XA interface layer to an implementation of a foreign JMS provider and am having a problem with enlisting XA transactions in WebLogic.
              I implemented a simple JNDI that stores and retrieves serialized versions of classes in the local filesystem.
              I create an XATopicConnectionFactory named ambxatcf and a Topic named ChatterTopic and store them in there.
              The XATopicConnection implements XAConnection.
              I put a client jar in bea/weblogic91/samples/domains/wl_server/lib/ which contains the JNDI code and all of my XA classes which call the JMS.
              That gets picked up by the server on startup.
              In the Web Logic Admin Console:
              I create a Foreign Server under JMS Modules, ambrosiaServer.
              I set the JNDI Initial Context Factory set to my JNDI InitialContext class and the JNDI Properties is the path to my JNDI filestore so that it can find the serialized objects.
              I create a Foreign Destination in this server which has a Local JNDI Name: Chatter and Remote JNDI Name: ChatterTopic
              And then also in this server, I create a Foreign Connection Factory, Local JNDI Name: ambxatcf and Remote JNDI Name: XATopicConnectionFactory.
              Then in Deployments, I Install the jar containing my bean and Start it.
              Then I run the client and the bean prints out the XATopicConnectionFactory and it's the one that came out my JNDI.
              I have messages in my XATopicConnectionFactory, XATopicConnection and XATopicSession code so I know they're getting called.
              What's not getting called is XATopicSession.getXAResource() or my XAResourceImpl.start() or XAResourceImpl.commit().
              This happens whether I have the bean set up for bean managed or container managed transactions.
              I'm testing against WebLogic 9.1.
              Thanks,
              Don Hermes

    Hi Tom,
              Thank you for your response.
              I saw the article in the 8.1 documentation but I also found the following in the 9.1 docs.
              So, I assumed it would work.
              Was that assumption wrong?
              Thanks,
              Don
              =====================
              http://e-docs.bea.com/wls/docs91/jms/j2ee.html
              Automatically Enlisting Transactions
              This feature works for either WebLogic JMS implementations or for third-party JMS providers that support two-phase commit transactions (XA protocol). If a wrapped JMS connection sends or receives a message inside a transaction context, the JMS session being used to send or receive the message is automatically enlisted in the transaction through the XA capabilities of the JMS provider. This is the case whether the transaction was started implicitly because the JMS code was invoked inside an EJB with container-managed transactions enabled, or whether the transaction was started manually using the UserTransaction interface in a servlet or an EJB that supports bean-managed transactions.

  • JMS MQSeries Communication.

    I am new to JMS and struggling to understand how JMS communicates with MQSeries. I have MQSeries running on Sun Solaris and trying to write a JMS client on Win-2000. I have Suns's J2EE application server 8.0 running on the Win-2000 box. Here are my questions:
    1. Do I need an LDAP server for this?
    2. If answer to the first question is yes: Is LDAP server part of Sun's J2EE Application Server 8.0 or I need to have it seperate?
    3. Does anyone know of a free LDAP server available for download?
    4. How are LDAP server and the application server work together to locate and post message on MQSeries queue?
    5. Do I need to have a special setup on the MQ Server side to support JMS?
    Any help will be appreciated. I am desperate to find these answers.
    - Pankaj

    Hi Sharma,
    1. With SUN AS you can use File Store instead of LDAP to store objects (the same is probably true for MQSeries).
    This sample frorm SUN Message Queue SP1 show how to use the file store:
    D:\Program Files\Sun\MessageQueue3\demo\helloworld\helloworldmessagejndi.java
    2. I think it is a separate product: Sun Java System Directory Server Enterprise Edition
    3. http://www.openldap.org/
    4. I think the LDAP server is only used as an Object Store for Connection Factories and Destinations, and the messages are stored by the JMS provider in the application server.
    It is used by JNDI to lookup those objects.
    Check if MQSeries also supports JMS 1.1 as SUN AS 8 does.
    Regards,
    Magnus Strand

  • JMS BC & BPEL Transaction Scope

    Hi,
    I'm trying to use Open ESB with BPEL SE JMS BC and HTTP BC to create a store and forward layer in a integration architecture. The idea is that messages that are used to update a slow external system (or one that is often down) are put in a JMS queue and then the JMS BC picks them up and passes them to a BPEL process via NMR. The BPEL process then calls the external system. If the external system is down, or some other system related error occurs, then I want the transaction to roll back andthe message remain on the queue to be retried later.
    My issue is that when the JMS BC picks up the message, it sends it to BPEL via NMR and as soon as it gets the "Done" response, it commits the associated XA transaction and the message is permanently off the JMS queue. But the "done" response is sent by the BPEL SE as soon as it gets the message, as opposed to only once it has called the external system successfully. This breaks the model as any failures are not retried... Is there a way around this? Am I doing something wrong? How can I get the transaction context to span the entire call flow from JMS BC to BPEL and back with failures resulting in the message remaining in the JMS queue to be retried later
    Thanks
    Paul

    Paul,
    The reason for the current behavior of BPEL SE (sending DONE as soon as reeve completes) is by design to support asynchronous message communications and long running processes. We do not want to keep the transaction open for the life of process instance as the transaction may timeout (for long running processes). If you want to override this behavior you can do so by setting the Business Process as Atomic (Atomic attribute of business process as true), but the effect of this would be that all the operations in bpel engine and also outbound invocations would use the same (received) transaction context. Note that some of these features are still under development. I understand that this still might not solve your use case where the best solution would be reties. This work is underway and should be available in next release.
    Just to give you heads up; retry support is being provided as part of Systemic Qualities initiative which is underway and is targeted to provide support like wire qualities (throttling/reties), fault and security propagation among others across open-esb components. The particular solution to you interest would be wire quality initiative. Once implemented this would allow configurable number of reties a specified intervals.
    Regards,
    Malkit

  • Sync Proxy to JMS (MQSeries)

    Hi All,
    I have a scenario of Sync proxy to MQSeries.
    Now suppose my MQ Series takes a long time to respond with the reply, then how do i handle such a situation as i dont want my proxy to be waiting for the reply (say for more than 2 min).
    I dont want it to timeout but instead i need a reply sent back to my proxy informing MQ series took more time to respond back.
    Suggestion wud be appreciated !!!!
    ShaBZ~~~

    Hi,
    use sync bridge
    <b>receive step</b> - sync receive
    <b>send step</b> - sync to jms
    wrap it in a timeout branch (in block) and in the exception
    branch of this you can create a mapping
    with text "it took more time then expected"
    after the timeout time the message will
    go to the exception branch and
    map the outbput message with the text
    <b>send step</b> to close the sync brigde
    one way to do it:)
    Regards,
    michal

  • JMS and JDBC Transaction

    I have recently tried using the JMS interface for AQ and I have discovered that the queue connection is a separate JDBC connection even if you create a queue connection using an OracleConnection. Is there a workaround for this? It seems a bit strange to have two connections open to the database and be forced to use an XA session in order to get the commits synchronized. Any ideas ? Below is some sample code I am using:
    queueConnection = AQjmsQueueConnectionFactory.createQueueConnection((OracleConnection)connection);
    queueConnection.start();
    QueueSession queueSession = queueConnection.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);
    AQjmsSession aqs = (AQjmsSession)queueSession;
    Queue queue = aqs.getQueue("TEST_SCHEMA", "TEST_QUEUE");

    Hello,
    What version are you using of the jar files? What version of the database are you using?
    From what I recall the example in <Note:301434.1> successfully reused an existing JDBC connection.
    I would be interested to see a more complete code example if this is not helpful.
    Thanks
    Peter

Maybe you are looking for

  • Mid 2010 macbook pro panic shutdown

    My mid 2010 Macbook pro is experiencing an increasing number of black screen shut downs.. 3 or 4 a day currently. Often this occurs when the keyboard or mouse is touched after it has been idle for a short period, and sometimes mid use. Ive tried runn

  • Problems with applets in IE

    When i try to make my applet work in internet explorer it just comes up with a blank grey box and an error message saying: load: class classname not found Does anyone know how i can correct this?

  • Client sends cyrillic in SOAP request, but the characters are corrupt

    Inbound call with cyrillic characters does not handle the cyrillic characters correctly Problem Description We receive in an OSB proxy SOAP service a request with data that contain cyrillic characters. The message is sent correctly by the cliend but

  • Airport No Extended Network

    I have an Airport Extreme and Express nseries that will not extend properly. the express says it extends bit the signal is about the same as the extreme (26%)

  • My phone no serivce

    hello ihpne4 my phone. when i put my sim care it sow no service pleas help with this