JVM COBOL calling java MQ classes

In Visual COBOL 2.1 for Eclipse, I'm trying to build a JVM application that I would want to deploy on z/Linux, so created a  COBOL JVM Class, coded the statement  $set ilusing"com.ibm.mq", add a JAR to the JVM Build Path in which package com.ibm.mq exists, then wrote the line of code  

set mqmanager to new MQQueueManager(qMgrName)  in a method within the class. I cannot get the compiler/builder to recognize MQQueueManager as a class that I can access. I get the error message "COBCH0845S Unknown class 'MQQueueManager' "

I added some ilusing statements for java.lang, and can quite happily access classes like Integer.

I'm very new to this environment including object COBOL, but I think I've set up everything I should to have my class invoke a java class.

So, what am I doing wrong.

 

 

Parents
  • It would seem that I'm basically doing the same as the example code above, but still not working.

    Following is my code:

         $set ilusing"java.io"

         $set ilusing"java.lang"

         $set ilusing"javax.jms"

         $set ilusing"com.microfocus.cobol.program"

         $set ilusing"com.ibm.mq"

          class-id hoganfeeds.BuildCallstoNSPforHoganData public.

         *working-storage section.

          01 working-variables.

              05  sleep-period                binary-long  value 5000.

              05  qMgrName                    pic x(8) value "REQMGR".  

              05  queue-options               binary-long.

          copy "javatypes.cpy".              

          method-id main public static.

          01 hoganfileprocessor type BuildCallstoNSPforHoganData.

          procedure division using by value args as string occurs any.

              set hoganfileprocessor to type

                      BuildCallstoNSPforHoganData::createFileProcessor

              invoke hoganfileprocessor::start

          end method.      

          method-id openqueuemgr private.

          01 mqmanager    type MQQueueManager.

          procedure division.

              set mqmanager to new MQQueueManager(qMgrName)

          end method.    

          method-id start public.

              call "CBL_THREAD_SLEEP" using by value sleep-period.

              invoke self::openqueuemgr.

          end method.

    I added an External JAR that contains the package com.ibm.mq. The info on the build path screen is

    mq-7.0.1.3.jar - C:\Documents and Settings\bundaya\IBM\mqc75

    In the Java perspective for the project I have

    JRE System Library

    COBOL JVM Runtime System

    Reference Libraries

         mq-7.0.1.3.jar

               com.ibm.mq  (with package symbol next to it)

                      MQQueueManager.class

                      MQQueueManagerFactory.class

    So Eclipse is seeing the class in drilldown but JVM Cobol is not.

Reply
  • It would seem that I'm basically doing the same as the example code above, but still not working.

    Following is my code:

         $set ilusing"java.io"

         $set ilusing"java.lang"

         $set ilusing"javax.jms"

         $set ilusing"com.microfocus.cobol.program"

         $set ilusing"com.ibm.mq"

          class-id hoganfeeds.BuildCallstoNSPforHoganData public.

         *working-storage section.

          01 working-variables.

              05  sleep-period                binary-long  value 5000.

              05  qMgrName                    pic x(8) value "REQMGR".  

              05  queue-options               binary-long.

          copy "javatypes.cpy".              

          method-id main public static.

          01 hoganfileprocessor type BuildCallstoNSPforHoganData.

          procedure division using by value args as string occurs any.

              set hoganfileprocessor to type

                      BuildCallstoNSPforHoganData::createFileProcessor

              invoke hoganfileprocessor::start

          end method.      

          method-id openqueuemgr private.

          01 mqmanager    type MQQueueManager.

          procedure division.

              set mqmanager to new MQQueueManager(qMgrName)

          end method.    

          method-id start public.

              call "CBL_THREAD_SLEEP" using by value sleep-period.

              invoke self::openqueuemgr.

          end method.

    I added an External JAR that contains the package com.ibm.mq. The info on the build path screen is

    mq-7.0.1.3.jar - C:\Documents and Settings\bundaya\IBM\mqc75

    In the Java perspective for the project I have

    JRE System Library

    COBOL JVM Runtime System

    Reference Libraries

         mq-7.0.1.3.jar

               com.ibm.mq  (with package symbol next to it)

                      MQQueueManager.class

                      MQQueueManagerFactory.class

    So Eclipse is seeing the class in drilldown but JVM Cobol is not.

Children
No Data