• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTTP Status 404 error in tomcat

 
Greenhorn
Posts: 9
  • 1
  • Number of slices to send:
    Optional 'thank-you' note:
Hi,
Check whether your tomcat service is running or not in services.msc
 
Greenhorn
Posts: 7
  • 2
  • Number of slices to send:
    Optional 'thank-you' note:
Well this problem is resolved. My tomcat server was running properly even i was getting 404 error. The reason behind this is the missing file like index.jsp which was not compied properly into my eclipse working directory. After coping ROOt folder from tomcat to eclipse .metadat folder the error is gone.

I have copied following text from website http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html which is quite helpful.

Eclipse forgets to copy the default apps (ROOT, examples, etc.) when it creates a Tomcat folder inside the Eclipse workspace. Go to C:\apache-tomcat-7.0.8\webapps, R-click on the ROOT folder and copy it. Then go to your Eclipse workspace, go to the .metadata folder, and search for "wtpwebapps". You should find something like your-eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps (or .../tmp1/wtpwebapps if you already had another server registered in Eclipse). Go to the wtpwebapps folder, R-click, and paste ROOT (say "yes" if asked if you want to merge/replace folders/files). Then reload http://localhost/ to see the Tomcat welcome page.


Now iam facing otherproblem with Axis2 which is not dispalying my service and giving error : cannot be cast to org.apache.axis2.deployment.DeploymentClassLoader
Any help?
 
Greenhorn
Posts: 8
  • Number of slices to send:
    Optional 'thank-you' note:
@Maria Anjum
Which OS are you using?
Because I got Error in Windows 7 but not in Windows XP
 
Ranch Hand
Posts: 33
  • Number of slices to send:
    Optional 'thank-you' note:
Hallo,

I had resolved my problem. When using Eclise Helios and Tomcat 6 or 7 You have to do the next:
“Copy the ROOT (Default) Web App into Eclipse.
Eclipse forgets to copy the default apps (ROOT, examples, etc.) when it creates a Tomcat folder inside the Eclipse workspace. Go to C:\apache-tomcat-7.0.8\webapps, R-click on the ROOT folder and copy it. Then go to your Eclipse workspace, go to the .metadata folder, and search for "wtpwebapps". You should find something like your-eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps (or .../tmp1/wtpwebapps if you already had another server registered in Eclipse). Go to the wtpwebapps folder, R-click, and paste ROOT (say "yes" if asked if you want to merge/replace folders/files). Then reload http://localhost/ to see the Tomcat welcome page.”
Source : http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html
When updating the the used and to be used jar-files my application worked ok. But now when using Eclipse Indigo and Tomcat 6 or 7 on my new computer I get – when typing localhost:8080 after starting Tomcat in the Eclipse IDE- the Tomcat homepage. But when running my application http://localhost:8080/cew/login.faces I got the Tomcat error page http 404 the resource could not be found. My opinion is that it had to do something with the Tomcat configuration, more specifically the place where the war-file and project map are to be found, although mine are found in de webapps file – the cew war-file and the project map cew with all the files-. There are no project errors –it is the same webapplication that runned on my old computer with Eclipse Helios and Tomcat 7. But now it won’t work. Even more when I installed Eclipse Helios and Tomcat 7 and I got also again the HTTP 404 error of Tomcat. I don’t undertand it any more.

Emmanuel
 
Maria Anjum
Greenhorn
Posts: 7
  • Number of slices to send:
    Optional 'thank-you' note:
Well, I am using winXP and vista and this worked with both.
The problem is files remain missing in working folders and these errors appear. Error 404 doesnt mean that your tomcat is not working it only shows that it is unable to find index files. It also depends on the status of the server in eclipse either started or not. I am using tomcat in Eclipse.


Now my problem - i didnt get services working on Axis- i am running it in eclipse.
 
Greenhorn
Posts: 2
  • Number of slices to send:
    Optional 'thank-you' note:
Hi I am a Servlets and JSP newbie and I am getting a similar error. I am doing the sample program (Chapter 3) in HFSJ 2nd edition but I am using Java 6 and Tomcat 7 for learning JEE 6. I was able to complete the first two versions of the app but I am getting the error when I am trying to run the app using JSP.
The error is as given below:

