• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to RE-start tomcat in eclipse

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using eclipse LUNA. I have a client-server application wherein the client sends pings after every 1 minute to the server. The server has a servlet which responds to this ping with an OK in an ACK header which it adds to the response. I want to test failover of the server. i.e. If my server fails, and another server takes its place, the client pings this new failover server and it responds to this ping. To do this, I have copied my servlet project in two workspaces. Each has a separate server (apache tomcat 6). I run the first project, then run the client. It sends a ping to this server and sleeps for 1 minute. I then shutdown the first server and run the second project on a separate server which is also ANOTHER COPY of apache tomcat 6. This server is not able to start. I also tried increasing the server startup timeout fom 45 to 60. Any suggestions as to what am I missing?
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Shalakha!

If you want to use Eclipse to debug 2 discrete Tomcat instances, you have to do things properly.

Running 1 Tomcat Eclipse instance isn't too hard - at least unless the WTP plugin makes it hard. Eclipse can automatically launch the first Tomcat instance.

The second Tomcat is trickier, because "run on server" assumes that you're launching the first instance of Tomcat. So instead you have to launch the second Tomcat stand-alone and use the Remote Debug feature of Eclipse to connect to it. In fact, for best results, you should avoid the "run on server" menu option and launch both Tomcat instances stand-alone.

Note that you cannot simply run Tomcat twice since one and ONLY one program can own an TCP/IP listener port (or in Tomcat's case, ports). So you have to use an alternate server.xml that overrides the default Tomcat port assignments. For example, 8180 instead of 8080 and so forth.

You also have to observe this rule for the port that the JVM will be listening on for debugging purposes. In other words, launch each Tomcat with a unique debug port ID.

This question, incidentally, doesn't involve servlets, so I'm moving it to the Tomcat forum.
 
shalakha sidmul
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Note that you cannot simply run Tomcat twice since one and ONLY one program can own an TCP/IP listener port (or in Tomcat's case, ports). So you have to use an alternate server.xml that overrides the default Tomcat port assignments. For example, 8180 instead of 8080 and so forth.



I am using two separate instances of tomcat. At a given time, I am running only one server. So I think the problem of ports is not the issue. If I run the first server, shut it down and then try to start the second server, it works fine. The problem is... If i run the first server then run the client and then shut down the first server, I am unable to start the second server if the client is still running.
I am not persisteing anything in the server. It just receives a ping and sends a response back.
 
Tim Holloway
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first thing I'd recommend, then is to not run either of those servers under the control of Eclipse. Run them stand-alone.

Second, look at the logfiles and particularly the "localhost" and "catalina.out" files for each server.

Tomcat writes out exensive details of its startup and app deployment processes and they are the definitive way to see if/when a server has started - and if not, usually can help you determine why it didn't.
 
shalakha sidmul
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot for your help!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic