Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Bug#137822
Bug#137822 [message #228948] Sat, 14 March 2009 02:39 Go to next message
Xia Jun Shi is currently offline Xia Jun ShiFriend
Messages: 15
Registered: July 2009
Junior Member
I am working on the bug 137822. I got the code which throw the exception.
See: http://xiajunshi.wordpress.com/

publishServer(kind, ProgressUtil.getSubMonitorFor(monitor, 1000));

This is the code to throw the exception which is located in
publisher(int,IProgressMonitor) of ServerBehaviorDelegate.java. I am
wondering which value of the variables "kind" and "monitor"should be so
that the server is lanched properly or something is published on the
server correctly by debugging mode. If I want to want to lanch the server
properly by debugging mode, which variables and values should I focus on
to check?

I hope I can get some hints on how to lanch a server properly by debugging
mode. Thanks for any help.
Re: Bug#137822 [message #228969 is a reply to message #228948] Sat, 14 March 2009 17:54 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Xia Jun Shi wrote:
> I am working on the bug 137822. I got the code which throw the
> exception. See: http://xiajunshi.wordpress.com/
>
> publishServer(kind, ProgressUtil.getSubMonitorFor(monitor, 1000));
>
> This is the code to throw the exception which is located in
> publisher(int,IProgressMonitor) of ServerBehaviorDelegate.java. I am
> wondering which value of the variables "kind" and "monitor"should be so
> that the server is lanched properly or something is published on the
> server correctly by debugging mode. If I want to want to lanch the
> server properly by debugging mode, which variables and values should I
> focus on to check?
>
> I hope I can get some hints on how to lanch a server properly by
> debugging mode. Thanks for any help.
>

Hi,

I'm afraid these variables aren't related to that bug. Here it another
set of steps that illustrates the problem better than what is given in
the bug. Note that a webapp isn't necessary.

1. Create new Tomcat Runtime and Server.
2. Execute Run -> Run Configurations (or Debug Configurations)
3. Right-click Apache Tomcat and select New
4. Select the Arguments tab and note that the "Program arguments" and
"VM arguments" fields are empty!

The empty "Program arguments" and "VM arguments" fields is the bug.
Executing this launch configuration in its current state is doomed to
fail, as you have seen. To see what should be there, continue with the
following steps.

5. Click Close to exit the Configurations dialog.
6. Double-click on the Tomcat server in the Servers view to open the
server editor.
7. In the server editor, click on the "Open launch configuration" link
in the General Information section.
8. Select the Arguments tab and note that the "Program arguments" and
"VM arguments" fields are no longer empty!

The launch configuration is now complete and can be run successfully.

Obviously, step 3 isn't doing something that step 7 is doing. The code
that executes for step 3 needs to include a call to
setupLaunchConfiguration(), or something equivalent, which is what step
7 is doing to set those fields. For Tomcat, it is
TomcatServerBehavior.setupLaunchConfiguration() where the real work is
done to set the values of those fields. Unfortunately, I'm not that
familiar with what actually gets executed in step 3 to say much about
how to hook in the extra handing that is needed.

Cheers,
Larry
Re: Bug#137822 [message #229009 is a reply to message #228969] Mon, 16 March 2009 00:54 Go to previous messageGo to next message
Xia Jun Shi is currently offline Xia Jun ShiFriend
Messages: 15
Registered: July 2009
Junior Member
Hi Larry,

Thanks a lot, it helps.

BTW, do you know whiche packag the method
TomcatServerBehavior.setupLaunchConfiguration() belongs to?

Do you have any other suggestions to invoke this configuration or debug
this bug?

Sheeley
Re: Bug#137822 [message #229039 is a reply to message #229009] Mon, 16 March 2009 13:23 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Xia Jun Shi wrote:
> Hi Larry,
>
> Thanks a lot, it helps.
>
> BTW, do you know whiche packag the method
> TomcatServerBehavior.setupLaunchConfiguration() belongs to?
>
> Do you have any other suggestions to invoke this configuration or debug
> this bug?
>
> Sheeley
>