type Status report

message /Beer-v1/result.jsp

description The requested resource (/Beer-v1/result.jsp) is not available.

This app is running when I replace the "result.jsp" as given in the book with a "hello.jsp" given in one of the examples provided in TOMCAT.
The environment variables set in my system are JAVA_HOME, CATALINA_HOME.
I have set the java path as well in CLASSPATH and PATH.
Also, I am typing the JSP code in notepad and saving it. Not using any editor till now.

Just to summarize my Tomcat page is opening normally after startup but when I try to redirect a servlet to a JSP I get the error that the JSP file is not available. When I replace this JSP with another one provided in the Example given by TOMCAT the entire app seems to work properly.

I have seen the previous posts and followed the steps accordingly but I am still getting the error.

Please suggest what steps are to be taken to solve this problem.
 
snehansh konda
Greenhorn
Posts: 2
  • Number of slices to send:
    Optional 'thank-you' note:

snehansh konda wrote:Hi I am a Servlets and JSP newbie and I am getting a similar error. I am doing the sample program (Chapter 3) in HFSJ 2nd edition but I am using Java 6 and Tomcat 7 for learning JEE 6. I was able to complete the first two versions of the app but I am getting the error when I am trying to run the app using JSP.
The error is as given below:

type Status report

message /Beer-v1/result.jsp

description The requested resource (/Beer-v1/result.jsp) is not available.

This app is running when I replace the "result.jsp" as given in the book with a "hello.jsp" given in one of the examples provided in TOMCAT.
The environment variables set in my system are JAVA_HOME, CATALINA_HOME.
I have set the java path as well in CLASSPATH and PATH.
Also, I am typing the JSP code in notepad and saving it. Not using any editor till now.

Just to summarize my Tomcat page is opening normally after startup but when I try to redirect a servlet to a JSP I get the error that the JSP file is not available. When I replace this JSP with another one provided in the Example given by TOMCAT the entire app seems to work properly.

I have seen the previous posts and followed the steps accordingly but I am still getting the error.

Please suggest what steps are to be taken to solve this problem.



Hi, this problem is solved. Quite a silly reason actually. I didnt save the JSP file in the category of 'ALL FILES' while saving the file from notepad. Changing that solved the problem
 
Greenhorn
Posts: 1
  • Number of slices to send:
    Optional 'thank-you' note:
Well... just to add some things to avoid the error.

As i started my programm in eclipse on my windows pc, it was working fine, but when i uploaded it on my virtual server with arch linux i got the 404 error.

So first of all make sure your Programm directory has the proper privileges. After this i saw my Programm in the Manager Tool... started, but still gave me the 404 finger.

my last error i found to make it work was the directory:

Wrong:
--exampleApp
----WebContent
------WebInf
--------web.xml
--------classes
----------dirToMyPackage
----------app.class

right:
--exampleApp
----WebInf
------web.xml
--------classes
----------dirToMyPackage
----------app.class

took me quite some time

hope i can hel sb

regards


PS: content of the hello world example i used can be found here
 
Ranch Hand
Posts: 43
  • Number of slices to send:
    Optional 'thank-you' note:
Hi Varun and Lakshmi,

You have mentioned in your reply that because of your mistake, the 404 error was resolved. Could please share with me in detail what was the mistake and how it got resolved?

I am also getting the same error on and off. I really dont know what to do. Do we have to restart Tomcat whenever we change faces-config.xml or web.xml?
Please help me.
 
Greenhorn
Posts: 1
  • Number of slices to send:
    Optional 'thank-you' note:
Hi,

I am also getting the same 404 resource not found error but in my case tomcat homepage is showing
 
Greenhorn
Posts: 1
  • 1
  • Number of slices to send:
    Optional 'thank-you' note:
Did you build the project? I was having the EXACT same problem and when I built the project it ran. I feel like a bit of an idiot for it



I made an account just for this.
 
Sheriff
Posts: 22784
131
  • Number of slices to send:
    Optional 'thank-you' note:
Welcome to the Ranch!
 
