0

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!

4 Answers 4

4

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.

Sign up to request clarification or add additional context in comments.

2 Comments

When I start the server from commandline using startup, I can see the welcome page. When I right click on Eclipse and start, I see nothing..There is also sample.war in the server. When I use the commandline I can see localhost:8080/sample, but when I use Eclipse I see nothing..
That's the point I was trying to explain and why I placed the link to FAQ (which I strongly recommend to read): Eclipse substitutes configuration which comes originally with Tomcat. This means that starting Tomcat from command line, and starting from Eclipse will be different.
0

Eclipse starts Tomcat with your app as the only webapp.

4 Comments

Sorry? I read this answer a couple of times, but I do not understand what you mean?
Presumably, you're using the web tools project (right?), if your project name is foo then your path on the tomcat server in eclipse is /foo, not /.
There is no project yet. I only downloaded a server and I am trying to see the default tomcat page. ( The root )
Then that's your problem... eclipse doesn't deploy any wars, besides your application's, as configured in the Run configuration window.
0

You now need to create a 'servlet' and a 'servlet-mapping' entry in your web.xml.

Once you do, you can get rid of the "servlet/" part of your url.

Check out the following URL for more information regarding the invoker servlet: http://faq.javaranch.com/view?InvokerServlet

Source: www.coderanch.com

Comments

0

If you don't have a ROOT web application, navigating to / and getting a 404 might be the expected behavior.

Can you navigate to the context of one of your deployed web applications after running the web application?

If not, can we see the errors in the logs when you attempt this? What you're showing looks like a good Tomcat log. It doesn't really indicate any issues.

2 Comments

The tomcat folder has a ROOT folder by default. It is in webapps\ROOT folder and has a welcome page.
Tomcat is running properly and returning a 404 message, as your error indicates. If Tomcat didn't start, you wouldn't get at a 404. This means one of two things: 1) You don't have a ROOT application. 2) You have an error in your ROOT application that is preventing it from loading.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.