Enable the JVM Debug Port on an Oracle Java Cloud Service Instance

Opening a JVM debug port on your Oracle Java Cloud Service nodes will enable you to debug applications remotely from an IDE running on your local machine.

Note:

You will need direct access to the IP address of the server running your application.

Topics

Set Up the Debug Port in WebLogic Server

To set up the debug port in WebLogic Server, you must update the server’s start-up parameters and then restart the server.

  1. Go to the Oracle Java Cloud Service console, and select the service instance that you want to enable the JVM debug port for.
  2. In the service menu, click Open WebLogic Server Administration Console.
  3. On the Welcome screen, enter the administrator login credentials.
    If you did not create the service instance, ask your Java Administrator for the login credentials.
  4. In the Change Center pane, click Lock & Edit.
  5. In the Domain Structure pane, expand Environment, and click Servers.
    A list of available servers is displayed.

    Note:

    Make sure that you are on the Configuration tab.
  6. In the Servers table, click the name of the server running your application.
  7. Go to the Server Start tab.
  8. Append the following in the Arguments field. Make sure there are no line breaks when you copy and paste these arguments.
    -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8457,server=y,suspend=n
  9. Make a note of the debug port address that you specified (8457 in this example). You’ll need this address in the next task.
  10. Click Save.
  11. In the Change Center pane, click Activate Changes.
  12. In the Domain Structure pane, expand Environment, and click Servers.
  13. Go to the Control tab.
  14. In the Servers table, select the check box next to the server running your application.
  15. Click Shutdown, and select Force shutdown now. When prompted for a confirmation, click Yes.
    Wait for the state of the server to change to SHUTDOWN. Refresh the page to view the current state.
  16. Select the check box next to the server, and click Start. When prompted for a confirmation, click Yes.
    Wait for the state of the server to change to RUNNING. Refresh the page to view the current state.

Create an Access Rule for the Debug Port

You will need to create an access rule so that messages to and from your local debug session will be accepted by the Oracle Java Cloud Service node hosting the application that you want to debug.

You will use the Oracle Java Cloud Service console to create the access rule.

If you provisioned this service instance in an Oracle Cloud Infrastructure region, instead you must use the Oracle Cloud Infrastructure Console to create the access rules (security list). See Security Lists in the Oracle Cloud Infrastructure Services documentation.

  1. Navigate to the Oracle Java Cloud Service console
  2. Click the Menu icon Menu icon adjacent to the service instance name and select Access Rules.

    The Access Rules page is displayed, showing the list of all access rules.

  3. Click Create Rule.

    The Create Access Rule dialog is displayed.

  4. Specify a unique Rule Name. Optionally specify a rule Description.

    The name must begin with a letter, and can contain numbers, hyphens, or underscores. The length cannot exceed 50 characters. When you create a rule, you cannot use prefixes ora_ or sys_.

  5. Specify PUBLIC-INTERNET for the rule source.
  6. Specify WLS_ADMIN_SERVER or WLS_MANAGED_SERVER depending on the server type where you set up the debug port.
  7. The destination port should match the address you set up for the debug port. In our example this would be 8457.
  8. Set the protocol to TCP.
  9. Now click Create to create the new rule.

The Access Rules page displays your new rule.