Customizing Java Properties

You can customize Java properties by modifying the transformer.xml file, which is located in the transformer/bin directory. This file provides a set of properties for advanced options when running Transformer in design time. Modifying these properties is useful for specifying additional Java Virtual Machine (JVM) options, setting Java system properties, and registering Java class and JAR files in the classpath.

Configuring JVM settings can improve the performance of Transformer or resolve errors. The most common settings include the size of the Java heap and stack, which determine memory availability for Java programs and the JVM. If sufficient memory is not available, errors can occur. The heap size affects performance, as it determines how often garbage collection occurs.

Processing complex XML schema files is an example of a situation when customizing Java properties can be helpful.

If you encounter performance problems or receive out of memory exception errors, adjusting the Java heap and stack sizes is a good option. The following are the most common JVM memory settings:

The following is an example of the transformer.xml file. Note the JVM_OPTION parameter, which can be used to increase memory allocation while running a JVM with an extended heap size:

<APPCONFIG version="6.0.1">
   <Application name="transformer" class="">
      <Properties>
          <Property name="POST_CLASSPATH" description="external classes
          to be appended to classpath" value="" /> 
          <Property name="PRE_CLASSPATH" description="external classes
          to be prepended to class path" value="" /> 
          <Property name="JVM_OPTION" description="options to be applied
          at jvm startup" value="-Xmx512m" /> 
          <Property name="JAVA_LIB_PATH" description="dlls to be added to
          java.library.path" value="" /> 
      </Properties>
   </Application>
</APPCONFIG>

Note: For any changes made in the transformer.xml file to take effect, you must first close and restart Transformer.

On Windows, the Register Libraries function enables you to add Java classes and .JAR files to the classpath. You can use this function to add third-party drivers, for example, JDBC. You can also specify additional library directories that may be required when the third-party Java classes require dynamic link libraries or shared objects (depending on the platform in use).

To add an entry to the beginning of the classpath, use the PRE_CLASSPATH property. To add an entry to the end of the classpath, use POST_CLASSPATH.


iWay Software