uCosminexus Application Server, Application Development Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Glossary]](FIGURE/GLOSS.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
Use a server management command to start the J2EE server in Debug mode.
- Code the following contents in the Developer-installation-directory\CC\server\usrconf\ejb\J2EE-server-name-to-be-debugged\usrconf.cfg file:
add.jvm.arg=-agentlib:jdwp=transport=dt_socket,server=y,address=debug-port-number,suspend=n
|
When using an environment set up with Development Environment Instant Setup, the debug/ port number is set as 3999.
- Use the server management command to start the J2EE server.
Execute the following server management command to start the J2EE server:
cjstartsv [J2EE-server-name-for-debug#]
|
- #
- When using an environment set up with Development Environment Instant Setup, secify cmx_InstantWebSystem_unit1_J2EE_01 for J2EE-server-name-for-debug.
For details on the cjstartsv command, see cjstartsv (Starting J2EE servers) in the manual uCosminexus Application Server Command Reference Guide.
Create the start configuration required for debugging.
- In the Project Explorer view, choose the project to be debugged, and then from the Eclipse menu bar, choose Debug As - Debug Configuration.
The Debug Configurations dialog box appears.
![[Figure]](FIGURE/ZU081000.GIF)
- From the tree displayed in the left pane, choose Remote Java Application, and then click
(New launch configuration) in the toolbar.
The page for creating the start configuration will appear in the left pane.
- Choose the Connect tab, and then specify the following contents:
![[Figure]](FIGURE/ZU081100.GIF)
Items |
Specified values |
Name |
Specify any optional name. |
Project |
Specify the name of the project to be debugged.# |
Connection Type |
Choose Standard (Socket Attach). |
Connection Properties |
Host |
Specify the host name of the J2EE server to be connected.
When using an environment set up with Development Environment Instant Setup, specify localhost. |
Port |
Specify the debug port number specified in the usrconf.cfg file.
When using an environment set up with Development Environment Instant Setup, specify the port number for the debug connection specified during set up or when changing the settings.
When standard setup of Development Environment Instant Setup is executed, specify 3999. |
- #
- When debugging an enterprise application project, set the project as blank, and then in Source tab - Source Lookup Path add the source to be used.
- Click the Close button.
When a dialog box Do you want to save the changes? appears, click the Yes button. The Debug Configurations dialog box will close, and the start configuration for debugging will be created.
Use Eclipse to execute debugging.
To execute debugging:
- In the Project Explorer view, open the Java source file of the project to be debugged, and set up a breakpoint.
- From the Eclipse menu bar, choose Run - Debug Configuration.
The Debug Configurations dialog box appears.
![[Figure]](FIGURE/ZU081200.GIF)
- Choose the created start configuration, and then click the Debug button.
Debug will start. When the J2EE application is executed and the breakpoint is reached, the Debug perspective will appear. In Debug perspective - Debug view, the start configuration of the Externally Start Server will appear.
- Note
- After performing debug from the Debug Configurations dialog box, the debug operation can be started again by choosing the start configuration from the drop down menu of
(Debug) in the Eclipse menu bar.
- Once debugging is complete in the toolbar of the Debug view, click
(Disconnect).
Debugging will end.
All Rights Reserved. Copyright (C) 2012, 2013, Hitachi, Ltd.