Topic
6 replies Latest Post - ‏2012-11-21T08:34:15Z by SystemAdmin
SystemAdmin
SystemAdmin
648 Posts
ACCEPTED ANSWER

Pinned topic Communicating with JMS not working

‏2012-11-13T14:49:19Z |
Hi all,

We are now in the progress to start sending messages via JMS to the IBM Messagebroker, but we do not seem to get it right.
We have set up a JMS provider, we picked the top one of the WebSphere MQ Messageing Providers with Node=servernameCellManager01 .

There defined everything, queue connection factory, queues and so on.
In the jmsGetContext function we need to provide an url and a jndiFactory.
No here is where we get stuck. How to get this working. For now we have this:

var myContext= jmsGetContext("iiop:localhost:2809","com.ibm.websphere.naming.WsnInitialContextFactory");
var myConnectionFactory=myContext.jmsGetConnectionFactory("WPCFrToBrokerQueueConnectionFactory");

the second line already returns an exception. That is because the jmsGetContext is not correct and we do not get a context back.

Is there someone that can help me out please.

Regards,
Han
Updated on 2012-11-21T08:34:15Z at 2012-11-21T08:34:15Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    648 Posts
    ACCEPTED ANSWER

    Re: Communicating with JMS not working

    ‏2012-11-13T17:01:06Z  in response to SystemAdmin
    It is MDM CS problem. I have this issue too and already wrote PMR. Now I use lookup table for store mq connection settings and wait when IBM resolve this problem.
    • SystemAdmin
      SystemAdmin
      648 Posts
      ACCEPTED ANSWER

      Re: Communicating with JMS not working

      ‏2012-11-14T12:46:10Z  in response to SystemAdmin
      We have created a PMR also. Let me come back to you when we figure this out.

      What port did you use, did you open some other port? All help is appreciated.

      regards,
      Han
      • SystemAdmin
        SystemAdmin
        648 Posts
        ACCEPTED ANSWER

        Re: Communicating with JMS not working

        ‏2012-11-14T15:15:55Z  in response to SystemAdmin
        Here is your solution:

        http://www.redbooks.ibm.com/redbooks/pdfs/sg247770.pdf

        I will help more if needed, but inthere it is described what to do.
        I followed the instructions and now things are moving through the system.
  • SystemAdmin
    SystemAdmin
    648 Posts
    ACCEPTED ANSWER

    Re: Communicating with JMS not working

    ‏2012-11-15T06:10:42Z  in response to SystemAdmin
    I can get jms Context using script below in script sandbox, but it is not work in Reports console
    out.println(jmsGetContext("iiop://localhost:9812","com.ibm.websphere.naming.WsnInitialContextFactory"));
    Port I get BOOTSTRAP_ADDRESS from WAS.
    What exception you get on second line? NullPointerException?
    • KaranBal
      KaranBal
      108 Posts
      ACCEPTED ANSWER

      Re: Communicating with JMS not working

      ‏2012-11-21T00:40:29Z  in response to SystemAdmin
      I am not an expert in JMS message brokers and am not qualified to comment on how to set it up. A PMR is the best way to proceed.
      But I did find it curious that the context is being got in sandbox but not in a report. Now jobs(including report jobs) are run in a scheduler while sandbox is run in the appserver. If the code is correct in the report, then a null pointer suggest some of the classes are not being recognized by the scheduler which usually means classpath is not set correctly. This also explains why sandbox works because the appserver uses different classpath.

      So my suggestion is to check whether the classpath is the same on both.
      Scheduler:
      1. Go to $TOP/bin and "source compat.sh" or run it as ". ./compat.sh". if the file is missing, then run $TOP/bin/configureEnv.sh to create it.
      2. Use the following command to find the classpath used by scheduler: "echo $CCD_CLASSPATH".

      AppServer:
      1. Log into the WAS Admin console and open the server that is running MDMCS.
      2. Go to "Java and Process Management" > "Process Definition" > "Java Virtual Machine" and look up the path.

      If the path of the scheduler and AppServer are not the same, then we know why the report is not working. Just add those jars into the classpath as is defined in the $TOP/bin/conf/classpath directory.
    • SystemAdmin
      SystemAdmin
      648 Posts
      ACCEPTED ANSWER

      Re: Communicating with JMS not working

      ‏2012-11-21T08:34:15Z  in response to SystemAdmin
      It was something about Bootstrap not found. Guess I used the wrong portnumber.
      When the queues were not configured correctly it said part of the connectionfactory was not found. I guess that was also because of the context being wrong.

      We ran the code in sandbox, report and action and all is working fine.