How to add JVM options to PeopleCode calls?

296 Views Asked by At

We have a Java class that is called from PeopleCode using the CreateJavaObject() call. I support the Java code and a recent upgrade in one of the dependencies has broken the call. We think it may be a classloader issue. To troubleshoot, we want to add -verbose:class to the call, but we don't know how to add that option to the PeopleCode. I know very little about PeopleCode.

How can we add the option?

Thank you.

1

There are 1 best solutions below

1
On

Use the PSADMIN tool to configure Java VM Options, as described in the documentation.

Setting Application Server Domain Parameters

This chapter describes all of the configuration options that are related to an application server domain. Generally, the documentation reflects the order in which the configuration sections appear in the PSADMIN interface or the PSAPPSRV.CFG file.

...

PSTOOLS Options

You may need to set the following parameters in advanced configurations.

...

JavaVM Options

Specify additional options to be passed to the JVM loaded by the domain's server processes. Separate the options with spaces, for example:

-Xrs -Xmx256m -Xms256m

If the domain will run as a Windows service, you must specify at least the default option, -Xrs.

Note. If you are using the AIX operating system, these options may be required: JavaVM Options=-Xrs -Djava.awt.headless=true -Xcheck:jni.

The JavaVM Options parameter specified in the [PSTOOLS] section specifies global JavaVM options used by every server process in a domain. To override this global value for a particular server process, you can apply custom JavaVM options to individual server processes by adding the JavaVM Options parameter manually to the configuration section for that server process.

JavaVM Options can appear multiple times in a single PSAPPSRV.CFG or PSPRCS.CFG file. While the JavaVM Options value in the [PSTOOLS] section applies to all server processes governed by a particular configuration file, the system only uses the JavaVM Options value in the [PSTOOLS] section for server processes that do not have the JavaVM Options parameter added to its configuration settings section.

For example, if the JavaVM Options parameter has been added to the [PSAPPSRV] section of the PSAPPSRV.CFG file and has been assigned a value, then that value will be used when loading the JVM as a thread of that PSAPPSRV process. If the JavaVM Options parameter does not appear, or has no value, in the [PSAPPSRV] section, then the system uses the value specified in the [PSTOOLS] section when loading the JVM as a thread of the PSAPPSRV process. This applies to any server process: PSAPPSRV, PSQRYSRV, PSAESRV, and so on.

See your JRE documentation for valid JVM options.