aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Trouble restarting Tomcat 6.0.30 with Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Trouble restarting Tomcat 6.0.30 with Eclipse" Watch "Trouble restarting Tomcat 6.0.30 with Eclipse" New topic
Author

Trouble restarting Tomcat 6.0.30 with Eclipse

Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

When I start Tomcat 6.0.30 from Eclipse, I can load localhost:8080, but if I stop Tomcat, and restart Tomcat, I cannot load localhost:8080.
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Why not?
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94



You got me! That is what I want to know.

Thanks - Bob
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

I can restart Tomcat from the command line, but not from Eclipse.
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Actually, I was fishing for a reason that may be suggested by an entry in a log file or console output. ItDoesntWorkIsUseless
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

I am afraid that I don't know enough about Tomcat to give any more info. The Eclipse console does NOT report any errors in the log file. Can you suggest anyways to diagnose this problem?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10255
    
    8

After you restart and hit http://localhost:8080 what do you get on the browser?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

Maneesh Godbole wrote:After you restart and hit http://localhost:8080 what do you get on the browser?


Upon failure the browser displays:

"Oops! This link appears to be broken.

Did you mean: localhost-­8080.­com"

Upon success the browser displays the Tomcat window.
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

Looking at the log files, it appears that when I start Tomcat from the command line, there is some activity that occurs that does not occur when I start Tomcat from Eclipse. The Eclipse startup does not display messages indicating:

Deploying web application directory docs
Deploying web application directory examples
Deploying web application directory host-manager
Deploying web application directory manager
Deploying web application directory ROOT

These messages appear when I start Tomcat from the command line but do not appear when starting Tomcat from Eclipse.


Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Eclipse only starts the web apps that it knows about (the ones in its workspace) and only those that you've told it to run. From the Servers view, right click on the server and select Add and Remove. You will see the list of projects configured to run.
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

Tom Reilly wrote:Eclipse only starts the web apps that it knows about (the ones in its workspace) and only those that you've told it to run. From the Servers view, right click on the server and select Add and Remove. You will see the list of projects configured to run.


Tom,

I am having trouble getting Tomcat to launch correctly from Eclipse. Starting the app comes later.

Thanks - Bob
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

When launching Tomcat from the command line, I go to the Tomcat/bin directory and run startup.bat, which works OK.

When launching Tomcat from Eclipse, I believe Eclipse uses bootstrap.jar from the Tomcat/bin directory, which doesn't work OK.
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
When you use http://localhost:8080, Tomcat by default runs the web application called ROOT. As I said, Eclipse only deploys the web applications that it knows about and that are configured to start. ROOT is not one of them.
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

When launching Tomcat from Eclipse, I get the following log: (This fails )



When launching Tomcat from the command line, I get the following log: (This works )




Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
As your logs show, Eclipse is starting Tomcat just fine. When you start Tomcat outside of Eclipse, Tomcat deploys the applications in its webapps directory. This includes the ROOT web application. When you start Tomcat from Eclipse, Eclipse provides to Tomcat a different webapps directory. This webapps directory does not have the ROOT web application. It only has the web applications that have been configured in Eclipse.
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

When I select Server>Tomcat>Add and Remove,

the only selections are my Java applications. There is not a "ROOT" app.
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
So we've established that Eclipse starts Tomcat just fine. Eclipse allows you to start Tomcat so it can help you debug your web application. What are you trying to accomplish? Is it to be able to type http://localhost:8080 rather than http://localhost:8080/yourWebApplication/ ?
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

Actually, the server seems to be starting OK, when I start the server indirectly by starting the app first. But starting the server first is still not working quite right. I am trying to understand this situation right now. I am trying to go through the various permutations to try to get a handle on it.
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

Yes, starting my java app, while the server is stopped, will start the server and the app seemingly fine. However, if I start the server, and then start my java app, the app will not start.

Starting the server directly from the Eclipse server window seems to be still messed up, but I can get around that now. I am probably going to continue to investigate to try to understand why though.

Thanks for your help Tom!
Robert Heath
Ranch Hand

Joined: Aug 11, 2010
Posts: 94

Tom Reilly wrote:So we've established that Eclipse starts Tomcat just fine. Eclipse allows you to start Tomcat so it can help you debug your web application. What are you trying to accomplish? Is it to be able to type http://localhost:8080 rather than http://localhost:8080/yourWebApplication/ ?


When I start the server from the Eclipse server window, I would like the page http://localhost:8080 to resolve.
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Well, I've never tried this but if you created an Eclipse project called ROOT I would think that it could be deployed in Eclipse and Tomcat would handle http://localhost:8080.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trouble restarting Tomcat 6.0.30 with Eclipse