|
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.
|