![](/img/trans.png)
[英]hibernate-spatial unresolved dependencies postgis-jdbc;1.5.3: not found
[英]Type geometry not found with postgis and hibernate-spatial
我正在嘗試使用postgis設置具有休眠空間的項目。 在針對休眠空間4.0-M1的教程之后,我首先遇到了以下問題:找不到依賴項postgis-jdbc-1.5.3.jar。 就像有人建議的那樣,我使用了1.5.2版,並且該教程進行了編譯。
但是,如果我嘗試運行它,則會出錯。 我將休眠的調試級別設置為調試,並偶然遇到以下問題:
DEBUG SQL -
create table Event (
id int8 not null,
date timestamp,
location GEOMETRY,
title varchar(255),
primary key (id)
)
Hibernate:
create table Event (
id int8 not null,
date timestamp,
location GEOMETRY,
title varchar(255),
primary key (id)
)
ERROR SchemaExport - HHH000389: Unsuccessful: create table Event (id int8 not null, date timestamp, location GEOMETRY, title varchar(255), primary key (id))
ERROR SchemaExport - FEHLER: Typ ╗geometry½ existiert nicht Position: 94
錯誤是德語,但表示“幾何”類型不存在。
如果我使用create table語句並在pgadmin中執行它,則可以找到它,因此我認為數據庫已正確設置。
我的版本:
postgres - 9.0 64Bit
postgis - 2.0.1 64Bit
hibernate-spatial - 4.0-M1
hibernate - 4.0.0-Final
postgis-jdbc - 1.5.2
尋求幫助
周傑倫
您的Postgresql不支持幾何。 您需要向其添加postgis
擴展名才能創建空間數據庫。 因此,可以從此處為您的postgresql下載合適的postgis擴展。 然后將其完全安裝在postgresql安裝文件夾中,例如(在我的系統中)以下路徑:
C:\Program Files (x86)\OpenGeo\OpenGeo Suite\pgsql\9.1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.