Problem looking up remote JMS queue:javax.naming.NameNotFoundException - Websphere

This is a discussion on Problem looking up remote JMS queue:javax.naming.NameNotFoundException - Websphere ; I have 2 websphere servers A and B on the same machine having the bootstrap ports as 2809 and 2810 respectively. I have a queue connection factory with jndi name jms/sample/QCF in server B. I am trying to create a ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Problem looking up remote JMS queue:javax.naming.NameNotFoundException

  1. Problem looking up remote JMS queue:javax.naming.NameNotFoundException

    I have 2 websphere servers A and B on the same machine having the bootstrap ports as 2809 and 2810 respectively.

    I have a queue connection factory with jndi name jms/sample/QCF in server B.



    I am trying to create a simple web client application to be deployed in server A, which can send messages to the queues configured on server B.



    Servlet code:



    Properties env1 = new Properties();



    env1.put(Context.INITIAL_CONTEXT_FACTORY,

    "com.ibm.websphere.naming.WsnInitialContextFactory");

    env1.put(Context.PROVIDER_URL,"corbaloc:iiop:localhost:2810"); // server B's bootstrap port is 2810



    String qcfName = "jms/sample/QCF";



    Context env = new InitialContext(env1);



    // obtain the connection factory from JNDI

    QueueConnectionFactory qcf = (QueueConnectionFactory) env.lookup(qcfName);



    If I deploy the web application to server B itself, then it is able to lookup the queue connection factory.



    But when I deploy the same application to server A, then the connection factory lookup fails with the following exception in log:



    jms.test.JMSClientServlet>> exception javax.naming.NameNotFoundException: Context: ajbansal-pcNode01Cell/nodes/ajbansal-pcNode01/servers/server1, name: jms/sample/QCF: First component in name jms/sample/QCF not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDLmg.org/CosNaming/NamingContext/NotFound:1.0



    It seems that it is trying to lookup in the context of the server A (ajbansal-pcNode01Cell/nodes/ajbansal-pcNode01/servers/server1), while it should try to lookup in context of server B (ajbansal-pcNode02Cell/nodes/ajbansal-pcNode02/servers/server1)



    What I might be doing wrong here?



    I am using IBM Websphere 6.1 and using "Default Messaging Provider" to configure the queues on server B.

    Could the problem be related to the use of "Default Messaging Provider" for exchanging jms messages between different servers. If yes , can you suggest any alternatives so that two applications on different websphere servers can exchange jms messages. Any pointers to tutorials an documentation will be really helpful.

  2. Re: Problem looking up remote JMS queue:javax.naming.NameNotFoundException

    Hi,



    I'm not sure if you are encountering the exact same problem as I did, but if your two servers resides on different nodes you might be.



    There is a technote regarding a bug with reaching the JNDI namespace from one profile to another on the same physical server.



    You might find som more information in this thread here:

    http://www-128.ibm.com/developerworks/forums/thread.jspa?threadID=185845



    I hope it helps.

  3. Re: Problem looking up remote JMS queue: javax.naming.NameNotFoundException

    The simplest thing would be just to define the JMS resources in the JNDI
    namespace of server A. They can still reference the bus resources
    defined on server B (you'll just have to enter things like the bus and
    queue name manually rather than from a drop-down list.)

    Either way, make sure you set the provider endpoints in the connection
    factory so that when you do manage to get hold of one the application
    knows how to find a bootstrap server on the other side.

    Regards,
    David

  4. Unhappy Re: Problem looking up remote JMS queue:javax.naming.NameNotFoundException

    Hi all i am facing the same problem in WAS 6.1
    Topology:
    CrtcdbDevCell
    CrtcdbDevNode1
    crt_server
    crt_cluster

    I have created Queue manager and queue at cluster level and also defined environment variable MQ_INSTALL_ROOT at cluster level but still it says...
    javax.naming.NameNotFoundException: Context: CrtcdbDevCell/clusters/crt_cluster, name: jms/cp3QueueManager: First component in name jms/cp3QueueManager not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDLmg.org/CosNaming/NamingContext/NotFound:1.0
    at com.ibm.ws.naming.jndicos.CNContextImpl.processNot FoundException(CNContextImpl.java:4846)

    My MQ_INSTALL_ROOT point to usr/mqm/java/lib, seems to be correct.
    You have any idea if we can point jms/cp3QueueManager directly in deployment descriptor at cluster level.

+ Reply to Thread