TomcatServerBehavior is in the org.eclipse.jst.server.tomcat.core
plug-in in the org.eclipse.jst.server.tomcat.core.internal package. To
investigate, the org.eclipse.debug.ui.launchConfigurationTabGroups
extension point declared in the plugin.xml of the
org.eclipse.jst.server.tomcat.ui plug-in defines the set of tabs that
appears in the dialog for Run -> Run Configurations -> Apache Tomcat ->
New and clicking the "Open launch configuration" link in the server
editor. You can put breakpoints in the associated classes to see what
code invokes them in those two use cases. Hopefully you will be able to
determine what needs to be done for Run -> Run Configurations -> Apache
Tomcat -> New to make it accomplish the same thing as the "Open launch
configuration" link.

Cheers,
Larry
Re: Bug#137822 [message #229940 is a reply to message #229039] Thu, 02 April 2009 14:35 Go to previous messageGo to next message
Xia Jun Shi is currently offline Xia Jun ShiFriend
Messages: 15
Registered: July 2009
Junior Member
I think that there is a way to quick fix the bug 137822 which is to
disable the "Run" button if the arguments of VM and Program by using "Run
-> Run Configurations -> Apache Tomcat -> New ->Arguments" are empty.

Somebody knows which method will create this "Run" button and which method
is invoked when I click the "Run" button?
Re: Bug#137822 [message #229958 is a reply to message #229940] Thu, 02 April 2009 17:26 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Xia Jun Shi wrote:
> I think that there is a way to quick fix the bug 137822 which is to
> disable the "Run" button if the arguments of VM and Program by using
> "Run -> Run Configurations -> Apache Tomcat -> New ->Arguments" are empty.
> Somebody knows which method will create this "Run" button and which
> method is invoked when I click the "Run" button?
>

I'm not sure I would use the word "fix" with this approach, since it
only hides the problem. It would be odd behavior to create a new launch
and have the Run button disabled. Also, if the user adds a VM argument,
your algorithm fails because the launch is no more valid than it was
without the argument. Finally, "empty VM arguments == bad" is not
necessarily true for all servers. It is true for Tomcat server, so it
would need to be a Tomcat plug-in class that makes the decision about
the "Run" button. I doubt there would be an appropriate way to control
the state of the Run button from code locations that would know if the
VM arguments are good or bad. It would likely be simpler to have
clicking the Run button display an error dialog.

This approach still doesn't fix the problem and would tend to minimize
the "learning experience" you would get out of the exercise. I wouldn't
recommend taking such an approach until you have identified what the
problem with the code is and made an estimate about the difficultly of
fixing it.

Cheers,
Larry
Re: Bug#137822 [message #229965 is a reply to message #229958] Thu, 02 April 2009 18:49 Go to previous messageGo to next message
Xia Jun Shi is currently offline Xia Jun ShiFriend
Messages: 15
Registered: July 2009
Junior Member
Hi Larry,

Thanks a lot. I will try to figure out.

Cheers,
Shelley
Re:method for Run -> Run Configurations -> Apache Tomcat -> New [message #229980 is a reply to message #229039] Fri, 03 April 2009 04:55 Go to previous messageGo to next message
Xia Jun Shi is currently offline Xia Jun ShiFriend
Messages: 15
Registered: July 2009
Junior Member
Hi,

Anybody know which method will be invoked for "Run -> Run Configurations
-> Apache Tomcat -> New"?

I add some code to ServerLaucnConfigurationTab.createControl(Composite
parent) to get the server configuration before the server is added to the
servers. Then I click Run -> Run Configurations -> Apache Tomcat -> New,
there are two Apache Tomcate servers created with two different names
("New_cofiguration" and "Tomcat v6.0 Server at localhost").

However, this time the the VM and Programs two servers are filled with
arguments so I can run it without exception.

Cheers,
Shelley
Re:Already figure out [message #230041 is a reply to message #229980] Sat, 04 April 2009 12:43 Go to previous message
Xia Jun Shi is currently offline Xia Jun ShiFriend
Messages: 15
Registered: July 2009
Junior Member
Thanks. I already figure out why.
Previous Topic:XPath Builder?
Next Topic:Error with Automatic Updates
Goto Forum:
  


Current Time: Tue Mar 19 02:45:07 GMT 2024

Powered by FUDForum. Page generated in 0.01919 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top