Ranch Hand
Posts: 49
  • Number of slices to send:
    Optional 'thank-you' note:
Very helpful. Thanks!
 
Ranch Hand
Posts: 112
  • Number of slices to send:
    Optional 'thank-you' note:


Sorry all.I think its too late to reply but hope it is useful.

use <welcome-file-list> tag in web.xml if you get 404 error.. if you are using IDE:

type the following:according to your web resource program:please make note of it

in web.xml:


hope this works fine.
because by default if you are using DE index.jsp is set as start up or home page sometimes even because of WAR file generation of you web application you can face such 404 status code error pages.so you either set your Servlet program name or your Html based on your requirement..Run your application.see that your deployment directory structure is perfect.:

see the attachement .Hope that may work fine
Deployment-Directory-Structure-of-a-web-application-.jpg
 
Greenhorn
Posts: 4
  • Number of slices to send:
    Optional 'thank-you' note:
Hi Friends ,Is it a must to set the environment variables for j2ee, Since i am getting the same error as 404
 
Swetha Bhagavathula
Ranch Hand
Posts: 112
  • Number of slices to send:
    Optional 'thank-you' note:
unless and until you place the servlet-api.jar(for tomcat) the container will not recognise your web application, can you please be more precise .. setting environment variables depends upon the software you are using.. but almost for all evn for framework software like struts etc we need to set path..
 
Rob Spoor
Sheriff
Posts: 22784
131
  • Number of slices to send:
    Optional 'thank-you' note:
You shouldn't do anything with servlet-api.jar. The container provides the version you need, and providing your own copy will very likely break your application and perhaps even your entire container (if placed in the wrong place).
 
Greenhorn
Posts: 3
  • Number of slices to send:
    Optional 'thank-you' note:
Not sure whether this is too late to post.
In Tomcat ,you might get 404 error for your jsp file if it is inside WEB-INF directory and in web.xml you have not mentioned file path from WEB-INF.
Like in web.xml it should be written as :
<welcome-file>/WEB-INF/index.jsp</welcome-file>

This is a security reason.
Hope it helps.

-Shruti
 
Greenhorn
Posts: 4
  • Number of slices to send:
    Optional 'thank-you' note:
It could happen if the <welcome-file-list> you have mentioned in the web.xml is not in the right location. so please make sure your resource exist first
 
Greenhorn
Posts: 2
  • Number of slices to send:
    Optional 'thank-you' note:
Make sure you have a right resource under your war file.
It might happen index.html does not exist under war file.Create a index.html and put some text inside body tag and run. it will work.
 
Dipankar Pal
Greenhorn
Posts: 2
  • Number of slices to send:
    Optional 'thank-you' note:
Your web.xml file is the culprit.
In web.xml under <welcome-file-list> tag you should have a right resource. By default it will have index.html and all.To test you can create a dummy index.html and test it.
 
Greenhorn
Posts: 2
  • Number of slices to send:
    Optional 'thank-you' note:
When using an Eclipse IDE (I am using JBoss Developer Studio 6.0.0.GA), I had the same problem with the HTTP 404. I could run Tomcat 7 from the command line and see the Tomcat page at localhost:8080, but using the IDE to start Tomcat I could not. Rather, when starting Tomcat using the IDE I got the HTTP 404.

The solution was in setting the 'Server Location' of Tomcat within the IDE, as described here:

http://stackoverflow.com/questions/2280064/tomcat-started-in-eclipse-but-unable-to-connect-to-link-to-http-localhost8085
 
David Hildebrandt
Greenhorn
Posts: 2
  • Number of slices to send:
    Optional 'thank-you' note:
.
 
Ranch Hand
Posts: 440
  • Number of slices to send:
    Optional 'thank-you' note:
hi David Hildebrandt ,

Yes you are absolutely right . This is the main reason why we dont get to see the homepage of tomcat when run from withing eclipse IDE. Another thing I would like to add here is that , if you use eclipse to start your server and use the default server location ( from context of eclipse , NOT from tomcat directory ) then eclipse makes use of another directory to deploy applications with the name of "wtpwebapps" instead of the default "webapps". If you go to this directory ( it will be at $CATALINA_HOME$/wtpwebapps and it will only appear if you start the server atleast once from the IDE and use the default server location of eclipse ) , you will notice that only the ROOT is there and no other files ( welcome files ). This is why , when run from within eclipse, we get a 404 not found page on the URL http://localhost:<port>;
 
