This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
org.hibernate.HibernateException: Missing column: (on an MySQL database)
Mimi Tam
Ranch Hand
Joined: Mar 05, 2010
Posts: 121
posted
0
Hi,
I was using my root username/password to access a MySQL database via Hibernate / Spring merrily until I made some changes to a couple of tables.
I am now getting an exception right off the bet:
"...Caused by: org.hibernate.HibernateException: Missing column: birth_day in demoDb.consumer
at org.hibernate.mapping.Table.validateColumns(Table.java:254)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1089)
at
....."
The missing column is certainly there.
I tried creating a new user (with DBA privileges) and used that to access the Db instead of root (suggestions found via Google). That didn't help. I created a new user without DBA priviledge and that didn't help either
I don't know what else to try and I cannot get pass this problem. I am stuck.
The missing column is where--in the DB, or in the mapping?
Mimi Tam
Ranch Hand
Joined: Mar 05, 2010
Posts: 121
posted
0
I was getting this exception when I was trying to bring up a Hibernate+Spring web app. That was when the first web page was being brought up and my guess is that it was trying to map my POJOs to the database itself. My POJO has this field and my database has this field but the root/root user used to access the database I think is looking at some other residue database from 100 year ago.
"...Caused by: org.hibernate.HibernateException: Missing column: birth_day in demoDb.consumer
at org.hibernate.mapping.Table.validateColumns(Table.java:254)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1089)
at
....."
Now, I simply could not even access the database after I fiddled with the user table. I think regardless of whether it will help, I need to clean out MySQL registries, databases, user tables and what have you after uninstalling MySQL. Start from a clean slate and reinstall MySQL and create new database.
I was not able to get rid of the old user accounts or databases so far...after re-installing MySQL... It's been 2 days running, problem not fixed and I am about to go insane (just a figurative speech, no need to alert the authorities to come check on me...).
If you've reinstalled MySQL then your users will be gone, unless you were using a custom DB file location or something.
Mimi Tam
Ranch Hand
Joined: Mar 05, 2010
Posts: 121
posted
0
No David. I was not using custom anything, unfortunately.
I did another reinstall and manual cleanup and re-examined the mysql.user table, for some reason this time, the old users were gone with just the newly created root user in it. However, the old databases are still there. I've gotten rid of the MySQL folder manually. I wonder where they came back from.
I could not login programmatically thru Hibernate, only from the command line.
My root has all previleges *. * root@localhost identified by 'root' with grant option. It also has another root entry (on the user table) with "*%" in place of root@localhost.
What even worse, the re-installing of MySQL this time failed in starting the Service on the last step of the Install. Now mind you, the MySQL registry was manually deleted after I uninstalledl MySQL. It was stopped before I deleted it. I saw the MySQL new registry entry on my Service table with no status and configured as AUTOMATIC on my last step of installation but the installation just sat there (stuck) when it tried to start the service.
Somethings are totally messed up and I need to know how to do a FULL CLEAN-UP for MySQL 5.1 (left-over registry entries, folders, files, etc), hoping that may help my situation.
What would you recommend and where can I find this FULL CLEAN-UP info? I really would very much appreciate any help.