• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Requested Resource() not available

 
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi !
I am getting the error of "requested resource not available" while trying out the code of HFSJ pg. 30.
I had the same problem earlier, but it worked after I changed the coding from encoding="ISO-8851-1" to encoding="ISO-8859-1".
Some one had mentiioned that earlier in java ranch.
I know, usually this problem occurs when there is some problem with the web.xml file or mapping.

Tried checking everything including the location of the files and all ,but still couldnt get it right.
Can any one help me to what I may be overlooking..

My web.xml file is


Location for the web.xml file is C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ch1\WEB-INF
Location for Ch1Servlet.java files is C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ch1\WEB-INF\classes

I read a number of posts which had exactly the same problem but still couldn't find the solution for mine

thanks!
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you see in your Tomcat logs whether your application was deployed correctly after Tomcat startup?
Which url do you enter in your browser to call your servlet?
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all it's good to have the classes (or servlets) in a user defined package rather than default. And how are you accessing the servlet (URL in the browser)?
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My url to access the servlet is http://localhost:8080/ch1/Serv1
I am not sure how to access the Tomcat Log .
If some one can help me , may be i can check it out ..
 
Vijitha Kumara
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Change url pattern to /Serv1 in web.xml. Restart the context and chaeck again.
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried that as well ...
It didn't work
 
Vijitha Kumara
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you move the servlet to a package and try it with all the necessary modifications in web.xml?
 
Frank Eichfelder
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can find the log files in the directory C:\Program Files\Apache Software Foundation\Tomcat 5.5\logs.
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I haven;t tried moving to a different package... I am still new at this and haven't gotten a hang of it. I have more chances of messing up trying something new ,when I am unable to get the stuff written on the book right!
I checked out the logs - looked ok to me (not sure what i was supposed to be looking for )
but from what i did make out it looked fine...


Anway, I ll just keep searching tilll i find the error
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can some one tell me how to delete a post!?!
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it right!!!

I think i had two different web.xml files , and I was looking at the wrong one!


Thanks alot for all your suggestions!
 
Vijitha Kumara
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad you solve it
 
I am going to test your electrical conductivity with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic