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.
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.
- Go to the Oracle Java Cloud Service console, and select the service instance that you want to enable the JVM debug port for.
- In the service menu, click Open WebLogic Server Administration Console.
- 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.
- In the Change Center pane, click Lock & Edit.
- 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.
- In the Servers table, click the name of the server running your application.
- Go to the Server Start tab.
- 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
- Make a note of the debug port address that you specified (
8457in this example). You’ll need this address in the next task.
- Click Save.
- In the Change Center pane, click Activate Changes.
- In the Domain Structure pane, expand Environment, and click Servers.
- Go to the Control tab.
- In the Servers table, select the check box next to the server running your application.
- 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.
- 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.
- Navigate to the Oracle Java Cloud Service console
- Click the 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.
- Click Create Rule.
The Create Access Rule dialog is displayed.
- 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
- Specify PUBLIC-INTERNET for the rule source.
- Specify WLS_ADMIN_SERVER or WLS_MANAGED_SERVER depending on the server type where you set up the debug port.
- The destination port should match the address you set up for the debug port. In our example this would be
- Set the protocol to TCP.
- Now click Create to create the new rule.
The Access Rules page displays your new rule.