Greenhorn
Posts: 1
  • Number of slices to send:
    Optional 'thank-you' note:
I am sure that lot of people faced this error and everyone had some or the other mistake. I will share my mistake. Name of my web.xml was Web.xml ( W in caps ) and hence i was getting the 404 error. All the best.
 
Greenhorn
Posts: 4
  • Number of slices to send:
    Optional 'thank-you' note:
Eclipse forgets to copy the default apps (ROOT, examples, etc.) when it creates a Tomcat folder inside the Eclipse workspace.This can be fixed in eclipse by following the below steps.
1. Go to Java perspective
2. Select Window->Show View->Server
3. Double click the added tomcat server and Overview Screen is displayed.
4. Under Server Locations select 2nd radio button (Use Tomcat installation) and save it and restart the server.

Happy coding!!!
 
Sachin Kumar R Gundi
Greenhorn
Posts: 4
  • Number of slices to send:
    Optional 'thank-you' note:
Eclipse forgets to copy the default apps (ROOT, examples, etc.) when it creates a Tomcat folder inside the Eclipse workspace.This can be fixed in eclipse by following the below steps.
1. Go to Java perspective
2. Select Window->Show View->Server
3. Double click the added tomcat server and Overview Screen is displayed.
4. Under Server Locations select 2nd radio button (Use Tomcat installation) and save it and restart the server.

Happy coding!!!
 
Greenhorn
Posts: 1
  • Number of slices to send:
    Optional 'thank-you' note:
I do this and issue resolved !!


 
Greenhorn
Posts: 1
  • Number of slices to send:
    Optional 'thank-you' note:
hi
please help i am working with tomcat 7 but when i run my app i got HTTP Status 404 error
HTTP Status 404 - /Money transfer/

type Status report

message /MYAPP/

description The requested resource (/money transfer/) is not available.
i got same error with any other app run on tomcat what should i do i have been googling but still not succeded please help
this is my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">

<display-name>Struts 2</display-name>
<welcome-file-list>
<welcome-file>test.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>"*.htm"</url-pattern>
</filter-mapping>
</web-app>
 
Greenhorn
Posts: 20
  • Number of slices to send:
    Optional 'thank-you' note:
->Click on servers
->Tomcat server will be displayed,Now right click there and goto properties
->General->Location->click on the switch location button
->Next on the left hand side panel,click on servers
->Except Tomcat v7.0 Server at localhost-config there will be another server like Tomcat v7.0 Server at localhost.server,Double click on it
->Under server locations select the 2nd radio button i.e use tomcat installation
->Now save this and you are good to go
->RESTART THE SERVER

Hopefully this helps!
 
Greenhorn
Posts: 1
  • Number of slices to send:
    Optional 'thank-you' note:
Hi Techies,
I have also the same 404 page note found issue.I am able to resolved the issue.

Issue:-404 Page note found error in apache-tomcat-6.0.29

1)Update the apache-tomcat-6.0.29\conf\contex.xml with

<Context antiResourceLocking="false" privileged="true" useHttpOnly="true">

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.0\.0\.1"/>

add the above lines to the file.Don't remove any existing lines.

2)Update the apache-tomcat-6.0.29\conf\tomcat-users.xml with

<role rolename="manager"/>
<user username="userusername" password="password" roles="manager"/>

3).Using command prompt try to start the tomcat
apache-tomcat-6.0.29\bin\startup.bat

4)http://127.0.0.1:8090/manager/html

Hope it will resolve your 404 issue.

 
Greenhorn
Posts: 1
  • Number of slices to send:
    Optional 'thank-you' note:
This is very useful, you may refer to this link

http://www.youtube.com/watch?v=r1Fc7PuOtT4
 
Greenhorn
Posts: 2
  • Number of slices to send:
    Optional 'thank-you' note:
dont type any extension(.java/.jsp) in the url ........ else HTTP 404 error will occur
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic
vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |