Error connecting to db using postgis driver and dialect

Description

I'm attempting to connect to my postgresql db using a hibernate configuration with the following properties:
{{<property name="hibernate.dialect">org.hibernate.spatial.dialect.postgis.PostgisDialect</property>
<property name="hibernate.connection.driver_class">org.postgis.DriverWrapper</property>}}
Because there are geospatial objects in the db. However, when I attempt to connect through the hibernate tools perspective, I get the following error with stack trace:
{{java.lang.NoSuchFieldError: INSTANCE
at org.hibernate.type.StandardBasicTypes.<clinit>(StandardBasicTypes.java:54)
at org.hibernate.spatial.dialect.postgis.PostgisDialect.registerTypesAndFunctions(PostgisDialect.java:55)
at org.hibernate.spatial.dialect.postgis.PostgisDialect.<init>(PostgisDialect.java:42)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.hibernate.dialect.resolver.DialectFactory.constructDialect(DialectFactory.java:157)
at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:109)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:146)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2155)
at org.hibernate.console.ConsoleConfiguration$6.execute(ConsoleConfiguration.java:430)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107)
at org.hibernate.console.ConsoleConfiguration.getSettings(ConsoleConfiguration.java:428)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$2.execute(LazyDatabaseSchemaWorkbenchAdapter.java:119)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:115)
at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:65)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)}}

If I change the relevant properties in my config file to:
{{<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>}}

I'm able to connect fine. I guess something to do with the postgis driver and dialect screws with hibernate tools connecting.

Environment

(about affected version, I don't think I'm using hibernate tools 4.0.0.CR1, when I go to "About Eclipse" and click on JBoss by Red Hat I see "Version: 3.7.1.Final-v20131205-0918-B107" but 3.7.1 is not listed in available "Affected Version")

eclipse: kepler
hibernate-commons-annotations-4.0.1
hibernate-core-4.1.8
hibernate-jpa-2.0
hibernate-spatial-4.0

Activity

Show:
William Bowen
March 10, 2014, 5:46 PM

I am also running into the same issue.

Assignee

Unassigned

Reporter

Geoff Little

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

Yes, please

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Time tracking

0m

Time remaining

448h

Components

Affects versions

Priority

Major