Closed fidoandfido closed 13 years ago
Okay, upon investigation there are several issues here. First off, the application currently doesn't check to see if that user name is taken. This is a bug that has been fixed.
Secondly, there is an issue where by default the mySql database does not care about capilisation in varchar blobs; which is how the user name is stored. Thus a search for "foo" in the database will yield all instances of "foo", as well as "Foo", "FOO" etc. There are various workarounds for this; simplest will be to effectively ignore case sensitivity for the moment; this won't really require any changes.
Fixed for the moment - there is now code in the servlet to detect if the username already exists.
Exception generated when logging on:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.hibernate.NonUniqueResultException: query did not return a unique result: 2 org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:789) org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:305) net.fidoandfido.dao.UserDAO.getUserByUsername(UserDAO.java:19) net.fidoandfido.servlets.LogInServlet.doLogin(LogInServlet.java:48) net.fidoandfido.servlets.LogInServlet.doPost(LogInServlet.java:28) javax.servlet.http.HttpServlet.service(HttpServlet.java:641) javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.11 logs.