Hi All,
Ok so this thing has had me pulling my hair for the past three days and I sincerely hope that someone here can help me out.
I am fairly fresh to Java/JSF or
Tomcat for that matter but so far have been managing to win all the battles.
I've got a web app running on Tomcat 7 and Mojarra JSF2. I've decided to implement form based authentication.
That's the deployment security descriptor in my web.xml :
In the Tomcat's server.xml I have the following, enclosed within the Host:
As for the
JDBC and driver, I've tested the connection numerous times on my local machine as well as on the actual server where it's to be deployed and it work's all right (I'm using Weld with JPA2), persistence and dependency injection.
I've set up the users and user_roles tables exactly as prescribed in the Tomcat's docs and inserted a user and a role for
testing.
Now I've tried to use the form within a
JSF and later (as you can see in the above descriptor) with just plain .jsp as I've read in an earlier post here that JSF with container managed form authorization is no go.
The form itself is a plain HTML form (no JSF/JSP) with j_security_check action and j_username and j_password fields.
So what is the actual problem ? Whenever I try to log in (be it with the correct or wrong user and pass) it just takes me right to the loginFailed.jsf .
When I check for any exceptions (Netbeans 7) there either aren't any, as if nothing even happened, or this exception comes up in Apache Tomcat log:
Moreover, the above exception is thrown by Apache on other occasions as well when running the up. As it stands it is now my main suspect and it looks to me as if there was a problem with connection between the browser and the app.
But I may well be wrong.
I know from my experience that often things that in the end turn out to have been the most obvious or easy to solve usually take days to solve .. but right now I'm just going mad with that and really need someone to shed some light on this.
Thanks in advance for any suggestions .
Glen