Skip to main content

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.

 

 

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.

 

 

From what I remember about MQ's Java support it also requires PATH/LIBPATH to be setup for it to work,

when you added the .jar file to CLASSPATH or the eclipse build path did you also setup the native

library path too?

re: www-01.ibm.com/.../docview.wss


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.

 

 

Just to confirm. Can I set the CLASSPATH within Eclipse or in a Command Window?


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.

 

 

I set up the CLASSPATH environment variable per the IBM info. But to no avail. Eclipse/Visual COBOL is finding the class in the package within the .jar file. I would just like to write the program and compile it. Then I can promote getting Visual COBOL as a full product in house. I really do not want to write the whole program/process in Java, but if I can't access the MQ class library I will have to. One thing of interest, if I go into the Java perspective in Eclipse, I can see the .jar file, the packages in it and the drill down to the classes and methods!!!!


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.

 

 

I set up the CLASSPATH environment variable per the IBM info. But to no avail. Eclipse/Visual COBOL is finding the class in the package within the .jar file. I would just like to write the program and compile it. Then I can promote getting Visual COBOL as a full product in house. I really do not want to write the whole program/process in Java, but if I can't access the MQ class library I will have to. One thing of interest, if I go into the Java perspective in Eclipse, I can see the .jar file, the packages in it and the drill down to the classes and methods!!!!


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.

 

 

I set up the CLASSPATH environment variable per the IBM info. But to no avail. Eclipse/Visual COBOL is finding the class in the package within the .jar file. I would just like to write the program and compile it. Then I can promote getting Visual COBOL as a full product in house. I really do not want to write the whole program/process in Java, but if I can't access the MQ class library I will have to. One thing of interest, if I go into the Java perspective in Eclipse, I can see the .jar file, the packages in it and the drill down to the classes and methods!!!!


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.

 

 

Sorry meant to say Eclipse/Visual COBOL is NOT finding the class


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.

 

 

I can get the following to compile without a problem in JVM COBOL on Windows by including the com.ibm.mq.jar in the build path.

    $set ilusing(com.ibm.mq)
      program-id. callMQ as "callMQ".
      data division.
      working-storage section.
      01 mqinstance type MQQueueManager.
      procedure division.

          set mqinstance to new type MQQueueManager("test")
          goback.

      end program callMQ.


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.

 

 

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.


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.

 

 

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:


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.

 

 

Everything looks very similar, the difference I believe is that I received the Websphere stuff from another member of staff in a .zip file that extracted out to a .jar file called mq-7.0.1.3.jar. Within that jar file is the package com.ibm.mq containing the classes.   I do not have a com.ibm.mq.jar file.

Should I be coding my "ilusing" statement differently?


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.

 

 

Everything looks very similar, the difference I believe is that I received the Websphere stuff from another member of staff in a .zip file that extracted out to a .jar file called mq-7.0.1.3.jar. Within that jar file is the package com.ibm.mq containing the classes.   I do not have a com.ibm.mq.jar file.

Should I be coding my "ilusing" statement differently?


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.

 

 

Everything looks very similar, the difference I believe is that I received the Websphere stuff from another member of staff in a .zip file that extracted out to a .jar file called mq-7.0.1.3.jar. Within that jar file is the package com.ibm.mq containing the classes.   I do not have a com.ibm.mq.jar file.

Should I be coding my "ilusing" statement differently?


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.

 

 

I am not sure exactly what this mq-7.0.1.3.jar file is.

It appears to be a fixpack for mq 7.0.

You should probably check with IBM to find out what jar file you should be using as the com.ibm.mq.jar file works fine for me.

Can you reference the MQQueueManager class from a Java program in Eclipse using the same jar file?


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.

 

 

Chris, I built the following small Java program within the project I'm writing my COBOL program, and while I'm getting a compiler error, the error would indicate that Eclispe is finding the class library in the .jar file I have. The code is as follows:

package hoganfeeds;

import com.ibm.mq.*;

public class TestAccesstoMQ {

/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub

MQQueueManager queueManager=new MQQueueManager("REMQ");

}

}

The error message is now

"The constructor MQQueueManager(String) refers to the missing type MQException"

suggesting that the code needs a try/catch pair, but clearly locating the class.


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.

 

 

I believe at this point that it would be helpful if you submitted a support incident with Customer Care for this as we will probably need to exchange files or do a Live Meeting with you.

I am not an expert in the area of MQ and Websphere but from my limited testing it worked correctly for me using an eval copy of MQ that I downloaded from the IBM web site.

Perhaps you could try this for a test and download the latest MQ for Java from IBM and try with the com.ibm.mq.jar package that is installed with it?

Thanks.