Troubleshooting
Problem
Learn how to set up IBM System i GUI debugger or WebSphere Development Studio client Integrated debugger for Java debugging.
Resolving The Problem
Method 1
To debug a Java application on the IBM System i system is to use the System i GUI debugger, do the following:
Step 1: To start this debugger, go to the iSeries Navigator (V5R3 and later) ->{your system}->Database->{your system/DB}, and right-click on this do Run SQL Scripts.
Note: If you are running on V5R4 or later and you are running the IBM Technology for Java JVM, you must add the debugsourcepath environment variable:
ADDENVVAR ENVVAR(DEBUGSOURCEPATH) VALUE('your_class_source_path')
'your_class_source_path' stands for the location of the class source file.
Step 2: Click on the toolbar Run->Debugger. Choose Type as Class File, and specify Classpath. See the following example:
Step 3: To submit the job, click OK. A window showing the source is shown (see following example).
Step 4: Enter a Service Entry Point by going to the Console Tab and typing SBREAK {some executable line number}.
Step 5: Now that a break point is set, run the job on the System i system that invokes the Java program. The service entry point will get set. Refer to the following example:
Note: If you are running the IBM Technology for Java JVM you must start the java program with parameter 'agtpgm' and value
d9ti, the command would look something like this:
JAVA CLASS(TimeTest) CLASSPATH('/home/pauls') AGTPGM(D9TI)
When the break point is encountered the debugger you will see the following message box:
Step 6: Click Yes, and you will see the following window:
Note: If you are running the IBM Technology for Java JVM, you will notice that you will not see the second "start
debug" dialog after the application hits the service entry point. Once you click Yes to debug the job, the debug window showing the
source should come up with the program stopped at the breakpoint. This is a change at V6R1.
Step 7: Type the class and classpath again. The job will already be filled in. Click OK.
Step 8: At this point, you can use the debugger as usual to evaluate variables, step over, and so on.
Method 2
To set up iSeries GUI debugger or WebSphere Development Studio client Integrated debugger for Java debugging, do the following:
1. | Go in the WebSphere Development Studio client, and click on the Bug in the toolbar. |
2. | Select Debug. |
3. | Right-click on Java Application on iSeries Server. |
4. | Click New. A screen is shown requiring you to type the classpath and class information. Or, click on Browse, and go to the Remote File System to find the class files. |
Advantages/Disadvantages for Each Method
Method 1: Allows you to debug the entire application on the iSeries. If you have a System i job that has invokes the JVM, you can debug that directly. The only disadvantage is that the debug does not provide a browse option to go in and pull in the path to the Java class you want to debug
Method 2: Debugs only a new job. Therefore, to pass in several large parameters, you will have to manually type those or edit them while in debug. There is very little integration with the System i system. The advantage is that the debug can be set up quickly if you are already in WebSphere Development Studio client and want to run a debug quickly.
If you have problems with the WebSphere Development Studio client debugger, try the System i GUI debugger (Method 1).
Historical Number
446626879
Was this topic helpful?
Document Information
Modified date:
18 December 2019
UID
nas8N1014447