If your ATG application is hosted on weblogic, you have to enable the debugging mode on weblogic, and then use eclipse to debug it.
1. Enable Debugging on Weblogic
a. Open your WEBLOGIC directory
b. Open the domains folder
c. Open the folder of your atg domain
d. Open the bin folder
You path should look somewhat like: D:\Oracle\Middleware\domains\atg11\bin
e. Backup the file startManagedWebLogic.cmd
f. Now, open this file with a text editor
g. Find the line set JAVA_OPTIONS=
h. At the end of the line, replace the %JAVA_OPTIONS%
with
If this is done correctly, your server startup logs should display, that it is listening at the above port. See below screenshot.
2. Configure Eclipse for Debug
Make sure your that the server you want to debug is running.
a. Open your codebase
b. Click on RUN -> Debug Configurations
c. This will open a window.
d. In the left pane, right click on Remote Java Application and click New.
e. Fill in the name, select the project which you want to debug. Set the host to localhost, set the port to 8989 (or if you are using some other port, fill it in).
f. Click on "Apply" and then "Debug".
g. This will start the debug mode on your ATG application.
h. You can also go to "Window" -> "Perspective" -> "Open Perspective" -> "Debug" to see the Debug View in eclipse.
Now, you can include breakpoints in your code to debug your application.
1. Enable Debugging on Weblogic
a. Open your WEBLOGIC directory
b. Open the domains folder
c. Open the folder of your atg domain
d. Open the bin folder
You path should look somewhat like: D:\Oracle\Middleware\domains\atg11\bin
e. Backup the file startManagedWebLogic.cmd
f. Now, open this file with a text editor
g. Find the line set JAVA_OPTIONS=
h. At the end of the line, replace the %JAVA_OPTIONS%
with
-Xdebug -Djava.compiler=NONE -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8989,suspend=n %JAVA_OPTIONS%
i. Now, start the server (using this file). You can see more info on starting the server HERE.If this is done correctly, your server startup logs should display, that it is listening at the above port. See below screenshot.
The port 8989 highlighted above is being used as the debug port here. You can use any port you wish, as long as it is not being used by any other process.
2. Configure Eclipse for Debug
Make sure your that the server you want to debug is running.
a. Open your codebase
b. Click on RUN -> Debug Configurations
c. This will open a window.
d. In the left pane, right click on Remote Java Application and click New.
e. Fill in the name, select the project which you want to debug. Set the host to localhost, set the port to 8989 (or if you are using some other port, fill it in).
f. Click on "Apply" and then "Debug".
g. This will start the debug mode on your ATG application.
h. You can also go to "Window" -> "Perspective" -> "Open Perspective" -> "Debug" to see the Debug View in eclipse.
Now, you can include breakpoints in your code to debug your application.
No comments:
Post a Comment