I have a very strange bug in my application on Tomcat 7 using Hibernate 3 and ojdbc7.jar: In the current release, a DB column got changed to CLOB, and is configured the following way:
@Column(name = "BESCHREIBUNG")
@Length(min = 0, max = 4000)
@NotNull
@Lob
public String getBeschreibung() {
This works perfectly fine in my local environment (Oracle 11g XE) and in test environment (Oracle 12), however in prelive environment (Oracle 12), I get the following error during application start:
org.hibernate.HibernateException: Wrong column type in XXXX.MYTABLE for column BESCHREIBUNG. Found: clob, expected: varchar2(4000 char)
at org.hibernate.mapping.Table.validateColumns(Table.java:283)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1343) at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:378)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1872)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:906)
Any hints on this? I've already checked tomcat's /lib - directoryif there's an outdated ojdbc or hibernate jar, without success.
According to the message he is still expecting a varchar2
. As he would expect a clob if he finds a @Lob
, I would guess that you didn't deploy the code changes to your prelive environment (at least not successfully).