Stack Traces for Bug 244862 – WTP

April 12, 2009

After I recieved the email from Peter Liu who mentioned Tahereh’s working bug 244862, I take a quick look. I followed Davoud’s introduction to reproduce it. I catch several stack traces for the bug 244862 in different scenarios even though I don’t what we can do to fix the bug. Anyway I posted them so that other students may get some hints from the stack traces.

Stack Trace for creating a server

Stack trace for creating a server

Stack trace for creating a server

Stack Trace for Starting a server without any Started server

Stack stack for starting a server when there no started server

Stack stack for starting a server when there no started server

Stack Trace for Starting a Server with a Started Server

Stack Trace for starting server, publishing the server is failed

Stack Trace for starting server, publishing the server is failed

Stack Trace for Deleting Server Project from Package Explore

Delete the server project from package explore

Delete the server project from package explore

Stack Trace for Deleting Server from Server View


How does “Run as->Run configurations” work

April 6, 2009

As I tried to investigate the bug 137822 which is related to the server configuration, I got some idea about how the server configuration works. Anyway I posted some of my findings so that some other students may get some help from my findings to fix some other server related bugs (there are still some server-related bugs need to be fixed in the bug list.).

After Clicking the “Run -> Run Configurations”, the following steps are invoked:

  1. The configuration dialog is opened
  2. The content of the configuration dialog is created and filled with all the controls and actions .

    • Create the Viewer area with the event control and action
    • Create the Edit area with the event control, created the tab, filled the server combo from the tomcat server list in the server view
    • Initialize the values including the arguments in the tabs
    • Display the Run Configurations Dialog and be ready to catch any event including mouse and key activities
  3. Catch the Double Click event/ New_configuration action/Selected Item Change event, fire the actions
  4. Create instances including wc with a unique name such as “New configuration(1)”, configuration dialog and the group tabs, initialize the tab content.
  5. write the new configuration information to a file and update launch manager with the new configuration.
  6. Display the updated configuration dialog

Bug 137822 is fixed :)

April 4, 2009

It’s very happy to know that my fellow Le fixed the bug 137822 based on my posting. see Le’s post.

Anyway, I list some important classes and methods which related to the bug and web server. Some other person who worked on the web server tool may get some help or hint from my investigation.

  1. org.eclipse.debug.internal.ui.launchConfigurations is a important package in the plugin.

    • CreateLaunchConfigurationAction.performAction() — create wc with the unique name “New_Configuration(1)”,configuration dialog with all the tabs, set the default configuration for the dialog to be the new created wc .
    • LaunchConfigurationView.handleConfigurationAdded()
    • createLaunchConfigurationSelectionArea()
      (handler double click, display a tree of launch configurations that may select, and allow to create new configurations and delete, duplicate existing configuration)
    • LaunchConfigurationTabGroupViewer — create a viewer to display tabs for a launch configuration with Apply and Revert button.
    • LaunchConfigurationDialog (line 423(create),1055(open))
      create the launch configuration dialog
    • LaunchConfigurationTabGroupViewer.inputChanged
    • .LaunchConfigurationDialog (line 543) — catch selectionEvent, then call handleConfigurationAdded()
  2. org.eclipse.wst.server.ui.ServerLaunchConfigurationTab.performApply()
    (will get the server configuration “Tomcat 6.0”)
  3. org.eclipse.wst.server.core.internal.Server.getLaunchConfiguration(bool,IProgress) — bool is true, will create a new server.
  4. org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour.
    setLaunchConfiguration ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor) (set the tomcat arguments for the VM and Program)
  5. — catch Add, then launch fListener.launchConfigurationAdded(fConfiguration)
  6. org.eclipse.swt.Display.runDerredEvents() –Always called by Display to get any event including selection, mousedown etc.
  7. org.eclipse.jface.util.OpenStrategy.handlerEvent — catch all the event, mouseup,mousedown, etc. then call function
    . Keydown may invoke fireOpenEvent(new SelectionEvent(e))
    .Selection may invoke fireSelectionEvent(event); then may invoke firePostSelectionEvent(new SelectionEvent(e))

A little progress – bug 137822

April 3, 2009

Today I add following code to the line 132 of org.eclipse..server.ui.ServerLaunchConfigurationTab(), then I am able to get the arguments and run the server without exception.

server2.getLaunchConfiguration(true, null);
}catch(Exception ex){}

However, there are two Apach Servers created when I click the new once.

Because a new server instance will be created by using the name “Tomcat v6.0 Server at localhost” in the method server.getLauchConfiguration(true,null). So there is a problem to use server.getLauchConfiguration(true,null) to get the configuration.

A summary of investigation – bug 137822

April 2, 2009

I felt I was lost in the forest of the code when I try to use debug again and again. Anyway I write down I already knew on this blog to give a summary of my job. It may be easier to get a hint from somebody who stands out of the forest.

According to the suggestion from Larry Isaacs’s answer dated on March 16 of newsgroup( ). I copied the arguments from “Open launch configuration” link to the empty text area of “Run -> Run Configurations -> Apache Tomcat -> New -> Argument”, then click “Apply” button and “Run”, the server can run without any exception. Based on Larry’s suggestion and my investigation, there are four possible solutions about bug 137822:

1. When we new a tomcate server, the system set some default value for Program
and VM at the same time.
2. When we click the dropdown list and select one server, then click button
“apply”, the values are set at that time.
3. The system didn’t set values by using the above ways. When we click button
“run”, if the system can’t get any run time arguments, it just pop-ups a dialog
to say no available server rather than throwing a exception.
4. If the Program and VM arguments are empty, just disable the button “run”.

In order to investigate the bug, I found the related the class and method with the above solutions:
1.1 If “Run -> Run Configurations -> Apache Tomcat” is empty, then the method public void setDefaults(ILaunchConfigurationWorkingCopy configuration) of will be invoked first.
Those line of code is supposed to get the first server from the server combox and set the default sever; however, at this point, no server is selected and no server configuration is set.
1.2 If “Run -> Run Configurations -> Apache Tomcat” is not empty, when click the a server, then method public void createControl(Composite parent) of will be invoked. This method will created the server combox of Run configurations.

2. the apply button will invoke the method performApply() which in the package org.eclipse.wst.server.ui.ServerLaunchConfigurationTab.

Based on Larry Isaacs’s suggestion (newsgroup dated on april 4), solution 3 and 4 only hidden the problem. So we should get rid of them.

two ways to get stack trace — WTP

March 31, 2009

Ways to get the stack trace:
1. Set some break points on the source code. run it in debug mode. Once the break point was hit, right click Thread then click copy stack, then paste on any editor (such as notepad);
2. If there are some exception when running WTP, then go to Window-> Show View -> Other -> General -> Error log, then go the Error log view and double click any the error.

The package which I checked out-bug137822

March 27, 2009

I checked out several packages for bug 137822:


I think it’s a good start to reproduce them and take a look my stack trace first. I hope we can fix this bug together.