These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: org.hibernate.HibernateException: Missing column: (on an MyS
PostPosted: Mon Apr 05, 2010 5:33 pm 
Newbie

Joined: Tue Feb 16, 2010 6:57 pm
Posts: 17
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:

Code:
"...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.

Please HELP.

Many Thanks in advance.


Top
 Profile  
 
 Post subject: Re: org.hibernate.HibernateException: Missing column: (on an MyS
PostPosted: Tue Apr 06, 2010 4:16 pm 
Newbie

Joined: Tue Feb 16, 2010 6:57 pm
Posts: 17
I am still getting this Hibernate exception on MySQL - Missing column....

My column is most certainly there. I tried deleting it, it complained, so I knew it must be that field. I renamed it and recreated the database from scratch, same error. I cleaned MySQL and re-installed it numerous times. No help.

Can anyone help me please?


Top
 Profile  
 
 Post subject: Re: org.hibernate.HibernateException: Missing column: (on an MyS
PostPosted: Tue Apr 06, 2010 6:30 pm 
Newbie

Joined: Tue Feb 16, 2010 6:57 pm
Posts: 17
I found a work-around for now. I still don't know what caused the problem, why it behaves that way and how to prevent or fix it. I need more investigation --- after my deadline.

Thru logic and element deduction, I was able to isolate the problem and found out more about this nasty bug (to me).

Even though I have clean MySQL re-install and all newly created databases, this "Missing Column" kept coming up for numerous Column names that were (I think) from a hundred years ago. Some even named the same as some of my current column names.

I do not override column names [@Column (name=...)] and that seemed fine. Here's what I did to get around it:

Even though I was looking at the latest table columns and the missing one is right in front of you, I added this column. It complained duplicate. I delete the column and add it back again.

For ones that are really missing but do not belong and don't know where they came from, I added each and every missing columns after each exception.

Its happy but my tables are messy. It would not allow me to delete these irrelevant fields. I have to let them stay for now and just ignore them.

At least, I can go on with my life...

Many Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.