Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

giving http status 404 error  RSS feed

 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am trying to run following code



and getting this output


HTTP Status 404 - /first/first.jsp

type Status report

message /first/first.jsp

description The requested resource is not available.

Apache Tomcat/7.0.40
 
Saif Asif
Ranch Hand
Posts: 440
Eclipse IDE Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your directory structure and where is the first.jsp actually located in the project structure ?
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saif Asif wrote:What is your directory structure and where is the first.jsp actually located in the project structure ?

I made folder which is having the name "first"
"C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\first" this is my directoty structure

within this folder i put my "first.jsp" file and WEB-INF folder which is having web.xml file

and on address bar i gave following address "http://localhost:8080/first/first.jsp"
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me what should I do?
 
Swastik Dey
Rancher
Posts: 1792
15
Android Eclipse IDE Java Java ME
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you see tomcat's default page if you execute the following url

http://localhost:8080
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swastik Dey wrote:Can you see tomcat's default page if you execute the following url

http://localhost:8080


yes i can see the default page
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the Tomcat Manager app to check that your web app is running.
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Use the Tomcat Manager app to check that your web app is running.


How can i check that?
sorry i don't know
 
Swastik Dey
Rancher
Posts: 1792
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess, you can also see the log to see whether your application was deployed properly or not.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Megha Singhal wrote:
Bear Bibeault wrote:Use the Tomcat Manager app to check that your web app is running.

How can i check that?
sorry i don't know

http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html
(Might change depending on your Tomcat version
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:
Megha Singhal wrote:
Bear Bibeault wrote:Use the Tomcat Manager app to check that your web app is running.

How can i check that?
sorry i don't know

http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html
(Might change depending on your Tomcat version


This is asking for the username and password.
i am giving username: tomcat and password: tomcat
but still i am unable to log in to it.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your tomcat-users.xml look like this?

If yes, then the users are commented out. You need to comment them in and restart
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Does your tomcat-users.xml look like this?

If yes, then the users are commented out. You need to comment them in and restart


yes my xml looks like this but i don't understand what do you mean by "commented out".
can you please explain me that.
 
Rajitha Gunawardhane
Ranch Hand
Posts: 43
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dude its <!-- -->. Remove them and restart tomcat. Then use user/password to login to admin. Also as mention above, look on you tomcat log to get any hint.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Comment out = Ignored


To comment in remove the <!-- and -->pair
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Comment out = Ignored


To comment in remove the <!-- and -->pair



403 Access Denied

You are not authorized to view this page.

If you have already configured the Manager application to allow access and you have used your browsers back button, used a saved book-mark or similar then you may have triggered the cross-site request forgery (CSRF) protection that has been enabled for the HTML interface of the Manager application. You will need to reset this protection by returning to the main Manager page. Once you return to this page, you will be able to continue using the Manager appliction's HTML interface normally. If you continue to see this access denied message, check that you have the necessary permissions to access this application.

If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.

For example, to add the manager-gui role to a user named tomcat with a password of s3cret, add the following to the config file listed above.

<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
Note that for Tomcat 7 onwards, the roles required to use the manager application were changed from the single manager role to the following four roles. You will need to assign the role(s) required for the functionality you wish to access.

manager-gui - allows access to the HTML GUI and the status pages
manager-script - allows access to the text interface and the status pages
manager-jmx - allows access to the JMX proxy and the status pages
manager-status - allows access to the status pages only
The HTML interface is protected against CSRF but the text and JMX interfaces are not. To maintain the CSRF protection:

Users with the manager-gui role should not be granted either the manager-script or manager-jmx roles.
If the text or jmx interfaces are accessed through a browser (e.g. for testing since these interfaces are intended for tools not humans) then the browser must be closed afterwards to terminate the session.
For more information - please see the Manager App HOW-TO.

now when i am able to log in to apache , this output is coming.
i can able to execute examples by default given in apache server like chat server, etc but why i am not able to run a simple jsp file?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Rajitha Gunawardhane
Ranch Hand
Posts: 43
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add following line


and change following


then restart and check.
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks its solved.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!