Use the Whitelist Tool
The Java Cloud Service - SaaS Extension Whitelist tool makes it easy for you to verify that applications you are trying to deploy are not using disallowed packages.
Quite often, problems with application deployment can be traced to disallowed Java packages in the application. Some Java packages, for example java.rmi
, cannot be used in applications deployed to Oracle Java Cloud Service - SaaS Extension. You can test your applications for these disallowed packages by using the Whitelist tool included in the Oracle Java Cloud Service - SaaS Extension SDK. As part of the Java API validation, the Whitelist tool performs a type of compatibility test on every application installed or updated in a Java Cloud Service - SaaS Extension instance by validating deployment descriptors and other application configuration files, such as the log4j.properties
file. If you are encountering additional deployment problems, you can locally validate an application by using whitelist.jar
, which is available in the Java Cloud Service - SaaS Extension SDK (you can download the SDK from the Oracle Cloud Downloads page). This tool lets you scan one or more class files, JAR files, deployable archives (WAR or EAR), or exploded directories to locates any disallowed or otherwise impermissible usages . You can also use it to verify whether the input file (when the input file is not a class, JAR, WAR, or EAR) can be packaged inside a deployable archive.
It is recommended that, whenever you encounter an application deployment problem, you perform a Whitelist check on the application before proceeding to more intensive troubleshooting.
The Whitelist Tool Command
Run the Whitelist by issuing this command:
./whitelist [-argument ...] [-help] [file1 file2 dir1 dir2 ...]
For example:
./whitelist -log /home/log/newlog.log /home/apps/myapp.war
The valid arguments are:
Argument | Description | Default | Shortcut |
---|---|---|---|
log |
The path to the log file to which the scan result will be written. |
l |
|
grid |
The true/false flag that indicates if the error listing should be rendered in a grid. Ensure that your console window is wide enough so that the grid does not wrap. |
false |
g |
gridwidth |
The maximum width of the grid. You can use this value if you want to limit the width of the grid display (for instance, when you have a smaller display). Note: If you specify a smaller width, the grid might not fit within the width. This is applicable when grid is true. |
100 |
gw |
includesummary |
A true/false flag that, when set to true, causes a summary report to be printed. |
false |
is |
showall |
A true/false flag that, when set to true, displays all the warning and errors from a trusted third party API. If you are trying to deploy an application that uses APIs from trusted third parties, it is recommended that you set this flag to true. |
false |
sa |
Using the Whitelist Tool
In this example, we’ll test the file benefits.war
, which is on the local file system in the D:\\Applications
folder, and send the log, as file called benefits.log
. to the folder C:\\java_logs
.
To use the Whitelist tool and specify a path for the log file, do the following:
-
Locate the JAR files, deployable archives (WAR or EAR), or exploded directories you want to check.
-
Open a command prompt and navigate to the
SDK_HOME\lib
directory (whereSDK_HOME
is the Oracle Java Cloud Service - SaaS Extension SDK installation directory; for example,D:\oracle_javacloud_sdk 15.1.2\oracle-javacloud-sdk\lib
. -
Run the Whitelist tool by entering:
./whitelist -log C:\\java_logs\benefits.log D:\\Applications\benefits.war
A check of
C:\\java_logs\
shows the filebenefits.log
:
Description of the illustration java_logs.gif
./whitelist D:\\Applications\benefits.war -grid
The system would respond:Description of the illustration java_logs_grid.gif