views:

533

answers:

1

Hi everyone, During the startup of Jboss server, I get the following stacktrace. I wonder why JPA is trying to alter tables that seem to be fine and how to get passed these ERROR messages. Thanks

2009-08-03 11:28:49,683 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table BDPARAMS add constraint FK61733C48FA34BFDC foreign key (ITEMID) references RTELEMENT 2009-08-03 11:28:49,683 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table BDPARAMS add constraint FK61733C48FA34BFDC foreign key (ITEMID) references RTELEMENT 2009-08-03 11:28:49,683 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] ORA-02275: such a referential constraint already exists in the table

2009-08-03 11:28:49,683 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] ORA-02275: such a referential constraint already exists in the table

2009-08-03 11:28:49,745 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table CONTENTITEM add constraint FK692B5EEC44F32395 foreign key (parent_id) references CONTENTLOCATION 2009-08-03 11:28:49,745 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] Unsuccessful: alter table CONTENTITEM add constraint FK692B5EEC44F32395 foreign key (parent_id) references CONTENTLOCATION 2009-08-03 11:28:49,745 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] ORA-02275: such a referential constraint already exists in the table

A: 

I've had similar errors and the problems stem from inaccuracies in the meta data fetch by the jdbc sub-system. The meta data comes back to tell hibernate the constraint is not there but in reality it is not - could be for a number of reasons. I would suggest trying a different dbms also maybe the issue is due user differences between current and user that generated the table. There could also be something wrong with your mapping.

But ultimately the only fool proof way to fix it is to turn of schema sync on startup.

Michael Wiles