I have used glassfish server in netbeans, now I changed to tomcat and when I run my web application that I have created in glassfish gives me the error :
D
Complementing the other answers - I was adding the user line i.e.
as people said, but I what I was missing was to simply restart tomcat after that.
Don't forget to restart tomcart service or the changes won't take effect.