If you're a WebLogic or WebSphere user and use the Java 2 security model, our Java agent requires configuration in addition to the Java agent installation.
WebLogic: Java 2 Security
If you're using Java 2 security, add the following entry to weblogic.policy
to complete installation:
grant codeBase "file:YOUR_FULL_PATH_TO_FILE/newrelic/-" { permission java.security.AllPermission; };
Specify the directory containing newrelic.jar
in /full/path/to/newrelic
. The default policy file location is weblogic_root/server/lib/weblogic.policy
.
WebSphere: Java 2 Security or Administrative Security
If you are using Java 2 Security or WebSphere Admin Security, you must grant all jars inside the New Relic install folder the proper permissions.
To enable New Relic for all app servers, edit the java.policy
file:
Open your
java.policy
file, located inside your WebSphere install directory at:YOUR_WEBSPHERE_INSTALL_DIRECTORY/java/jre/lib/security/java.policyAppend the following text to your policy file, customizing the
file:
path to point to the folder containingnewrelic.jar
. Ensure you preserve the dash-
at the end of the path, which grants all jars in the target folder the necessary permissions.grant codeBase "file:/YOUR_FULL_PATH_TO_NEW_RELIC_FOLDER/-" {permission java.security.AllPermission;permission java.net.NetPermission "specifyStreamHandler";permission java.net.SocketPermission "*.newrelic.com", "connect,accept,resolve";};Importante
The
codeBase
value must use slashes, not backslashes, as the directory separator, even on Windows systems.Restart your application server.
Sugerencia
For each app, Java security permissions are determined by the union of java.policy
and server.policy
. Do not put the same permission settings in multiple files.
For more on policy file syntax, see Default policy implementation and policy file syntax.