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
  • I copied your source into a new project and commented out a couple lines that referenced methods that you didn't show and added com.ibm.mq.jar to the external JARs of the JVM Build path and it works fine.

    One thing that I noticed though is that if I added the reference JAR file when the project was first created then it was not being saved.

    Right click on your project and select Properties.

    Under Micro Focus COBOL-->JVM Build Path tab click on Libraries-->Add External Jars and select the com.ibm.mq.jar file. Mine is under C:\Program Files (x86)\IBM\Websphere MQ\java\lib.

    My project looks like:

Reply
  • I copied your source into a new project and commented out a couple lines that referenced methods that you didn't show and added com.ibm.mq.jar to the external JARs of the JVM Build path and it works fine.

    One thing that I noticed though is that if I added the reference JAR file when the project was first created then it was not being saved.

    Right click on your project and select Properties.

    Under Micro Focus COBOL-->JVM Build Path tab click on Libraries-->Add External Jars and select the com.ibm.mq.jar file. Mine is under C:\Program Files (x86)\IBM\Websphere MQ\java\lib.

    My project looks like:

Children
No Data