Eclipse – I can’t start Tomcat Server using Eclipse

eclipsejakarta-eetomcat

I simply defined a new Server using Eclipse Juno. I picked a folder and downloaded and installed Tomcat Server.

This is the log when I start the server: ( No deployment or anything, just server starting. )

Mar 10, 2013 8:38:13 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files (x86)\Java\jre7\bin;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files (x86)\PHP;C:\PHP\PEAR;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\;C:\Program Files (x86)\Git\cmd;C:\Program Files\Java\jdk1.6.0_37\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\apache-maven-2.2.1\bin;.
Mar 10, 2013 8:38:14 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 10, 2013 8:38:14 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Mar 10, 2013 8:38:14 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 480 ms
Mar 10, 2013 8:38:14 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 10, 2013 8:38:14 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Mar 10, 2013 8:38:14 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 10, 2013 8:38:14 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mar 10, 2013 8:38:14 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 167 ms

But when I navigate to localhost:8080 all I see is:

HTTP Status 404 - /

type Status report

message /

description The requested resource (/) is not available.

Apache Tomcat/7.0.12

I am sure that port number of the server is 8080.

Edit 1:

This is the web.xml file from the Tomcat Folder that is downloaded:

<servlet>
    <servlet-name>default</servlet-name>
    <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
    <init-param>
        <param-name>debug</param-name>
        <param-value>0</param-value>
    </init-param>
    <init-param>
        <param-name>listings</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup> </servlet>


<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/</url-pattern> </servlet-mapping>

Edit 2:

I solved my problem:
I changed the Server Location in Eclipse from Use workspace metadata to Use Tomcat installation. Now it works..

Thanks everyone!

Best Answer

Don't get confused by the error code: HTTP 404 means that client (browser) was able to connect to server, but it didn't find the required resource -- in your case it's root "/".

Since you are starting Tomcat from the Eclipse environment, it doesn't publish anything but what you have defined in your "Servers"/Tomcat configuration. This behavior is well described in this FAQ: WTP Tomcat FAQ. In your case you didn't do any configuration, so there's no deployed content.

As soon as you start developing your web project, you'll be able to access any published resources.