2
votes

I am trying to load a WAR file to my Tomcat 7, and I am using eclipse to start or stop the Server.

I pasted the war file in TOMCAT_HOME/webapps folder and I started the server.

The server Started fine and i got the below console message.

10 Dec, 2012 9:10:46 AM 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: F:\Program Files\Java\jdk1.6.0_37\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;F:/Program Files/Java/jre6/bin/client;F:/Program Files/Java/jre6/bin;F:/Program Files/Java/jre6/lib/i386;C:\Program Files\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Windows Live\Shared;C:\Program Files\QuickTime\QTSystem\;.;F:\Program Files\Java\jdk1.6.0_37\bin;F:\apache-maven-3.0.4\bin;;F:\eclipse-juno;;.
10 Dec, 2012 9:10:46 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8090"]
10 Dec, 2012 9:10:46 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
10 Dec, 2012 9:10:46 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 484 ms
10 Dec, 2012 9:10:46 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
10 Dec, 2012 9:10:46 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.33
10 Dec, 2012 9:10:46 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8090"]
10 Dec, 2012 9:10:46 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
10 Dec, 2012 9:10:46 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 211 ms

But when i try to access my application it gave me ERROR 404, File not Found.

I checked the application TOMCAT_HOME/webapps there i found both my war file and a folder of same name - "JavaServerFaces"

TOMCAT_HOME/webapps directory : Tomcat deployment Directory

The Server is ON, war file is present, A folder structure is generated, but still i am not able to access my application which gives HTTP Status 404 - /JavaServerFaces/xhtml/hello.xhtml

Any solutions for proper deployment and running of war file on tomcat 7?

4
Check the deploy path in eclispe on tomcat server page.I guess usually eclipse deploys at /wtpwebapp not the Tomcat_HOME/webapps. So, put your war file under /wtpwebappsand start the server..SRy
Anyway now you kept your war file under TOMCAT/webapps. So, go to bin folder in Tomcat directory and click on startup.bat and access your project in browser.refer to this post stackoverflow.com/questions/12446263/…SRy
@srinivas - I am manually copy pasting the war file. I am using eclipse only to start or stop the server . Instead of using startup.bat and shutdown.bat. The application is still in 404 state. I dont know why. Any alternate ways of deploying my war file in Tomcat 7 ? Any Manager app or GUI to deploy my war file in tomcat 7 ?bali208

4 Answers

1
votes

In your console message, I do not find the deploying of "JavaServerFaces.war". In eclipse, open your server setting file,under "Server Location " check if the option "Use tomcat installation (.......) ". if it is checked, then check the deploy name if it "webapps". if not then, change it to "webapps".

And if, this all are correct, then possibly your .war file is making fault.

1
votes

There is problem with tomcat to start or stop with eclipse. Its best to start and stop tomcat with the bat files in bin folder.

0
votes

There are 3 steps to find error

1) copy the folder name which contains all application file and paste it into url. Now copy your servlet application url from web.xml and paste after folder name. If that works that means your Servlet application have some error..see the server console

2)On clicking on your application name in Manager App, and then your html file didn't run then there must be error in you your xml file try to rename your html file to index.xhtml

3)4** error shows that there is an error on xml or html file. while 5** series error shows there is error in your tomcat server.

0
votes

Check the server setting in your eclipse. Check where the Configuration path is pointing. Also notice the Server location. By default it's Workspace Metadata, so set it to Tomcat Installation in your case.