Home » Language IDEs » ServerTools (WTP) » Tomcat 5.5 startup detection
Tomcat 5.5 startup detection [message #224838] |
Tue, 09 December 2008 04:15 |
Andres Kievsky Messages: 5 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'm trying to use WTP with Tomcat 5.5. and an existing application that
has been developed in another IDE. From Eclipse, the application deploys
and starts up just fine and works correctly, but the server view is stuck
in "Starting..." mode, well after the application and Tomcat have
completed their startup and are serving requests.
I've seen the FAQ and googled, but none of the solutions seem to apply -
it's not running in debug mode, there's nothing strange in the tomcat
installation, etc. I would really appreciate some help with this, even if
it's just a suggestion on what I can check to identify the problem,
because I'm not sure where to start.
Thanks,
- Andres N. Kievsky
|
|
|
Re: Tomcat 5.5 startup detection [message #224863 is a reply to message #224838] |
Tue, 09 December 2008 17:41 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
Andres Kievsky wrote:
> Hi,
>
> I'm trying to use WTP with Tomcat 5.5. and an existing application that
> has been developed in another IDE. From Eclipse, the application deploys
> and starts up just fine and works correctly, but the server view is
> stuck in "Starting..." mode, well after the application and Tomcat have
> completed their startup and are serving requests.
>
> I've seen the FAQ and googled, but none of the solutions seem to apply -
> it's not running in debug mode, there's nothing strange in the tomcat
> installation, etc. I would really appreciate some help with this, even
> if it's just a suggestion on what I can check to identify the problem,
> because I'm not sure where to start.
>
> Thanks,
> - Andres N. Kievsky
>
Which version of WTP are you using? Also, does the server exhibit this
behavior when no projects are added to it?
Cheers,
Larry
|
|
| | | | |
Re: Tomcat 5.5 startup detection [message #224962 is a reply to message #224947] |
Thu, 11 December 2008 14:36 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
Andres Kievsky wrote:
> Andres Kievsky wrote:
>
>> Larry Isaacs wrote:
>>> Assuming there is more than one, can you identify which project, when
>>> added, triggers the problem behavior? What is the context root
>>> specified for that project?
>
>> The context root is /
Technically you want to specify the "default" (i.e. ROOT) context, which
is done by specifying "" as the context root. WTP lets you specify "/",
which the Tomcat support will fix by changing it to "" in the published
server configuration.
>>, and it (correctly, from the application's point
>> of view) returns a 404 if you try to load it. That must be why it's
>> failing to detect the startup. I'll try changing it and see what happens.
In theory, any response should be fine, including 404's. I tried
creating an empty Dynamic Web Project with "" as the context root and
the ping worked fine. Does this experiment work for you too? If so, I
would be interested in finding you what in your web project causes the
ping to fail.
>
>> Regardless of the cause, I think the ping address/port/etc should be
>> configurable separately, what do you think?
The ping URL should always work. I don't think it should be possible to
configure it to something that would stop working if a project was added
or removed from the server. The advantage of the current URL is that
the Tomcat support guarantees there will be a default context on the
server. If a project isn't deployed as the default context, a default
context is provided. I think it would be more useful to figure out why
ping didn't work in your case and see if that can be fixed. The current
code which attempts to create a connection isn't all that sophisticated.
>
>> Thanks for the help so far,
>> - Andres.
>
> Modifying the application to return a fixed HTML in / worked. Do you
> know if there is someone I can talk to in order to add a patch to make
> the ping URL configurable?
I'm the primary committer for the Tomcat adapter in WTP, so that would
probably be me. As mentioned above, I think fixing ping with the
current URL would be more useful.
>
> Thanks!
> - Andres
>
|
|
| |
Re: Tomcat 5.5 startup detection [message #224994 is a reply to message #224970] |
Fri, 12 December 2008 13:43 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
Andres Kievsky wrote:
>> The ping URL should always work. I don't think it should be possible
>> to configure it to something that would stop working if a project was
>> added or removed from the server. The advantage of the current URL is
>> that the Tomcat support guarantees there will be a default context on
>> the server. If a project isn't deployed as the default context, a
>> default context is provided. I think it would be more useful to
>> figure out why ping didn't work in your case and see if that can be
>> fixed. The current code which attempts to create a connection isn't
>> all that sophisticated.
>
> I rechecked, and it wasn't a 404. Instead, there was a redirection loop.
> I have yet to debug the WTP code, but I just wanted to clarify it for
> you. Please let me know if there's more information I can give you.
The URL used doesn't end with a "/" so a redirection can be normal. Are
you saying it got in to a loop where it was continually redirecting? I
vaguely recall there being some setting available on the connection to
limit the number of redirects. At the moment, I have no idea what the
default would be.
Since it works for me using Tomcat 5.5 with it's default configuration,
I would be interested in any configuration changes you may have made
that might account for the problem. For example, is the HTTP connector
still using Coyote or something different?
>
> I'm a bit confused about why it shouldn't be configurable. What if I
> configured tomcat to start in a remote server and want to ping that
> address?
This could be useful once the WTP Tomcat adapter supported remote
servers. A patch to add remote server support would be welcome, but
would be a major undertaking.
> Maybe there's an apache with mod_rewrite in the middle. I can
> think of a few scenarios, but ultimately, it's obviously your choice;
> please correct me.
You are welcome to enter an enhancement request fro this in Bugzilla.
For this particular use case, I'm not sure how using an custom ping URL
would help overall. Apache would have to already be running since there
is no provision to start any server other than Tomcat. Thus, the
connection will be established immediately. I don't know how Apache
will react if it gets a request while Tomcat is starting up. If the
request fails early, then ping will need to be made smart enough to
realize that the response it got from Apache is telling it that Tomcat
isn't ready, rather that assuming any response means it's ok to proceed.
Making this work in a robust fashion could be challenging. I think
the current approach of pinging Tomcat directly would be a better way of
determining if Tomcat is running. For this use case, more useful would
be a way of feeding the Browser a customized URL for Run As -> Run on
Server. I'm not sure if this is what you are actually looking for.
Cheers,
Larry
>
> Thanks for your help!
>
> - Andres.
>
|
|
|
Goto Forum:
Current Time: Tue Sep 24 04:05:31 GMT 2024
Powered by FUDForum. Page generated in 0.04045 seconds
|