MDB using MQ gets InvalidDestinationException - Weblogic

This is a discussion on MDB using MQ gets InvalidDestinationException - Weblogic ; Environment: Windows XP BEA 8.1 SP2 (direct upgrade to SP2, never used SP1 on this machine) Websphere MQ 5.3 Startup class defined MQConnectionFactory and MQQueue in JNDI, as per BEA white-paper. MDB references this queue and simply prints the message ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: MDB using MQ gets InvalidDestinationException

  1. MDB using MQ gets InvalidDestinationException


    Environment:
    Windows XP
    BEA 8.1 SP2 (direct upgrade to SP2, never used SP1 on this machine)
    Websphere MQ 5.3

    Startup class defined MQConnectionFactory and MQQueue in JNDI, as per BEA white-paper.
    MDB references this queue and simply prints the message content to console.
    MDB created using BEA Workshop.

    At Server Startup the startup class runs OK.
    When the MDB is deployed it reports the error below.

    Native Queue works for get and put.
    JMS Queue access from outside the BEA environment works for get and put.
    Within the BEA managed-server the objects defined in JNDI are also OK, I know
    this because I changed the startup class to test the newly defined ConnectionFactory
    and Queue from BEA's JNDI tree to read the queue contents, which all worked fine.

    Exactly the same application and startup class worked fine on Windows2000 with
    BEA 8.1 SP1 and MQ 5.3 - I copied the "start" script and classes from the old
    machine to the new one and have always had this problem.

    I have been searching on and off for about a week and there is no detailed message
    anywhere to help and I think it could either be a MDB or a Workshop issue.

    HELP!!!

    ===============================
    <20-Apr-2004 08:43:55 o'clock CEST> WebLogic Admin Server "cgServer" for domain "mdb">
    *** com.XXXXX.msg.MQJMSStartup Using BINDINGS mode
    *** com.XXXXX.msg.MQJMSStartup : JNDI QCF being used - START
    *** com.XXXXX.msg.MQJMSStartup : QueueConnectionFactory from JNDI
    *** com.XXXXX.msg.MQJMSStartup : QueueConnection
    *** com.XXXXX.msg.MQJMSStartup : QueueSession
    *** com.XXXXX.msg.MQJMSStartup : Queue from JNDI
    *** com.XXXXX.msg.MQJMSStartup : QueueReceiver
    *** com.XXXXX.msg.MQJMSStartup : MessageListener
    *** com.XXXXX.msg.MQJMSStartup : Set MessageListener on
    *** com.XXXXX.msg.MQJMSStartup : JNDI QCF being used - STOP
    *** com.XXXXX.msg.MQJMSStartup : START
    A connection factory has been created for the MQ Queue Manager 'QM2_1414' running
    remotely on host 'localhost' listening on port '1414' and stored in JNDI at 'q
    m_qm2_connfactory'
    A queue object has been created for the MQ Queue 'QM1.APP1.TO.QM2.APP2' and stored
    in JNDI at 'incoming'*** com.XXXXX.msg.MQJMSStartup : END
    <20-Apr-2004 08:44:03 o'clock CEST> EJB: NewMdb is unable to connect to the JMS destination: incoming. The Erro
    r was:
    weblogic.jms.common.InvalidDestinationException: Foreign destination, queue://QM2_1414/QM1.APP1.TO.QM2.APP2


  2. Re: MDB using MQ gets InvalidDestinationException

    Hi,

    The MDB must be configured to use the foreign connection
    factory in addition to the foreign destination. Currently,
    your MDB is using a WL connection factory so, in effect,
    the MDB trypassing a MQ destination to a WL JMS client.

    But keep in mind that in most cases in 8.1 a startup class
    is no longer required, as the 8.1 foreign destination
    wrapper does the work for you. (The white-paper you are
    using is out-of-date as it does not take into consideration
    8.1 features.)

    I'm attaching a mini-FAQ on this issue.

    Tom

    KSS wrote:
    > Environment:
    > Windows XP
    > BEA 8.1 SP2 (direct upgrade to SP2, never used SP1 on this machine)
    > Websphere MQ 5.3
    >
    > Startup class defined MQConnectionFactory and MQQueue in JNDI, as per BEA white-paper.
    > MDB references this queue and simply prints the message content to console.
    > MDB created using BEA Workshop.
    >
    > At Server Startup the startup class runs OK.
    > When the MDB is deployed it reports the error below.
    >
    > Native Queue works for get and put.
    > JMS Queue access from outside the BEA environment works for get and put.
    > Within the BEA managed-server the objects defined in JNDI are also OK, I know
    > this because I changed the startup class to test the newly defined ConnectionFactory
    > and Queue from BEA's JNDI tree to read the queue contents, which all worked fine.
    >
    > Exactly the same application and startup class worked fine on Windows2000 with
    > BEA 8.1 SP1 and MQ 5.3 - I copied the "start" script and classes from the old
    > machine to the new one and have always had this problem.
    >
    > I have been searching on and off for about a week and there is no detailed message
    > anywhere to help and I think it could either be a MDB or a Workshop issue.
    >
    > HELP!!!
    >
    > ===============================
    > <20-Apr-2004 08:43:55 o'clock CEST> > WebLogic Admin Server "cgServer" for domain "mdb">
    > *** com.XXXXX.msg.MQJMSStartup Using BINDINGS mode
    > *** com.XXXXX.msg.MQJMSStartup : JNDI QCF being used - START
    > *** com.XXXXX.msg.MQJMSStartup : QueueConnectionFactory from JNDI
    > *** com.XXXXX.msg.MQJMSStartup : QueueConnection
    > *** com.XXXXX.msg.MQJMSStartup : QueueSession
    > *** com.XXXXX.msg.MQJMSStartup : Queue from JNDI
    > *** com.XXXXX.msg.MQJMSStartup : QueueReceiver
    > *** com.XXXXX.msg.MQJMSStartup : MessageListener
    > *** com.XXXXX.msg.MQJMSStartup : Set MessageListener on
    > *** com.XXXXX.msg.MQJMSStartup : JNDI QCF being used - STOP
    > *** com.XXXXX.msg.MQJMSStartup : START
    > A connection factory has been created for the MQ Queue Manager 'QM2_1414' running
    > remotely on host 'localhost' listening on port '1414' and stored in JNDI at 'q
    > m_qm2_connfactory'
    > A queue object has been created for the MQ Queue 'QM1.APP1.TO.QM2.APP2' and stored
    > in JNDI at 'incoming'*** com.XXXXX.msg.MQJMSStartup : END
    > <20-Apr-2004 08:44:03 o'clock CEST> > EJB: NewMdb is unable to connect to the JMS destination: incoming. The Erro
    > r was:
    > weblogic.jms.common.InvalidDestinationException: Foreign destination, queue://QM2_1414/QM1.APP1.TO.QM2.APP2
    >


    Transactional Integration of Foreign JMS Vendors with BEA WebLogic Server
    -------------------------------------------------------------------------

    The following notes are derived mostly from "http://dev2dev.bea.com/technologies/jms/index.jsp".

    For additional questions, a good forum for WebLogic questions in general is "newsgroups.bea.com". These can be mined for information by using Google's newsgroup search function.


    Feature Overview
    ----------------

    - For a foreign JMS vendor to participate in a WL transaction it must support XA. Specifically, it must support the javax.jms.XA* interfaces.

    - In WL versions 6.0 and up it is possible to make synchronous calls to foreign JMS vendors participate in a WL transaction as long as the foreign vendor supports XA.

    - WL 6.0 and 6.1 MDBs can be driven by foreign vendors non-transactionally. They can be driven transactionally by a select few foreign vendors (MQ is not part of the select few)

    - WL 7.0 and later, MDBs can be driven by foreign vendors transactionally and non-transationally.

    - WL 6.1 and later messaging bridges can be driven by foreign vendors transactionally and non-transactionally.

    - WL 8.1 JMS provides features that simplify transactional and JNDI integration of foreign vendors. See http://edocs.bea.com/wls/docs81/jms/...l#jms_features


    Integration with 8.1 Details
    ----------------------------

    A good overview of 8.1 JMS interop capability is the presentation "Integrating Foreign JMS Providers with BEA WebLogic Server" here:

    http://www.bea.com/content/files/ewo...viders_WLS.pdf

    This document refers to helpful new 8.1 features, which simplify integration. These include:

    http://edocs.bea.com/wls/docs81/Cons...eign_providers
    http://edocs.bea.com/wls/docs81/jms/...s.html#1033768

    And are also summarized here (under interoperability):

    http://edocs.bea.com/wls/docs81/jms/...l#jms_features

    The 8.1 features are likely sufficient for most 8.1 integration needs, and you may not need to refer "Using Foreign JMS Providers With WLS" white-paper mentioned below.


    Integration with 6.1 and 7.0 Details
    ------------------------------------

    Read the "Using Foreign JMS Providers With WLS" white-paper:

    http://dev2dev.bea.com/products/wlse...sproviders.jsp

    Note that this white-paper does not take into account 8.1 features.


    MQ Remote Capable XA Clients
    ----------------------------

    Until recently, IBM MQ JMS clients could not work transactionally unless they were running on the same host as their MQ server. This is a limitation unique to MQ that was relaxed with the introduction of IBM's new "WebSphere MQ Extended Transactional Client". See:

    http://publibfp.boulder.ibm.com/epubs/pdf/csqzar00.pdf

    The product is new, and for some reason, configuration of this client seems to be tricky, even when WebLogic is not involved at all. Oddly, the main sticking point seems to be simply making sure that class paths refer to the required IBM jars:

    - Required on WLS where MQ objects are bound into JNDI:
    com.ibm.mq.jar, com.ibm.mqjms.jar

    - Required only if MQ objects are bound into JNDI on a different server:
    com.ibm.mq.jar

    If there are problems when using this client, first get it to work using a pure IBM client without any BEA classes involved. Once that is working, search the WL JMS newsgroup for answers and/or contact BEA customer support.


    MDB Thread Pool Notes
    ---------------------

    WL7.0SP? and WL8.1 and later support the "dispatch-policy" field to specify which thread pool an MDB uses to run its instances. In most cases this field should be configured to help address potential performance issues and/or dead-locks:

    http://edocs.bea.com/wls/docs81/ejb/...ispatch-policy

    (Note that "dispatch-policy" is ignored for non-transactional foreign vendors; in this case, the MDB "onMessage" callback runs in the foreign vendor's thread.)


    MDB Concurrency Notes
    ---------------------

    Queue MDBs driven by foreign providers can run multiple instances concurrently. Topic MDBs driven by foreign providers are limited to one instance (not sure, but transactional foreign driven topic MDBs may not have this limitation). The size of the thread pool that the MDB runs in and the "max-beans-in-free-pool" descriptor limit how many instances run concurrently.


    Performance Tuning Notes
    ------------------------

    The "WebLogic JMS Performance Guide" white-paper contains detailed performance design and tuning information for the Messaging Bridge, JMS, and MDBs.

    http://dev2dev.bea.com/products/wlse...Perform_GD.jsp


  3. Re: MDB using MQ gets InvalidDestinationException


    Thanks.
    Are you saying that the ability to define an MQConnectionFactory and MQQueue in
    the WLS JNDI tree (via a startup class), as defined in the out-of-date white paper,
    is no quaranteed to work in the future due to changes in the JMS capabilitites?

    We have MQ, but nothing is registered in a JNDI repository (external to our WLS)
    that the WLS foreign JMS definition can attach itself to, which is why the startup
    class scenario works for us.

    If so, we must review this design decision now so that we are not implementing
    legacy code with the first release!

    If this is true, what are the alternatives? - everything I find related to foreign
    JMS server definitions assumes that there is another JNDI repository to be connected
    to ... which is not always true.

    Many Thanks ...

  4. Re: MDB using MQ gets InvalidDestinationException



    KSS wrote:
    > Thanks.
    > Are you saying that the ability to define an MQConnectionFactory and MQQueue in
    > the WLS JNDI tree (via a startup class), as defined in the out-of-date white paper,
    > is no quaranteed to work in the future due to changes in the JMS capabilitites?


    No. The white-paper is out-of-date in that it does not refer to
    8.1 features, which most customers prefer to leverage.

    >
    > We have MQ, but nothing is registered in a JNDI repository (external to our WLS)
    > that the WLS foreign JMS definition can attach itself to, which is why the startup
    > class scenario works for us.
    >
    > If so, we must review this design decision now so that we are not implementing
    > legacy code with the first release!
    >
    > If this is true, what are the alternatives? - everything I find related to foreign
    > JMS server definitions assumes that there is another JNDI repository to be connected
    > to ... which is not always true.


    MQ can support a JNDI repository. Its up to you if you want to
    maintain one or not.

    >
    > Many Thanks ...



  5. Re: MDB using MQ gets InvalidDestinationException


    OK, at least the design is stable.
    You say " The MDB must be configured to use the foreign connection factory in
    addition to the foreign destination" - how is this achieved?
    I am using Workshop to code, so I have the following ejbgen entries in the MDB
    code, and do not see anything else that would also tell the MDB to use the foreign
    connection factory - the XML's look OK too:
    /**
    * @ejbgen:message-driven
    * max-beans-in-free-pool="1"
    * initial-beans-in-free-pool="1"
    * default-transaction="NotSupported"
    * ejb-name = NewMdb
    * destination-jndi-name="foreign_mq_incoming"
    * destination-type = javax.jms.Queue
    *
    */

    I fear I am missing something (probably simple) - but the InvalidDestinationException
    does not tell me anything, so I do not know WHY.

    The startup class is basically that as defined in the white-paper.

    I have com.ibm.mqjms, com.ibm.mqbind and com.ibm.mq in the WLS CLASSPATH.

    Thanks again ...

  6. Re: MDB using MQ gets InvalidDestinationException

    The parameter that you put in weblogic-ejb-jar.xml is called
    "connection-factory-jndi-name". In it, you put, well, the JNDI name of the
    connection factory that you bound in your startup class, just like you put
    the JNDI name of your destination in "destination-jndi-name". I don't have
    Workshop in front of me, but I suspect you put it in that list of ejbgen
    parameters just like you did with "destination-jndi-name".

    greg

    "KSS" wrote in message
    news:4087d354$1@newsgroups.bea.com...
    >
    > OK, at least the design is stable.
    > You say " The MDB must be configured to use the foreign connection factory

    in
    > addition to the foreign destination" - how is this achieved?
    > I am using Workshop to code, so I have the following ejbgen entries in the

    MDB
    > code, and do not see anything else that would also tell the MDB to use the

    foreign
    > connection factory - the XML's look OK too:
    > /**
    > * @ejbgen:message-driven
    > * max-beans-in-free-pool="1"
    > * initial-beans-in-free-pool="1"
    > * default-transaction="NotSupported"
    > * ejb-name = NewMdb
    > * destination-jndi-name="foreign_mq_incoming"
    > * destination-type = javax.jms.Queue
    > *
    > */
    >
    > I fear I am missing something (probably simple) - but the

    InvalidDestinationException
    > does not tell me anything, so I do not know WHY.
    >
    > The startup class is basically that as defined in the white-paper.
    >
    > I have com.ibm.mqjms, com.ibm.mqbind and com.ibm.mq in the WLS CLASSPATH.
    >
    > Thanks again ...




  7. Re: MDB using MQ gets InvalidDestinationException


    Fixed.
    I had assumed (incorrectly) that the ejbgen:message-driven structure was all I
    needed because when using the startup class there is no "foreign JMS Server" defined
    in the AdminConsole.

    Thanks for the help.

    The complete ejbgen entries required are:

    * @ejbgen:message-driven
    * default-transaction="NotSupported"
    * max-beans-in-free-pool="1"
    * initial-beans-in-free-pool="1"
    * ejb-name = MDB
    * destination-jndi-name="foreign_mq_incoming"
    * destination-type = javax.jms.Queue
    *
    * @ejbgen:foreign-jms-provider
    *connection-factory-jndi-name="foreign_mq_connectionfactory"


  8. Re: MDB using MQ gets InvalidDestinationException

    I am using 8.1SP2. I have inserted the

    /**
    *
    * @ejbgen:foreign-jms-provider
    * connection-factory-jndi-name="ForeignConnectionFactory"

    tag in the source code of my mdb.

    EJBGen does not seem to be putting it in the weblogic-ejb-jar.xml file.

    is there some trick to this?

    John

    KSS wrote:

    > Fixed.
    > I had assumed (incorrectly) that the ejbgen:message-driven structure was all I
    > needed because when using the startup class there is no "foreign JMS Server" defined
    > in the AdminConsole.
    >
    > Thanks for the help.
    >
    > The complete ejbgen entries required are:
    >
    > * @ejbgen:message-driven
    > * default-transaction="NotSupported"
    > * max-beans-in-free-pool="1"
    > * initial-beans-in-free-pool="1"
    > * ejb-name = MDB
    > * destination-jndi-name="foreign_mq_incoming"
    > * destination-type = javax.jms.Queue
    > *
    > * @ejbgen:foreign-jms-provider
    > *connection-factory-jndi-name="foreign_mq_connectionfactory"



  9. Re: MDB using MQ gets InvalidDestinationException

    Not that I know of. You might
    want to try posting to the ejbgen
    newsgroup:

    http://groups.yahoo.com/group/ejbgen/

    John Z wrote:

    > I am using 8.1SP2. I have inserted the
    >
    > /**
    > *
    > * @ejbgen:foreign-jms-provider
    > * connection-factory-jndi-name="ForeignConnectionFactory"
    >
    > tag in the source code of my mdb.
    >
    > EJBGen does not seem to be putting it in the weblogic-ejb-jar.xml file.
    >
    > is there some trick to this?
    >
    > John
    >
    > KSS wrote:
    >
    >> Fixed.
    >> I had assumed (incorrectly) that the ejbgen:message-driven structure
    >> was all I
    >> needed because when using the startup class there is no "foreign JMS
    >> Server" defined
    >> in the AdminConsole.
    >>
    >> Thanks for the help.
    >>
    >> The complete ejbgen entries required are:
    >>
    >> * @ejbgen:message-driven
    >> * default-transaction="NotSupported"
    >> * max-beans-in-free-pool="1"
    >> * initial-beans-in-free-pool="1"
    >> * ejb-name = MDB
    >> * destination-jndi-name="foreign_mq_incoming"
    >> * destination-type = javax.jms.Queue
    >> *
    >> * @ejbgen:foreign-jms-provider
    >> *connection-factory-jndi-name="foreign_mq_connectionfactory"
    >>



+ Reply to Thread