I am trying out a sample Security Realm application on
tomcat. The problem is that BASIC authentication does NOT succeed when running the application through NetBeans and embedded Tomcat whereas when I deploy the WAR file manually on Tomcat and start Tomcat through Windows command prompt it successfully runs the application and authentication also succeeds. Not sure why it is failing when running the application through NetBeans. I tried to run the manager app but that also failed through NetBeans-Tomcat whereas it works fine when I jump out of NetBeans environment and start tomcat manually through command prompt. Not sure what's going on here.
My sample application is very small and code chunks are shown below:
web.xml
tomcat-users.xml
Any ideas will be helpful.