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.

14
  • If you go to the Servers tab and expand the Tomcat server, do you see your application? Dec 26, 2013 at 5:25
  • post you pom.xml and web.xml file Dec 26, 2013 at 5:26
  • Check the path of your jsp is correct in web.xml. Dec 26, 2013 at 5:28
  • pastebin.com/Rp8Bw7Mi this is the web.xml not sure what is pom.xml.
    – user3135774
    Dec 26, 2013 at 5:29
  • Restart you tomcat server
    – Yehia Awad
    Dec 26, 2013 at 5:31

4 Answers 4

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.

4
  • what do you mean webroot you mean webcontent
    – user3135774
    Dec 26, 2013 at 7:57
  • Try it and m sure that is only the reason why u getting that error. Dec 26, 2013 at 8:41
  • I have already tried that you need to check my orginal image its got nothing to do with that
    – user3135774
    Dec 26, 2013 at 8:51
  • i checked that then do one thing paste your web.xml file here. Dec 26, 2013 at 9:37
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.

2
  • @tac as user3135774's solution does not work for me, do you have any idea how would I solve it?
    – Roman Wang
    Mar 10, 2016 at 7:55
  • If 777 is not a good idea, other numbers may be set for proper permissions.
    – Roman Wang
    Feb 23, 2017 at 20:20
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.

17
  • Did you put war file in your server Dec 26, 2013 at 5:52
  • what do you mean war file
    – user3135774
    Dec 26, 2013 at 5: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, 2013 at 5:57
  • @SotiriosDelimanolis So what? If its embedded also the project should b copied to tomcat webapps folder
    – Coder
    Dec 26, 2013 at 5:58
  • @ShijuKBabu hey yeah HelloWorldJSP is not in C:\ProgramFiles\Tomcat7\webapps
    – user3135774
    Dec 26, 2013 at 6:01
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.