Incompatible API error when using org.hibernate.dialect.SQLServer2008Dialect with hibernate3-maven-plugin

1.9k views Asked by At

I had previously set my project up to use hibernate3-maven-plugin with org.hibernate.dialect.SQLServerDialect as the hibernate.dialect and everything was working fine.

But when I changed the dialect to org.hibernate.dialect.SQLServer2005Dialect, hibernate3-maven-plugin encounters the following error:

An API incompatibility was encountered while executing org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2ddl: java.land.NoSuchMethodError: org.hibernate.dialect.SQLServer2005Dialect.registerColumnType(IJLjava/lang/String;)V

Does hbm2ddl support SQLServer2005Dialect or SQLServer2008Dialect (I also get the same error with 2008)?

I am using version 2.2 of the plugin and hibernate.4.1.0.Final and JPA 2.0.

1

There are 1 answers

1
fancy britches On

Just lost a few days to the same error with gradle and glassfish. I added my own SqlServer2005Dialect from source, and commented out the registerColumnType() lines. From here, the error changed to "java.lang.NoSuchFieldError: INSTANCE"

This is a much more google-able error, and basically means you have 2 sets of hibernate jars.

In my case, I had installed hibernate via glassfish before hibernate was put into the gradle build. Uninstalling hibernate from glassfish fixed my error, and I can now run the 2008 or 2005 dialects.