Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

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: 43024
76
  • 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!
 
knowledge is the difference between drudgery and strategic action -- tiny ad
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic