2010-01-05 79 views
1

我使用Glassfish v2,Hibernate with Annotations + EntityManager和Postgresql 8.4。 我也在顶层的HibernateSpatial和PostGis上使用。 它可以很好地将具有空间属性的实体(com.vividsolutions.jts.geom.Point)保存到Postgis数据库中。如何配置连接池以访问Postgis数据库?

然而,试图获取使用myEntityManager.find(MyClass.class,键)对象时,我有以下异常:
Can't convert object of type org.postgresql.util.PGobject

我不知道,但谷歌搜索周围,似乎连接我用来访问Postgres数据库的池缺少org.postgis.DriverWrapper,这就是为什么与Point属性对应的数据库PGobject无法转换回来的原因。

我无法找到如何将此包装添加到连接池。 有人可以解释如何为PostGis连接配置连接池吗?或者指出这个异常是否来自另一个错误?

谢谢 Tartox

回答

1

任何有兴趣,问题是,postgis.jar在Glassfish的LIB与postgres.jdbc.jar一起失踪。