Monday, July 13, 2009

Error when submiting form data

Still very much stuck with error when submitting form data. It is almost completely obstructing any further progress in the project, since I can not test changes to the code. However, I have found the general direction and some clue to what the problem is. I found stack trace error logs in the Tomcat folder, and found repeated Access Denied error logs:
Load LOCAL DB infomation:jdbc:mysql://localhost:3306/hwm
java.sql.SQLException: Invalid authorization specification, message from server: "Access denied for user 'hwm'@'localhost' (using password: YES)"
Searching google on this error, shows the problem lies with connection to mySQL database. There are two possibilities:
  1. Possible cause: The password or username used to access the database is incorrect
  2. Tried solution: resetting password for all users (including root) to one same password. Also make sure username and password is same in build.xml and DBInfoImpl.java. Restarting tomcat, ant clean, then ant. But this doesn't seem to work.
  3. Possible cause: The user - hwm - do not have enough privileges to access the database.
  4. Tried solution: Re-granting all privileges to user hwm in mySQL command line: GRANT ALL PRIVILEGES ON *.* TO 'hwm'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; The privileges are successfully granted to hwm, but the error consists.
I can not think of other problems for now. Since it's messed up in the database, I will try to re-install the mySQL. Hopefully this will solve the problem.

No comments:

Powered By Blogger