Linking OO Cobol gives "GetClassObject UNRESOLVED" error



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Re: Linking OO Cobol gives "GetClassObject UNRESOLVED" error

Postby Robert Sample » Mon Sep 27, 2010 7:25 pm

I think you must be the only one -- at least on this board -- trying to get the example running.

I did some more testing and by tweaking the CLASSPATH, LIBPATH, and PATH variables I got past the error you're seeing. However, I am getting a version error on HelloJ.class and have not been able to get past it.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Linking OO Cobol gives "GetClassObject UNRESOLVED" error

Postby Robert Sample » Thu Oct 14, 2010 1:01 am

Are you still working on this? I managed to get the manual program running by setting the PATH, CLASSPATH, and LIBPATH variables. You need to run the sample code from its own directory under your home directory.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Linking OO Cobol gives "GetClassObject UNRESOLVED" error

Postby LotharLochkarte » Thu Oct 14, 2010 2:24 pm

Yes, I am still working on this.

Nice to hear that you have been successfull! :-)

I am trying to execute the COBOL program with the following JCL:
//ABCEXEC JOB XXXX,ABC,CLASS=2,REGION=200M,MSGCLASS=X
//GO EXEC PGM=COBOLOO,
// PARM='/ENVAR("_CEE_ENVFILE=/u/myuserid/ENV")
// POSIX(ON)'
//STEPLIB DD DSN=myuserid.USER.LOADLIB.PDSE,DISP=SHR
// DD DSN=SYS1.CEE.SCEERUN2,DISP=SHR
// DD DSN=SYS1.CEE.SCEERUN,DISP=SHR
//SYSOUT DD SYSOUT=*
//CEEDUMP DD SYSOUT=*
//CEEOPTS DD *
XPLINK(ON)
//SYSUDUMP DD DUMMY
//JAVAOUT DD PATH='/u/myuserid/javaout'

The ENV-file contains the following:
PATH=/bin:/usr/lpp/java/J5.0/bin.
LIBPATH=/lib:/usr/lib:/usr/lpp/java/J5.0/bin:/usr/lpp/java/J5.0/bin/j9vm:/u/myuserid
CLASSPATH=/u/myuserid/classes:/u/myuserid:/u/myuserid/

Could you please explain to me, what you mean with "running the sample code from its own directory under my home directory"?

Thank you very much in advance!

Best regards!
LotharLochkarte
 
Posts: 68
Joined: Fri Aug 27, 2010 6:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Linking OO Cobol gives "GetClassObject UNRESOLVED" error

Postby Robert Sample » Thu Oct 14, 2010 5:50 pm

I logged into OMVS (the Unix System Services command line shell). I created a directory of tsthello and set the working directory to it. I copied tsthello.cbl from the manual, and then copied HelloJ.java from the manual. I then created a compile script of
export COBJVMINITOPTIONS="-Xms10000000 -Xmx20000000 -verbose:gc"
cob2 -c -qdll,thread -I/usr/lpp/cobol/include/ tsthello.cbl
cob2 -V -bdll -o libtsthello.so tsthello.o \
 /usr/lpp/java/J5.0/bin/j9vm/libjvm.x \
 /usr/lpp/cobol/lib/igzcjava.x >tsthello.link.lst
javac HelloJ.java
and ran it to create libtsthello.so

I then created the execution script of
export CLASSPATH=$CLASSPATH:/u/tech/ttssrs0/tsthello/HelloJ.class
export CLASSPATH=$CLASSPATH:/u/tech/ttssrs0/tsthello/
export   LIBPATH=$LIBPATH:/usr/lpp/java/J5.0/bin/j9vm/
export   LIBPATH=$LIBPATH:/usr/lpp/java/J5.0/bin/
export   LIBPATH=$LIBPATH:/u/tech/ttssrs0/tsthello/
export   LIBPATH=$LIBPATH:/usr/lpp/java/J5.0/
export      PATH=$PATH:/u/tech/ttssrs0/tsthello/
export      PATH=$PATH:/usr/lpp/java/J5.0/bin/
export      PATH=$PATH:/usr/lpp/java/J5.0/
export JAVA_HOME=/usr/lpp/java/J5.0
# set
./libtsthello.so
which executed and produced
TTSSRS0:/u/tech/ttssrs0/tsthello: >./tsthello.sh
COBOL program TSTHELLO entered
Hello World, from Java!
Returned from java sayHello to TSTHELLO

While it may be possible to do this from a batch job, it would require a good bit of experimentation to get everything just right -- the batch environment does not have the same set up as the interactive environment. I suspect you may need to compile and link, then execute BPXBATCH to actually run the program.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Linking OO Cobol gives "GetClassObject UNRESOLVED" error

Postby LotharLochkarte » Thu Oct 14, 2010 10:06 pm

Thanks for your reply, I will try it out in a few days. :-)

But if I use BPXBATCH to start the program COBOLOO, this program runs under control of the USS, doesn't it?

My hope was - and still is :-) - to get this program running under IMS.

Or do you know conceptional obstructions that would prevent this plan?
LotharLochkarte
 
Posts: 68
Joined: Fri Aug 27, 2010 6:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Linking OO Cobol gives "GetClassObject UNRESOLVED" error

Postby Robert Sample » Fri Oct 15, 2010 8:07 pm

Try your job after changing ENV to:
PATH=/bin:/usr/lpp/java/J5.0/bin.
LIBPATH=/lib:/usr/lib:/usr/lpp/java/J5.0/bin:/usr/lpp/java/J5.0/bin/j9vm:/u/myuserid
CLASSPATH=/u/myuserid/classes:/u/myuserid/HelloJ.class:/u/myuserid/
JAVA_HOME=/usr/lpp/java/J5.0
where CLASSPATH poitns to the indicated file or /u/myuserid/classes/HelloJ.class -- wherever you compiled the Java code into a class.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Linking OO Cobol gives "GetClassObject UNRESOLVED" error

Postby LotharLochkarte » Mon Oct 25, 2010 12:46 pm

I still get the "exception in thread 'main'" message...

Do you know a way to get more information about this error? Is there a logfile or something like that?
LotharLochkarte
 
Posts: 68
Joined: Fri Aug 27, 2010 6:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Linking OO Cobol gives "GetClassObject UNRESOLVED" error

Postby Robert Sample » Mon Oct 25, 2010 8:46 pm

I got rid of the Exception in thread "main" error by changing the PATH, CLASSPATH, and LIBPATH environment variables. I never found anything that would provide detailed data about what the problem was, however -- that error message was all that came out.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Linking OO Cobol gives "GetClassObject UNRESOLVED" error

Postby LotharLochkarte » Tue Oct 26, 2010 12:32 pm

After adding "/u/myuserid/Hello1.class" to LIBPATH I am getting the following ABEND:

"CEE3512S An HFS load of module IGZCJAVA failed. The system return
code was 0000000135; the reason code was 0594003C."

I believe that took me a step further... :-)
LotharLochkarte
 
Posts: 68
Joined: Fri Aug 27, 2010 6:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Linking OO Cobol gives "GetClassObject UNRESOLVED" error

Postby LotharLochkarte » Tue Oct 26, 2010 12:47 pm

Oh shit, shame on me, this message only means that some component of the path being loaded is not a directory.... Clearly....
LotharLochkarte
 
Posts: 68
Joined: Fri Aug 27, 2010 6:51 pm
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post