1

I get 404 error when trying to run a jsp file eclipse. The confusing thing is the server is running and I can go to localhost:8080 without any problems. I have attached an image of my configuration of server, the jsp file and also the location of the file and the error.

enter image description here

I embed the image cause of the reputation thing so I have linked it

More information:

I am using TOMCAT 7, ECLIPSE KEPLER I have checked the location of helloworld.jsp its in WebContent. I have restarted the server. I have created another dynamic web project nothing works. I get the same problem I can go to localhost:8080 but I cant run an JSP file

SOLVED:

Okay guys its pretty simple to solve this problem. There are two things you need to try.

1)Right click your project and export the war file into C:\ProgramFiles\Tomcat7 folder If this does not work then.

2) Right click your project and export the war file into some directory and copy the war file into C:\ProgramFiles\Tomcat7 then start the Tomcat server and there you go your JSP file work.

You will probably end up doing step 2 because of stupid windows file permissions

Also thanks for all the help guys really appreciate it.

ozbek
  • 20,955
  • 5
  • 61
  • 84

4 Answers4

1

Make sure that u have put your Jsp files into the WebRoot and check the location and even check your Web.xml and after that run and still if its not working then post your Web.xml here.

Kishan Bheemajiyani
  • 3,429
  • 5
  • 34
  • 68
1

Unfortunately, user3135774's solution does not work for me, as am using an Apple computer.

I have read and researched another problem (Error 500: No Output Folder), which I have along with Error 404, carefully, and I think this is related to permission issues.

The JSP file is supposed to be compiled and then deployed under Tomcat/work/Catalina/localhost/YourProjectName. The 404 error message means that there is no files in that directory. Since Eclipse has no write permission to this directory, you have to change the access permissions. After changing the permission to 777, there we have the compiled .java and .class files.

Community
  • 1
  • 1
Roman Wang
  • 11
  • 3
0

Since you do not have any of them

index.html/index.htm/index.jsp/default.html/default.htm/default.jsp page

To run your jsp page :

In Eclipse:

=>goto Java Resource

=>right click on your jsp page

=>in that select Run as Server.

Baby Groot
  • 4,637
  • 39
  • 52
  • 71
  • Did you put war file in your server – Pankaj Jawale Dec 26 '13 at 05:52
  • what do you mean war file –  Dec 26 '13 at 05:53
  • @user3135774 Can you check A folder "HelloWorldJSP" is inside your tomcat folder( `C:\ProgramFiles\tomcat7\webapps` )? If so Can u check whether the JSP file is there? – Coder Dec 26 '13 at 05:57
  • @SotiriosDelimanolis So what? If its embedded also the project should b copied to tomcat webapps folder – Coder Dec 26 '13 at 05:58
  • @ShijuKBabu hey yeah HelloWorldJSP is not in C:\ProgramFiles\Tomcat7\webapps –  Dec 26 '13 at 06:01
  • @ShijuKBabu I am confused why should HelloWorldJSP be in that directory because I have created the folder in eclipse shouldnt it be in the eclipse workspace directory –  Dec 26 '13 at 06:02
  • @SotiriosDelimanolis in that image the tomcat directory is mentioned. – Coder Dec 26 '13 at 06:03
  • @user3135774 Tomcat server is embedded with eclipse. So it copies your project into tomcat webapps folder – Coder Dec 26 '13 at 06:05
  • @SotiriosDelimanolis `http://i.imgur.com/xYpdz3R.jpg` in this link, left bottom image, its tomcat config – Coder Dec 26 '13 at 06:06
  • @SotiriosDelimanolis see the bottom. The server path is mentioned. – Coder Dec 26 '13 at 06:16
  • @SotiriosDelimanolis then why should that location is mentioned in eclipse? – Coder Dec 26 '13 at 06:19
  • @ShijuKBabu do you guys think I should copy the HelloWorldJSP folder to C:\ProgramFiles\Tomcat7\ webapps folder would that work? –  Dec 26 '13 at 06:19
  • @user3135774 No, there is a specific format it needs to be deployed in. Eclipse should take care of doing that. – Sotirios Delimanolis Dec 26 '13 at 06:20
  • @ShijuKBabu I guess you can specify the actual Tomcat installation dir. – Sotirios Delimanolis Dec 26 '13 at 06:21
  • Well thats what its mentioned I guess – Coder Dec 26 '13 at 06:21
  • @SotiriosDelimanolis cool, so any recommendations what do you think I should do. I can reinstall eclipse and tomcat but I want that to my last resort –  Dec 26 '13 at 06:22
  • @PankajJawale I will have a look at that but I think I followed a similar tutorial. –  Dec 26 '13 at 06:25
0

After applying everythings, it did not work for me to read image file in eclips.

Finally, It works! after that I change deploy path.

Server Locations>Deploy path(Set with "Workspace" of Eclipse)

enter image description here

DSDS
  • 57
  • 7