Setting Up for Debugging Advanced Controls

You debug a packaged custom Java control by creating a separate project as a test project. You then build your control project. By specifying certain debugger settings for your control project you can set break points in your control source code (including IDE extensions such as attribute validation dialogs and insert wizards), then run it as you would other source code.

When debugging, you are running two instances of the WebLogic Workshop IDE -- a debugging instance containing your control source with breakpoints, and a client instance containing a project in which you're testing the built control. The client instance is started for you when you begin debugging if you have specified the correct debugging properties in your control project.

Note that as you use the debugger, stepping through your control code with both instances of the IDE open, the IDE will not automatically switch between instances as the code executes. For example, if you have reached a point in the code where the client instance is displaying a prompt dialog, you may need to switch from the debugging instance to the client instance in order to respond to it and continue debugging.

Keep in mind that you can write debugging information in messages to a log file. See the EditorContext interface for its getLogPrintStream method. By default, this method writes to the ide.log file in the workshop folder of your WebLogic Server installation.

For an example of debugger settings, see the project properties for the ControlFeatures project included in the ControlDevKit sample application.

Debugger Settings Required for Debugging IDE Extensions

When setting up for debugging, begin by ensuring that the properties for the control project you're debugging specify the following values on the Debugger pane.

To Specify IDE Extension Debugger Settings

  1. In WebLogic Workshop, in the Application window, right-click the folder for your control project, then click Properties.
  2. In the Project Properties dialog, in the left pane, click Debugger.
  3. Specify the following values for debugger properties:
Option Value
Create new process Selected
Attach to process Cleared
Main class workshop.core.Workshop
Parameters <Empty>

VM parameters

When debugging with 8.1 GA:

-ea -Xmx512m -Xms128m -Dsun.java2d.d3d=false -Dworkshop.home=../workshop

When debugging with 8.1 SP2 and later:

-ea -Xmx512m -Xms128m -Dsun.java2d.d3d=false -Djava.system.class.loader=workshop.core.AppClassLoader

Home directory <WebLogic Workshop home directory — automatically set by the installer>
Application classpath <Must include wlw-ide.jar — automatically set by the installer>
Automatically append Library JARs Selected
Automatically append server classpath Selected
Smart debugging Selected
Build before debugging Selected
Pause all threads after stepping Cleared

Related Topics