Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Eclipse/Tomcat newbie question
Eclipse/Tomcat newbie question [message #176853] Fri, 11 August 2006 12:08 Go to next message
Jim Garrison is currently offline Jim Garrison
Messages: 7
Registered: July 2009
Junior Member
I cannot seem to get Eclipse and Tomcat to work together.

System is Windows XP SP2

Installed latest Eclipse 3.2 and Tomcat 5.5.17

Tomcat works fine by itself, management pages and samples
come up fine.

I set up a servlet project in Eclipse, specifying Tomcat 5.5 as the
server environment and gave it the install directory for Tomcat.
The module configuration specifies Document Base "WebMonitor" and
path /WebMonitor

When I attempt to run the project from within Eclipse it complains that
the ports it wants are already in use, so I disabled the running
Tomcat service.

Then, the Tomcat instance starts from within Eclipse, but the base
URL path (http://localhost:8080/WebMonitor) gives 404 (a Tomcat
error page, not the default browser error page).

I went to the server configuration and, in the Modules tab, added
the \Tomcat 5.5\webapps\ROOT document base with a URL path of /
This also gives 404 (again, the Tomcat 404 page).

Curiously, if I change the URL to anything besides just '/', such
as '/abc', I can get the main page to come up with the same URL
i.e. http://localhost:8080/abc -- but then links to the examples
and Tomcat manager don't work.

Obviously, I'm missing something pretty basic but don't know where
to look. Any suggestions would be appreciated.

Tomcat startup log displayed in Eclipse console:

Aug 11, 2006 11:04:18 AM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in
production environments was not found on the java.library.path: C:\Program
Files\Java\jre1.5.0_06\bin;.;C:\WINDOWS\system32;C:\WINDOWS; C:\Program
Files\IBM\WebSphere
MQ\Java\lib;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System 32\Wbem;C:\Program
Files\ATI Technologies\ATI Control Panel;C:\Program Files\IBM\WebSphere
MQ\bin;C:\Program Files\IBM\WebSphere MQ\Java\bin;C:\Program
Files\IBM\WebSphere MQ\WEMPS\bin;C:\Program Files\IBM\WebSphere
Studio\Application Developer\v5.1.2\runtimes\base_v51\bin;C:\Program
Files\Executive Software\Diskeeper\;C:\Program Files\Common
Files\Adobe\AGL;Pñ
Aug 11, 2006 11:04:18 AM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Aug 11, 2006 11:04:18 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 735 ms
Aug 11, 2006 11:04:19 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Aug 11, 2006 11:04:19 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
Aug 11, 2006 11:04:19 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Aug 11, 2006 11:04:19 AM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Aug 11, 2006 11:04:19 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Aug 11, 2006 11:04:19 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/47 config=null
Aug 11, 2006 11:04:19 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Aug 11, 2006 11:04:19 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 796 ms
Re: Eclipse/Tomcat newbie question [message #176862 is a reply to message #176853] Fri, 11 August 2006 12:40 Go to previous messageGo to next message
Jim Garrison is currently offline Jim Garrison
Messages: 7
Registered: July 2009
Junior Member
Jim Garrison wrote:
> I cannot seem to get Eclipse and Tomcat to work together.
>
> System is Windows XP SP2
>
[snip]

OK, a little digging (and comparison of web.xml to a very old
NetBeans version) revealed that Eclipse did not add a
<servlet>...</servlet> section to web.xml. I added one
manually and now the servlet at least tries to initialize
(I have other problems to fix there, but at least it's seeing
the servlet now).

I couldn't find anything in the project Properties page that
would create the servlet definition. Is this something I
must add manually to web.xml, or did I miss something basic
during project setup?
Re: Eclipse/Tomcat newbie question [message #176868 is a reply to message #176853] Fri, 11 August 2006 12:56 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1287
Registered: July 2009
Senior Member
Hi Jim,

Asking for a URL like "http://localhost:8080/WebMonitor" in the absence
of a welcome file (such as index.jsp or index.html) will try to display
a directory listing. For security reasons, directory listings are
disabled by default in Tomcat 5.5.x, so 404 is the expected response.

When adding the external ROOT webapp, specify the Path as an empty
string instead of "/". That should get it working as expected. Add the
other external webapps using the appropriate Path, if desired.

As you can tell, the Tomcat server inside of Eclipse is running with a
separate "catalina.base" (the equivalent of CATALINA_BASE in the batch
scripts). To see where this is, switch from the Modules tab to the
Overview tab and click "Open launch configuration". Switch to the
Arguments tab and note the setting for "catalina.base" in the VM
Arguments field. Also, if you want to run the Eclipse Tomcat server at
the same time as your Tomcat service, alter the port numbers on the
Overview tab to eliminate any conflicts.

Cheers,
Larry

Jim Garrison wrote:
> I cannot seem to get Eclipse and Tomcat to work together.
>
> System is Windows XP SP2
>
> Installed latest Eclipse 3.2 and Tomcat 5.5.17
>
> Tomcat works fine by itself, management pages and samples
> come up fine.
>
> I set up a servlet project in Eclipse, specifying Tomcat 5.5 as the
> server environment and gave it the install directory for Tomcat.
> The module configuration specifies Document Base "WebMonitor" and
> path /WebMonitor
>
> When I attempt to run the project from within Eclipse it complains that
> the ports it wants are already in use, so I disabled the running
> Tomcat service.
>
> Then, the Tomcat instance starts from within Eclipse, but the base
> URL path (http://localhost:8080/WebMonitor) gives 404 (a Tomcat
> error page, not the default browser error page).
>
> I went to the server configuration and, in the Modules tab, added
> the \Tomcat 5.5\webapps\ROOT document base with a URL path of /
> This also gives 404 (again, the Tomcat 404 page).
>
> Curiously, if I change the URL to anything besides just '/', such
> as '/abc', I can get the main page to come up with the same URL
> i.e. http://localhost:8080/abc -- but then links to the examples
> and Tomcat manager don't work.
>
> Obviously, I'm missing something pretty basic but don't know where
> to look. Any suggestions would be appreciated.
>
> Tomcat startup log displayed in Eclipse console:
>
> Aug 11, 2006 11:04:18 AM org.apache.catalina.core.AprLifecycleListener
> lifecycleEvent
> INFO: The Apache Tomcat Native library which allows optimal performance in
> production environments was not found on the java.library.path: C:\Program
> Files\Java\jre1.5.0_06\bin;.;C:\WINDOWS\system32;C:\WINDOWS; C:\Program
> Files\IBM\WebSphere
> MQ\Java\lib;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System 32\Wbem;C:\Program
> Files\ATI Technologies\ATI Control Panel;C:\Program Files\IBM\WebSphere
> MQ\bin;C:\Program Files\IBM\WebSphere MQ\Java\bin;C:\Program
> Files\IBM\WebSphere MQ\WEMPS\bin;C:\Program Files\IBM\WebSphere
> Studio\Application Developer\v5.1.2\runtimes\base_v51\bin;C:\Program
> Files\Executive Software\Diskeeper\;C:\Program Files\Common
> Files\Adobe\AGL;Pñ
> Aug 11, 2006 11:04:18 AM org.apache.coyote.http11.Http11BaseProtocol init
> INFO: Initializing Coyote HTTP/1.1 on http-8080
> Aug 11, 2006 11:04:18 AM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 735 ms
> Aug 11, 2006 11:04:19 AM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Aug 11, 2006 11:04:19 AM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
> Aug 11, 2006 11:04:19 AM org.apache.catalina.core.StandardHost start
> INFO: XML validation disabled
> Aug 11, 2006 11:04:19 AM org.apache.coyote.http11.Http11BaseProtocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> Aug 11, 2006 11:04:19 AM org.apache.jk.common.ChannelSocket init
> INFO: JK: ajp13 listening on /0.0.0.0:8009
> Aug 11, 2006 11:04:19 AM org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=0/47 config=null
> Aug 11, 2006 11:04:19 AM org.apache.catalina.storeconfig.StoreLoader load
> INFO: Find registry server-registry.xml at classpath resource
> Aug 11, 2006 11:04:19 AM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 796 ms
Previous Topic:How to programmly export a war?
Next Topic:getting invalid moduld Name when creating WA
Goto Forum:
  


Current Time: Wed Apr 16 16:14:54 EDT 2014

Powered by FUDForum. Page generated in 0.04892 seconds