Chris Owens
Chris Owens

Reputation: 1137

How does Eclipse know if a Tomcat server is running?

I've run into an odd situation with Eclipse Luna on Centos. I have configured a Tomcat 7.0 server, using project metadata for the configuration file. (actually TomEE, but I don't think that should matter). When I start the server from within Eclipse, I can see in the console window that it starts up, and I can confirm that the server is running, by interacting with it, but the legend displayed in the Servers window never changes from "Starting....." to "Started", and Eclipse times out the start operation with, "The server failed to start within ... seconds."

How, normally, does Eclipse determine whether or not a server that it owns has started successfully? And what might be going on here?

[edited to add:] The same problem occurs with TomEE 1.7.1 and a recent TomEE 1.7.2-SNAPSHOT, and the Eclipse version is: Eclipse Java EE IDE for Web Developers.

Version: Luna Service Release 1a (4.4.1) Build id: 20150109-0600

Upvotes: 0

Views: 3305

Answers (2)

Chris Owens
Chris Owens

Reputation: 1137

My issue was that my server was configured not to listen on any http ports, only on https ports. The eclipse plugin wants to find an http port on which it can ping the server to see if it's running. If there is no http port configured, the plugin silently fails. This is probably a bug and I will report it... rather than silently failing, the plugin should complain about the lack of an http port.

More specifically, looking at the Eclipse plugin code at https://github.com/eclipse/webtools.servertools/blob/master/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatServerBehaviour.java around line 540 (look for the comment "//ping server for startup") I see that the plugin is looking for an http port on which it can ping the server to see if it is live.

Upvotes: 1

Guy Bouallet
Guy Bouallet

Reputation: 2125

There is a timeout option in seconds in the eclipse server configuration. If it is lower than required by default, you will run into this issue. Update it with a value which is reasonable for your application. Check this for further details.

Upvotes: 1

Related Questions