File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Bindu Lakhanpal
Ranch Hand
Posts: 171
Flex Java
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean i am not able to access the servlet.

What error do you have ?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic