0

I followed the instructions here to configure Tomcat 7 in Eclipse. As suggested there, I copied the webapps/ROOT directory to the eclipse workspace's wtpwebapps/ directory and I can see the tomcat welcome page now. I was also able to get the test-app project (downloadable from that link) working.

Then to see the examples, I also copied the webapps/examples directory to the wtpwebapps directory and then restarted tomcat in eclipse. But when I try accessing examples via http://localhost:8080/examples/ , it gives me a 404 error.

What more do I need to do to get the above working ?

Hardik Mishra
  • 14,779
  • 9
  • 61
  • 96
Vivek
  • 2,000
  • 3
  • 16
  • 22

1 Answers1

1

I think you need context entry for examples in Server.xml. The default application of a fresh install of Tomcat 7 is ROOT. So, It is not required to make entry.

Go to Package Explorer--> Server --> Tomcat v7.0 Server at localhost-config --> server.xml

Tomcat v7.0 Server at localhost-config, This may be differ in your case.

Add Context entry for examples web application.

Here is the sample entry of my server.xml

And I have copied examples directory to wtpwebapps/ and added entry for like this

 <Context docBase="examples" path="/examples" reloadable="true" source="org.eclipse.jst.jee.server:examples"/>

Restart Tomcat server and you should get http://localhost:8080/examples working.

Also read @BalusC 's answer : HTTP Status 404 - The requested resource (/) is not available

Community
  • 1
  • 1
Hardik Mishra
  • 14,779
  • 9
  • 61
  • 96