|
The following example will monitor the JVM output and then restart the JVM automatically
whenever a java.lang.OutOfMemoryError is thrown to the console.
Depending on where in an application the error is thrown,
it is not always possible to trap and handle the error in a useful way from within the JVM.
Filters work by monitoring the console output of the JVM.
In order for a trigger to be fired by an exception,
the Java application must print the message being filtered to the console.
| Example: |
wrapper.filter.trigger.1=java.lang.OutOfMemoryError
wrapper.filter.action.1=RESTART
|
The next example demonstrates how to trigger a JVM restart
whenever the string Error appears
anywhere in the output,
with the exception of the case where the string is part of the larger string
IgnoreError.
| Example: |
wrapper.filter.trigger.1=IgnoreError
wrapper.filter.action.1=NONE
wrapper.filter.trigger.2=Error
wrapper.filter.action.2=RESTART
|
The string being filtered can contain spaces.
But due to the way the configuration properties are loaded in general,
any leading of trailing spaces will be trimmed when the property is loaded.
| Example: |
wrapper.filter.trigger.1=Restart me now.
wrapper.filter.action.1=RESTART
|
More than one actions:
Starting with Wrapper version 3.5.0,
it is possible to specify more than one actions by separating them with a space or comma.
When more than one action is specified, they will be executed in rapid succession in the order specified.
The following example will perform a thread dump and then restart the JVM
in response to a user error message being detected in the console output.
| Example: |
wrapper.filter.trigger.1=User Error
wrapper.filter.action.1=DUMP,RESTART
|
|