• 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

Unable to access the servlet even on entering username/password set in tomcat-users.xml

 
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have set username in tomcat-users.xml file like:



And in web.xml i have set the various tags like:





But when i try to access the servlet /myServ.do i am asked to enter username and password. But its not accepting any of username and password i set in tomcat-users.xml..(Bindu, bindu) or (admin, ).I mean i am not able to access the servlet.
Why so?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I mean i am not able to access the servlet.


What error do you have ?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're not by any chance running Tomcat from within an IDE or something like that, are you?
 
Bindu Lakhanpal
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If i enter Bindu/bindu.. On third time i get this response

the resulting url is:
http://localhost:8080/SimpleTag5/myServ.do?movilis=first&gen=A&movilis=second&gen=B&movilis=third&gen=C

and the output is:

HTTP Status 401 -

--------------------------------------------------------------------------------

type Status report

message

description This request requires HTTP authentication ().


--------------------------------------------------------------------------------

Apache Tomcat/6.0.16



If i enter admin on first time itself i get this :

the resulting url is:

http://localhost:8080/SimpleTag5/myServ.do?movilis=first+&gen=A&movilis=second&gen=B&movilis=third&gen=C


and the output is:

HTTP Status 403 - Access to the requested resource has been denied

--------------------------------------------------------------------------------

type Status report

message Access to the requested resource has been denied

description Access to the specified resource (Access to the requested resource has been denied) has been forbidden.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.16



And i am not running Tomcat from within an IDE.
 
Bindu Lakhanpal
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its working now.
I just stopped and restarted Tomcat again.
I think I did not restart tomcat when i changed tomcat-users.xml .Thats why it was not accepting the username and passwords.
Well,I am happy now!
 
reply
    Bookmark Topic Watch Topic
  • New Topic