
WEBSPHERE STRATEGIES FOR ISERIES PROFESSIONALS
Options for debugging Java applications
Jim Mason 01.10.2002
Rating: -3.50- (out of 5)




|
Debugging applications isn't usually an important consideration when you're deciding on application architectures or requirements. It's one of those items that becomes critical during development if you haven't planned ahead. With Java, iSeries developers usually have a good choice of debugging options. You can select the one that best fits your debug requirements. Debugging Java applications is a LARGE topic. This tip points out your options and some considerations for getting started.
Your options for debugging depend on the following:
Development or deployment debugging requirement?
During the application development cycle I usually choose the VisualAge for Java IDE debugger, which is easy to use and offers complete application control. During deployment testing, I choose either the traditional iSeries command line debugger OR the new IBM Distributed Debugger.
Mapping Java application types to debug options
Welcome to Adobe GoLive 5
[TABLE] |
Notes:
Handling optimized Java classes
Debugging Java applications is different than with other types of applications. Java applications are USUALLY more effectively debugged when the Java application is composed of non-optimized class files. For iSeries, you have the option of using the Java transformer to optimize your Java classes which removes most debug information. You can choose to recompile the classes and specify a lower optimization level (00 or 10). For WebSphere Application Server, you choose the debug level for Java classes that are compiled (e.g., JSPs) by WebSph
To continue reading for free, register below or login
To read more you must become a member of Search400.com
');
// -->

ere at the application server level. You can set the debug level as an option during configuration on a specific application server instance.
iSeries standard debug support
This debugger is invoked from the 5250 command line. It allows setting breakpoints, stepping through an application and inspecting values in an application. It can be used to debug WebSphere classes and can use the STRSRVJOB capability from another job.
The iSeries debugger doesn't need to be installed, since it is a part of the platform for a given OS/400 version.
IBM VisualAge for Java integrated debugger
This debugger adds support for changing code dynamically and visually tracing JSP source execution. It is great during development.
The VisualAge debugger is automatically included with VisualAge in the IDE and doesn't require any setup (nice).
IBM Distributed Debugger
With the distributed debugger you also have the option to do the following:
To attach to an application on another system, a debug daemon has to be running on the server.
Configuring the debugger is NOT a simple task for a new developer. Don't get too frustrated.
The IBM Distributed Debugger is now included with all new releases of IBM Java development tools. It is an optional component that you have to separately install and configure.
What debug features do you need?
The features available depend on the debug tool you use. All the debuggers support step execution of Java code, setting variable watches to see values of variables. The Distributed Debugger also has built-in tracing support with graphical output that can be helpful.
The VisualAge debugger is integrated with the editor so you can change your code DURING debug and have the changes saved. That's a very productive feature during development.
The VisualAge debugger offers a JSP execution monitor that shows your JSP source running side by side with the generated Java servlet code. It's hard to debug generated WebShere servlets when the source is somewhat cryptic. This makes it easy to debug your JSPs.
Debugger recommendations
Which is the easiest environment to debug with?
In my opinion, hands down it is the VisualAge for Java integrated debugger. It even works for servlets and JSPs when you run them in the WebSphere Test Environment.
Where possible, use the VisualAge debugger for development with VisualAge, WebSphere Studio or other IDEs. (You can import your Java code into VisualAge.)
Which is the best to debugger for applications running on the iSeries?
It depends on your skill sets. If you're an iSeries developer, running the existing iSeries debugger on Java classes makes sense. It's not too hard to do. If you're a Java developer with no real iSeries skills, try the Distributed Debugger. You may need some help with iSeries configuration parameters, but it should be easier to get started here.
What's the future of debugging Java applications?
For IBM, the Distributed Debugger will probably be the tool of choice. VisualAge will evolve into the new WebSphere Studio Application Developer over time, and its debugger will be changed in the new tool. The iSeries debugger is limited to the iSeries and can't work with remote applications such as the Distributed Debugger. Again, for developers new to the iSeries, the Distributed Debugger is probably a better investment. For experienced iSeries developers, the existing debug tool should be faster to use even though it is "green screen."
--------------------------
About the author: Jim is president of ebt-now.com, an IBM and Lotus business partner focused on delivering e-business application solutions for iSeries 400 customers. Jim writes, consults, teaches, designs and develops iSeries Web applications using Java, WebSphere, DB2, Lotus Domino and the WebSphere Development Tools for the iSeries.
=======================
MORE INFORMATION
=======================

|