Configure the Java agent for NetBeans

To configure the Java agent for NetBeans:

  1. Open the NetBeans project.

  2. Select Tools > Servers.

  3. Select the server to which you want to add Contrast (for example, JBoss), and click on the Platform tab.

  4. Add Contrast's JVM options to the VM Options field: -javaagent:<YourContrastJarPath>. Replace <YourContrastJarPath> with the path to your Contrast JAR file.

  5. Select Run > Run Main Project, or right-click on the project and select Run.

  6. A Contrast startup message should appear in the Server console. (Allow one to two extra minutes for server startup.)

  7. 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:

  1. In GlassFish, select the Services tab.

  2. Under Servers, right-click on the GlassFish Server and select Start.

  3. Wait for the server to finish launching.

  4. Navigate to the GlassFish Server Administration Console (usually http://localhost:4848/ ).

  5. After the console has finished loading, select Configurations > server-config.

  6. Select JVM Settings.

  7. Select the tab for JVM Options.

  8. Replace <YourContrastJarPath> with the path to your Contrast JAR file and add the following JVM options:

    -javaagent:<YourContrastJarPath>
  9. Select Save.

  10. In NetBeans, right-click on the GlassFish Server and select Stop.

  11. After the server has finished shutting down, right click on the project and select Run.

  12. 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.

  13. Navigate to your application, and allow an extra minute for it to start up.