views:

25

answers:

2

Hi all,

I am having a problem accessing Tomcat from the browser if it was invoked from Eclipse, but it works fine if invoked from command prompt. I have configured Eclipse to start Tomcat 5.5.23. It starts fine. If I try to connect to it at least to see the admin page using http://localhost:8081/ I get 404 error "The requested resource (/) is not available".

No logs are emitted in the logs folder which is very strange. If I invoke it from comman dprompt 9using startup.sh) I do get log files in logs. This is a new fresh install of Tomact from tomcat.apache.org. The console on Eclipse doesn't show any activity when attempting to access Tomcat, just the normal start up or Tomcat.

I didn't have problem using and connecting to Tomcat in Eclipse on Windows platform before but I have absolutely no clue why it is failing to do so on Linux?

Any help will be appreciated.

A: 

Are you sure Eclipse is configured to start the tomcat installation you currently starting manually?

There might be 2 installations, one shipped with eclipse and one other installed seperatly.

If so, it would be no wonder the admin-interface isn't accessable since -iirc- the admin-panel has to be installed afterwards.

stefan
Yes I am using the same installation, 100% sure.
Daniel
Ok, but maybe eclipse injects another configuration causing it to use another webapps-dir. This also leads to the admin-panel not being accessable.
stefan
You see,if I stop the server from Eclipse and try to access the admin page,I get the usual "Unable to connect" error message on the browser. That means it senses the existence of the Tomcat server from Eclipse, it just thinks the root context (/) is not available?
Daniel
It uses the same tomcat but the configuration can differ so the used webapps-dir could be different and in the eclipse-webapps-dir the admin is not installed.
stefan
A: 

If I try to connect to it at least to see the admin page using http://localhost:8081/ I get 404 error "The requested resource (/) is not available".

I don't know if this is the problem but 1. that's not the path of the admin application 2. it is actually not bundled with Tomcat 5.5. From the FAQ:

How do I install the Administration web app?

If you install Tomcat 5.5 binaries, the Administration web app is not bundled with it; this describes how to add the Administration web app to your Tomcat 5.5 installation. (Tomcat 4.1 comes with the Administration web app as part of the binary).

The following refers to a Tomcat 5.5 set up on Windows 2000, so your path names will be different on *nix platforms. In this example, Tomcat 5.5.17 in installed in c:\Program Files\Apache Software Foundation\Tomcat 5.5 (this is my CATALINA_HOME).

  1. Unzip or untar (be careful to use GNU tar) the file containing the administration web app files (eg. apache-tomcat-5.5.17-admin.zip) to a temporary directory, eg. c:\temp.

  2. Copy c:\temp\apache-tomcat-5.5.17\conf\Catalina\localhost\admin.xml to the directory c:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\Catalina\localhost.

  3. Copy the entire directory tree c:\temp\apache-tomcat-5.5.17\server\webapps\admin

to the directory c:\Program Files\Apache Software Foundation\Tomcat 5.5\server\webapps. This is an overlay, so \server\webapps is just pointing you to the \server\webapps, and the admin directory with its contents will be the only thing you see added there.

  1. Add a line to your c:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\tomcat-users.xml file so that you have a user who has admin role. For example, add this line just before the last line (containing </tomcat-users>) of the file:

    <user username="admin" password="makesomethingup" roles="admin,manager"/> 
    
  2. Restart Tomcat.

  3. Now when you visit http://localhost:8080/admin you should see a page that asks for a user name and password. If you still see the "no longer loaded" error message in your browser, you must either force a full reload of the web page (in Firefox, hold down Shift key while clicking on the Reload button) or just restart your browser completely.

Pascal Thivent
It is bundled with Tomcat. If I stop Tomcat server from Eclipse, then go to the shell and invoke Tomcat manually by issuing Tomcat/bin/startup.sh, I can access the admin page as per normal by just accessing http://localhost:8081/. The same thing cannot happen if Tomcat was invoked from Eclipse.
Daniel
@Daniel Ok, now I get the problem (but I don't call that the "admin" page). And I don't have a solution, yet.
Pascal Thivent