tags:

views:

907

answers:

5

I configured Tomcat Server 6.0.24 in Eclipse and started successfully with console display:

Feb 17, 2010 4:24:31 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\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;E:\oracle\product\10.2.0\client_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Common Files\Teleca Shared;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;E:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;C:\Program Files\MySQL\MySQL Server 5.0\bin;E:\komal-gohil\tools\Subversion\bin;C:\Sun\SDK\bin;e:\instantrails\ruby\bin;c:\program files\java\jdk1.6.0_11\bin;E:\komal-gohil\tools\apache-maven-2.2.1\bin;C:\program files\java\jdk1.6.0_11\bin;E:\komal-gohil\tools\Ant\bin;E:\komal-gohil\tools\apache-tomcat-5.5.17\bin;C:\Sun\SDK\lib\j2ee.jar;E:\komal-gohil\tools\android-sdk-windows-1.6_r1\tools;E:\komal-gohil\tools\Scala\bin;E:\komal-gohil\tools\pax-construct-1.4\bin
Feb 17, 2010 4:24:31 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8085
Feb 17, 2010 4:24:31 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 705 ms
Feb 17, 2010 4:24:32 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 17, 2010 4:24:32 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
Feb 17, 2010 4:24:32 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8085
Feb 17, 2010 4:24:32 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8010
Feb 17, 2010 4:24:32 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31  config=null
Feb 17, 2010 4:24:32 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 421 ms

But when I am trying to connect to http://localhost:8085/ it is giving me Error like:

HTTP Status 404 - /

type Status report

message /

description The requested resource (/) is not available.

Apache Tomcat/6.0.24

When I am trying to start the tomcat outside the eclipse it is starting and also able to connect to localhost:8085

What could be the reason for this? How do I solve this problem?

A: 

I may be out fishing here, but doesn't Tomcat by default open to port 8080? Try http://localhost:8080 instead.

mikek
The log states Starting Coyote HTTP/1.1 on http-8085so port 8085 is right.
beny23
Yes, you are right. But I modified the server.xml file and changed the port to 8085.
komal
Besides, if the port was wrong, komal wouldn't have got a 404 page **served by Tomcat**.
BalusC
Ah, quite true.
mikek
A: 

Eclipse hooks Dynamic Web projects into tomcat and maintains it's own configuration but does not deploy the standard tomcat ROOT.war. As http://localhost:8085/ link returns 404 does indeed show that tomcat is up and running, just can't find a web app deployed to root.

By default, any deployed dynamic web projects use their project name as context root, so you should see http://localhost:8085/yourprojectname working properly, but check the Servers tab first to ensure that your web project has actually been deployed.

Hope that helps.

beny23
But If the server in running inside the eclipse then I must be able to connect to default tomcat homepage outside the eclipse, that is what I am not able to connect.
komal
The server is running in Eclipse but the default page (which is actually an application called ROOT.war) is not deployed in the configuration that Eclipse uses. Eclipse uses it's own config (in a location like workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\server.xml), which is why you won't see the default homepage, but any web projects you deploy through the server tab will work.
beny23
A: 

Can you check the following steps:

In your tomcat/conf/server.xml file check for the http connector and check the port number configured there

The http connector will be configured something like this

<Connector port="8080" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           redirectPort="8443" />

Check the port number here, is it 8080 or 8085

Then with that port number try the following link

http://localhost:&lt;port_number&gt;/manager/html

This will open the tomcat manager. Are you able to locate your project under applications. If it asks for username/password give username as admin and submit. If you can locate your application click on the link

Then check what is the context name of your project in tomcat. It is configured in eclipse. Go to the tomcat tab in the project properties and check the context name.

Note: I can't see your application being loaded by tomcat. Can you what type of application you are developing and are you using devloader to load the reference libs?

Arun P Johny
Tomcat is running perfectly fine. Else he wouldn't have got any error page served by it at all, but just a browser-default connection timeout message.
BalusC
Tomcat is configured fine, but that does not mean that the application is loaded properly. we need to update the tomcat context for it.
Arun P Johny
@Arun: The Eclipse tomcat integration should take care of that. Note, Eclipse will store its own context.xml in something akin to workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\server.xml instead of the standard tomcat/conf/server.xml
beny23
my mistake, there are 2 ways to use tomcat and eclipse. 1) using tomcat as a server (Adding tomcat to the servers), 2) updating the context path in tomcat server.xml and loading the dependencies using devloader
Arun P Johny
I think you didn't understood me. If Tomcat wasn't running or the port was wrong, the OP wouldn't have got a 404 error at all. The 404 error is **originated** from Tomcat, not a builtin one of the webbrowser or so.
BalusC
+3  A: 

What are you expecting? The default Tomcat homepage? If so, you'll need to configure Eclipse to take control over from Tomcat.

Doubleclick the Tomcat server entry in the Servers tab, you'll get the server configuration. At the left column, under Server Locations, select Use Tomcat installation (note, when it is grayed out, read the section leading text! ;) ). This way Eclipse will take full control over Tomcat, this way you'll also be able to access the default Tomcat homepage with the Tomcat Manager when running from inside Eclipse.

More details and screenshots here.

BalusC
Yes I am expecting for default Tomcat Homepage. I selected use tomcat installation and works fine. I am able to connect to tomcat homepage.Why we can not able to connect to default homepage with Use workspace metadata?
komal
Simply because the Tomcat homepage is not in the workspace metadata :) I.e. the Tomcat homepage is not one of the Eclipse projects.
BalusC
Thanks a lot BalusC. It's OK now.
komal
A: 

Right-click on your project's name in Eclipse's Project Explorer, then click Run As followed by Run on Server. Click the Next button. Make sure your project's name is listed in the Configured: column on the right. If it is, then you should be able to access it with this URL:

http://localhost:8085/projectname/

Additionally, whenever you make new additions (such as new JSPs, graphics or other resources) to your project, be sure to refresh the project by clicking on its name and then hitting F5. Otherwise Eclipse does not know that those new resources are available and will not make them available to Tomcat to serve.

Brian Showalter
That was not his question/problem.
BalusC