Debugging Applications

 <  Day Day Up  >  

Workshop provides a number of debugging tools to pinpoint the source of undesired application behavior that's revealed during Test Browser sessions.

Setting Breakpoints

Debugging is made possible through breakpoints that halt program execution just before the code where they are set. You can use these breakpoints to examine the call stack or variables . Table 2.5 summarizes the four types of breakpoints you can set in Workshop.

Table 2.5. Types of Breakpoints Supported by WebLogic Workshop

TYPE

USE

HOW TO SET UP

Line

Break at a specific line of code

Click in the gray margin to the left, next to the code line where you want to set the breakpoint. A red circle appears, indicating that the line breakpoint is set.

Exception

Break when a specific exception or subclass occurs

Select Debug, Create Breakpoint from the main menu. Then, choose the Exception breakpoint option button and fill in the fields appropriately.

Method

Break when a method is called

Select Debug, Create Breakpoint from the main menu. Then, choose the Method breakpoint option button and fill in the fields appropriately

JSP taglib

Break when selected taglib methods are called

In the JSP file's Source View, right-click and select Taglib Breakpoints.

Clearing and Disabling Breakpoints

You can remove individual line breakpoints by clicking them again in the margin. Workshop also allows you to clear all breakpoints by choosing Debug, Clear All Breakpoints from the main menu. If you would like the breakpoint temporarily disabled without being removed, select Debug, Disable All Breakpoints from the main menu.

Debug Windows

After setting breakpoints and restarting the application, six additional debug panes are visible in the Workshop window. Table 2.6 summarizes these panes and their uses.

Table 2.6. Debug Panes Provided by WebLogic Workshop

DEBUG PANE

USE

Locals

Shows the variables in scope as code runs

Watch

Tracks the value of set variables throughout application execution

Streams

Used to debug JSPs; shows the output stream intended for browsers

Immediate

Allows execution of arbitrary code during debugging; restrictions include no object creation

Callstack

Shows the hierarchy of methods called to reach the breakpoint

Threads

Shows data on currently running threads

Continuing Execution

When the first breakpoint is hit, there are four options to continue running the application, all of which are available from the Debug menu and on the toolbar. Table 2.7 summarizes these options.

Table 2.7. Options for Continuing Execution from a Breakpoint

CONTINUE OPTION

BEHAVIOR

Step Into

Executes a single line of code

Step Over

Executes this method call without debugging its code

Step Out

Finishes execution in the current method without debugging and returns to the calling method

Continue

Resumes running of application until the next breakpoint

SHOP TALK : DOES WORKSHOP TIE YOU TO A PROPRIETARY PLATFORM?

As you take a first look at BEA WebLogic Workshop, I want to clear the air on one matter. Since the introduction of WebLogic Workshop, some in the industry have questioned whether using Workshop ties you to a proprietary platform. To that end, I would like to share some observations that will, I hope, ease these concerns:

  1. WebLogic product capabilities are grounded in industry standards.

    Building blocks of applications in WebLogic Workshop include standard-compliant J2EE components, such as JDBC data sources, JMS queues and topics, and EJBs. As another example, the Java Page Flow technology for linking Web components is based on Struts, an open -source project by Apache that has grown in favor in the industry.

  2. All key innovations introduced in WebLogic Workshop are on their way to standardization.

    In the area of Web services, BEA is leading the charge for standardization of JSR181, Web Services Metadata for the Java Platform, through the Sun Microsystems Java Community Process. Also, BEA is working on standardizing the Java syntax and APIs for programming business processes in JSR207. Last, BEA has donated its XML Beans technology ”for intuitively representing XML data as Java objects ”to the Apache Software Foundation for further evolution by the developer community.

    For more information on Sun's Java Community Process and the Java Specification Requests under review, please see the following Web site:

    http://jcp.org/en/jsr/overview

  3. The belief that Workshop applications aren't portable is unfounded.

    You can build 100% standards-compliant applications in Workshop with J2EE components. The annotations that Workshop uses to identify objects in the visual environment are in the form of javadoc comments and don't interfere with compilation outside the Workshop environment. As the specifications mentioned previously are released, more advanced features will enter the standards fold.

  4. Proprietary features have their advantages.

    If you or your company has or is making an investment in WebLogic products, there's no reason you shouldn't use all the tools you have available to get the best return on that investment. Workshop is the most powerful tool in the WebLogic toolbox, and its capabilities to transform standard Java developers into enterprise application J2EE developers and to give existing J2EE developers a means for rapid application development cannot be overlooked. By the end of this book, I hope you'll agree.


 <  Day Day Up  >  


BEA WebLogic Workshop 8.1 Kick Start
BEA WebLogic Workshop 8.1 Kick Start: Simplifying Java Web Applications and J2EE
ISBN: 0672326221
EAN: 2147483647
Year: 2004
Pages: 138

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net