Passing Options via IBM_JAVA_OPTIONS

General discussion on the JZOS batch launcher and toolkit
Post Reply
lomin
Posts: 2
Joined: Fri Oct 10, 2008 2:06 am

Passing Options via IBM_JAVA_OPTIONS

Post by lomin »

Hi,
I am currently encountering a problem, when running a Java-process via JZOS as a started task. The Java-class is executed, but it stops with an AccessControlException (Access denied) in the main method. However, in the specified policy file the following section ist included:

Code: Select all

grant {
permission java.security.AllPermission;
};
So security-exceptions shouldn't be a problem at all.

When reading the log-files written by my class, it appears, that even the specified time-zone is not the one specified, too.

I just can't make out why these options are not given to the JVM via the IBM_JAVA_OPTIONS. :? These are defined in the STDENV DD as follows:

Code: Select all

IJO="-Xms128M -Xmx256M"
IJO="$IJO -Duser.timezone=Europe/Berlin"
IJO="$IJO -Djava.net.preferIPv4Stack=true"
IJO="$IJO -Djava.security.policy=$POLICYFILE_LOCATION"
IJO="$IJO -Dnetworkaddress.cache.ttl=60"
export IBM_JAVA_OPTIONS="$IJO "
We are currently using the JZOS-version, which is shipped with the IBM 31-bit SDK for z/OS, Java 2 Technology Edition, V5.

Another remark: There is no problem, when invoking the started task with BPXBATCH and starting the java-process like this:

Code: Select all

java -Xms128M -Xmx256M -Duser.timezone=Europe/Berlin -Djava.net.preferIPv4Stack=true -Djava.security.policy=$POLICYFILE_LOCATION -Dnetworkaddress.cache.ttl=60 (...)
Do you have any idea, what might be the problem? :(

(Please note that I am new to the whole mainframe-environment :oops: )
coz
Posts: 391
Joined: Fri Jul 30, 2004 5:29 pm

Post by coz »

Some java options are not recognized when supplied via IBM_JAVA_OPTIONS. This is currently an undocumented set by IBM. It's possible that this is the case for the options you're having trouble with.

You can try specifying them via the JZOS environment variable: JZOS_JVM_OPTIONS, which gets processed earlier in the initialization phase. Just define this variable in your JCL as you do IBM_JAVA_OPTIONS.

If you try this, please turn on tracing (LOGLVL='+T') and send the output to info@dovetail.com We can take a look an make sure that you are on an SDK level that will recognize this environment variable.

Let me know if this works,
--Steve
lomin
Posts: 2
Joined: Fri Oct 10, 2008 2:06 am

Post by lomin »

Thanks for the reply.
I tried to use the options in JZOS_JVM_OPTIONS, unfortunately it didn't work.

I will send the output as soon as possible. But as i just read, the JZOS_JVM_OPTIONS are only available with the alphaworks-version of JZOS. If that's still true, then this might well be the problem.
edit: I just checked, which Version of the Batch Launcher we use. It's 2.0.0.

edit2:
After carefully checking the JCL-code with a mainframe specialist, we found the problem and were able to solve it.
The problem was, that a wrong file in the USS was used to set the environment variables. The difference between the two was just, that only the new one for JZOS exported the IBM_JAVA_OPTIONS, the old one did not.
It does work now, i apologize and say thank you.

--Mike
Post Reply