To configure the Java agent for NetBeans:
-
Open the NetBeans project.
-
Select Tools > Servers.
-
Select the server to which you want to add Contrast (for example, JBoss), and click on the Platform tab.
-
Add Contrast's JVM options to the VM Options field:
-javaagent:<YourContrastJarPath>
. Replace<YourContrastJarPath>
with the path to your Contrast JAR file. -
Select Run > Run Main Project, or right-click on the project and select Run.
-
A Contrast startup message should appear in the Server console. (Allow one to two extra minutes for server startup.)
-
Navigate to your application, and allow an extra minute for it to start up.
Run Contrast on GlassFish with NetBeans
To run Contrast on GlassFish with NetBeans:
-
In GlassFish, select the Services tab.
-
Under Servers, right-click on the GlassFish Server and select Start.
-
Wait for the server to finish launching.
-
Navigate to the GlassFish Server Administration Console (usually http://localhost:4848/).
-
After the console has finished loading, select Configurations > server-config.
-
Select JVM Settings.
-
Select the tab for JVM Options.
-
Replace
<YourContrastJarPath>
with the path to your Contrast JAR file and add the following JVM options:-javaagent:<YourContrastJarPath>
-
Select Save.
-
In NetBeans, right-click on the GlassFish Server and select Stop.
-
After the server has finished shutting down, right click on the project and select Run.
-
A Contrast startup message should appear in the GlassFish server log console. (Allow one to two extra minutes for server startup.) After GlassFish has finished the startup process, NetBeans will switch to the HTTP Server Monitor mode and open a new web browser.
-
Navigate to your application, and allow an extra minute for it to start up.