aspose file tools*
The moose likes Servlets and the fly likes why getting 404 error? page is there. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "why getting 404 error? page is there." Watch "why getting 404 error? page is there." New topic
Author

why getting 404 error? page is there.

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Hi,

I am really confuse and stuck with this problem.

I have placed a project SessionTest into webapps directory of tomcat like this way:



And now when I type [http://localhost:8080/SessionTest/index.jsp] at browser, it gives me 404 (page not found) error.

Tomcat is installed properly, because other applications are fine.

Please help me, what can be the problem?

Thanks.
[ December 22, 2005: Message edited by: rathi ji ]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Try to get the app through http://localhost:8080/manager/html. Also check whther it is started or not.
Chidanand Chauhan
Ranch Hand

Joined: Nov 10, 2005
Posts: 77
Originally posted by rathi ji:
Hi,

I am really confuse and stuck with this problem.

I have placed a project SessionTest into webapps directory of tomcat like this way:



And now when I type [http://localhost:8080/SessionTest/index.jsp] at browser, it gives me 404 (page not found) error.

Tomcat is installed properly, because other applications are fine.

Please help me, what can be the problem?

Thanks.

[ December 22, 2005: Message edited by: rathi ji ]


Hi Rathi
can you type the url "http://localhost:8080/SessionTest" and then check whether your web browser shows jsp or not .
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Chidanand Chauhan:


And now when I type [http://localhost:8080/SessionTest/index.jsp] at browser, it gives me 404 (page not found) error.

Tomcat is installed properly, because other applications are fine.

Please help me, what can be the problem?

Thanks.

[ December 22, 2005: Message edited by: rathi ji ]<hr></blockquote>

Hi Rathi
can you type the url "http://localhost:8080/SessionTest" and then check whether your web browser shows jsp or not .[/QB]


No, it is not showing. I tried it too.

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Adeel Ansari:
Try to get the app through http://localhost:8080/manager/html. Also check whther it is started or not.


404 (page not found) here also....

:roll:
jyothi malapaka
Greenhorn

Joined: Dec 21, 2005
Posts: 6
Go to http://localhost:8080 and select tomcat manager.
login with the user id, password present in tomcat users for manager.
Then check if the application is running or if there is some error in it
Chidanand Chauhan
Ranch Hand

Joined: Nov 10, 2005
Posts: 77
Originally posted by rathi ji:


And now when I type [http://localhost:8080/SessionTest/index.jsp] at browser, it gives me 404 (page not found) error.

Tomcat is installed properly, because other applications are fine.

Please help me, what can be the problem?

Thanks.

[ December 22, 2005: Message edited by: rathi ji ]<hr></blockquote>

Hi Rathi
can you type the url "http://localhost:8080/SessionTest" and then check whether your web browser shows jsp or not .[/QB]<hr></blockquote>

No, it is not showing. I tried it too.

[/QB]

Then There is some severe problem............... go to the tomcat manager and rectify it
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by jyothim:
Go to http://localhost:8080 and select tomcat manager.
login with the user id, password present in tomcat users for manager.
Then check if the application is running or if there is some error in it


Sorry, but what is the username and password for this...

Please tell me. where I can find it??

Thanks.
jyothi malapaka
Greenhorn

Joined: Dec 21, 2005
Posts: 6
<tomcat_installation_directory>-----conf(folder)----tomcat-users.xml
tomcat_installation_directory is same as catalina-home

In the tomcat-users.xml you will find an entry similar to (may not be same)
<user username="admin" password="" roles="admin,manager"/>
Just check the exact one in your xml file.

use this username and password for getting registered as manager.

Mostly whenever there is some mistake in web.xml you will get such sort of an error. Just check it
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"jyothim"

Welcome to the JavaRanch!

We're a friendly bunch, but we take our display names very seriously.

We require display names to be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and fix your display name, since accounts with invalid display names get deleted.

thanks,
Dave.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
This is my tomcat-users.xml file:



I tried all the combination, but it gave me 403 (access denied) error.

Please suggest me...

Thanks.
jyothi malapaka
Greenhorn

Joined: Dec 21, 2005
Posts: 6
Hi Rathi

add this code into the tomcat-users.xml
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="" roles="admin,manager"/>

After that restart ur tomcat and try to login
[ December 23, 2005: Message edited by: jyothi m ]
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Yes, My this application is not in the list. But how can add that into this list...

Please suggest.

Thanks.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"jyothi m"
Thank you for changing your display name, but last initials aren't accepted. You can browse the display name rules here.

Please correct your display name.

thanks,
Dave.
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026

Yes, My this application is not in the list. But how can add that into this list...


Deploy your web application.

If you are using advanced IDE's like WSAD (or) IntelliJIDEA they will do all the work for you. All you have to do is just configure your web/application server with the IDE.


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Vishnu Prakash:


Deploy your web application.

If you are using advanced IDE's like WSAD (or) IntelliJIDEA they will do all the work for you. All you have to do is just configure your web/application server with the IDE.


No, I am using notepad for writing all code.

jyothi malapaka
Greenhorn

Joined: Dec 21, 2005
Posts: 6
hii could you send me your web.xml and the java file??

There might be some problem in it....
If you are sure that there is no problem in any of them ....then change the name of your SessionTest(web application) folder....
sometimes it works .....just try it..

And then restart your tomcat...refresh ur browser and check if it is present in tomcat manager...

[ December 23, 2005: Message edited by: jyothi malapaka ]
[ December 23, 2005: Message edited by: jyothi malapaka ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Have you looked that the logs under tomcat/logs?
If there was a problem deploying your app, you would see some messages there.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830


I changed name also but the same problem...

Please suggest some way...

Thanks a lot.
[ December 23, 2005: Message edited by: rathi ji ]
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Ben Souther:
Have you looked that the logs under tomcat/logs?
If there was a problem deploying your app, you would see some messages there.


Parse error in application web.xml
java.lang.IllegalArgumentException: Invalid <url-pattern>MyFirstServlet.do in servlet mapping
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Thanks a lot Guys.

I forgot / in front of value of url-pattern tag.

small things may make the difference.

Thanks agian.
 
Consider Paul's rocket mass heater.
 
subject: why getting 404 error? page is there.