Re: IBM Mainframe Calling Java from Cobol via JCL Batch STDOUT Issues



sjhesse@xxxxxxxxx wrote:
Hi Pete,

thanks for you reply

Presumably "HelloJ" is a Java Class?
You're right, this ist HelloJ:
public class HelloJ {
public static void sayHello(){
System.out.println("Hello World!");
}
}

Have you tried calling "sayHello" from Java to make sure it works
properly?
I veryfied this class and also checked, that it is working properly
when invoked by oo cobol. The problem only occurs when

cobol -------> oo cobol -----------> java
call invoke

I veryfied

cobol -------> oo cobol
call

and also

oo cobol -----------> java
invoke

which are working like I expected

Excellent clarification. Thanks.

So the only problem really is CALLing OO COBOL from COBOL...

cobol -------> oo cobol -----------> java
call invoke

What happens if you do this?

cobol -------> oo cobol -----------> java
INVOKE invoke

It may be that the mechanism used to link to a Class is different from the
mechanism used to link to a module...


I note your repository use but I'm not sure if you can include
Java Classes directly in the repository or not.
It is recommended to that this way. You have to include your java
classes in the repo.

OK. What if you are using late binding? Repository is required for early
binding so that references can be resolved at compile time and compliance
and conformity can be checked. Late binding doesn't normally require it; you
just invoke the fully qualified method of the Class you want. Maybe, in the
Enterprise environment late binding is not an option, or it requires a
repository entry for other reasons.

You mentioned "wrapping" the JVM. Is that necessary? It seems a bit
drastic to me. I would expect that if
I think you're right, wrapping may the the wrong term. The oo cobol
uses a shared library to execute the code, I'm not sure if there'll be
a "real" jvm process

Let us know how you get on. This is an interesting problem.

Pete.
--
"I used to write COBOL...now I can do anything."


.



Relevant Pages