Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Deployment / 404 resource() not available error

 
Robyn Morin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am relatively new to servlets, but I am trying to test a simple servlet with Ubuntu Karmic Koala 9.10 and Tomcat 6 and while I am able to seemingly get Tomcat working to the point where I can see the Tomcat page and run the Servlet and JSP examples when I visit http://localhost:8080, I cannot seem to get my own servlet to work when I add the new folder to the Tomcat folder webapps. In this folder I have created my new servlet folder which includes a folder WEB-INF which contains web.xml and the folder classes which contains MyServlet.class.

Based on the example I am working from this is all I should need to get my basic servlet up and running but when I try to visit the url corresponding to my servlet I get the http 404 error "resource() not available"

Is there some sort of Tomcat configuration that I need to do to be able to use my own servlets?

Thanks

Robyn
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64972
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the servlet in a package other than the default? If not, fix that.

Did you declare and map the servlet in the deployment descriptor? Are you using the correct URL to address this mapping?
 
Robyn Morin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I discovered the problem is because of the following

<?xml version="1.0" encoding="ISO-8851-1"?> = bad
<?xml version="1.0" encoding="UTF-8"?> = good

anyhow someone in another thread provided me the answer.

Sorry for posting a duplicate thread.

Robyn
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic