Should MID Server wrapper.conf file be edited?


Description

Upgrades and patches of the instance will cause MID Server upgrades, and they will replace wrapper.conf with the out-of-box version. That is necessary because defaults for the JRE and Wrapper may change between versions, such as the default heap size property as mid server requirements change.

If you need to customise something that is defined in wrapper.conf, you can edit wrapper-override.conf to override the defaults. If you want to add something, you can add this to wrapper-override.conf as well.

The wrapper is what loads the Java runtime environment/JVM, within which the MID Server application then runs. These settings apply to the JVM rather than the MID Server application.

Service-now use a 3rd party Java Wrapper from Tanuki, and so the best source for information on exactly what all those properties mean, what might be customised, and the impacts of doing that in general are Tanuki's documentation and the List of Properties and searching the internet for other people who have done similar things to other java applications.

Instructions

Examples:

1. Use an external JRE instead of the bundled one

In this case you are overriding a property already defined in wrapper.conf

################################################################################
# External JRE
################################################################################
# Uncomment and edit if an external JRE is preferred. By default,
# the internal JRE distribution is used.
#
# OPTIONAL: The path (relative to agent dir or absolute) to the java bin
wrapper.java.command=C:\ServiceNow_MID_Servers\OpenJDK\8u251\jre\bin\java

2. Change the Temp Folder

You may have security restrictions that mean the MID Serve application can't freely use the general windows or linux temp folder as it would wish, and so a different one could be defined.

In this case you are adding an extra wrapper.java.additional property to wrapper-override.conf, which is a Java property passed to java when the wrapper launches java.

wrapper.java.additional.2=-Djava.io.tmpdir=C:\ServiceNow_MID_Servers\Prod_Disco_MID\agent\tmpdir

Note the "2" after "additional." above. That number will depend on if there are other properties already there. For example if there is a property using "wrapper.java.additional.1=" in wrapper.conf and you already added another one in wrapper-override.conf with "wrapper.java.additional.2=", then the next one that should be used is "wrapper.java.additional.3=" and so on.

3. Change the order of the Class Path

wrapper.conf includes these line:

# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1
wrapper.java.classpath.1=lib/*.jar
wrapper.java.classpath.2=extlib/*.jar

If there is an identically named JAR files in both those folders, that tells java to use the one in lib. If you want to use the classes in extlib instead, which are the ones synchronised from the JAR files table in the instance, then the following lines can be added to wrapper-override.conf

# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1
wrapper.java.classpath.1=extlib/*.jar
wrapper.java.classpath.2=lib/*.jar