You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Santiago Álvarez Martínez <sa...@hotmail.com> on 2010/08/03 22:13:02 UTC
"package org.postgresql.util does not exist" compilation problem
Hi:
I'm developing a Java application, using Maven, Spring and Hibernate, and Postgre (with Postgis) as DBMS.
Everything went OK, until I had to import the org.postgresql.util package, to use the PGobject class, in a UserType Hibernate class.
I got the following errors:
[...]
[loading org/postgis/Geometry.class(org/postgis:Geometry.class)]
[loading org/postgis/binary/BinaryParser.class(org/postgis/binary:BinaryParser.class)]
[loading org/postgis/binary/BinaryWriter.class(org/postgis/binary:BinaryWriter.class)]
/home/perseo/PFC/maven.1264475335794/src/main/java/es/udc/fiestas/model/util/types/PointType.java:15: package org.postgresql.util does not exist
import org.postgresql.util.PGobject;
^
[...]
[checking es.udc.fiestas.web.pages.usuario.CambiarUbicacion]
[checking es.udc.fiestas.model.util.types.PointType]
/home/perseo/PFC/maven.1264475335794/src/main/java/es/udc/fiestas/model/util/types/PointType.java:56: cannot find symbol
symbol : class PGobject
location: class es.udc.fiestas.model.util.types.PointType
PGobject pgo = (PGobject) rs.getObject(names[0]);
^
/home/perseo/PFC/maven.1264475335794/src/main/java/es/udc/fiestas/model/util/types/PointType.java:[56,24] cannot find symbol
symbol : class PGobject
location: class es.udc.fiestas.model.util.types.PointType
In my pom.xml file, I've included the dependencies for both Postgre and Postgis, and Eclipse doesn't complain about them (neither in the pom.xml file, nor in the PointType.java):
<!-- PostgreSQL -->
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>8.4-701.jdbc4</version>
</dependency>
<!-- PostGIS -->
<dependency>
<groupId>org.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>1.3.3</version>
</dependency>
Is there any issue with used JDBC package that doesn't allow to use their classes like any other package?
Note: I have to import that class, to be used here:
public Object nullSafeGet(ResultSet rs, String[] names, Object owner)
throws HibernateException, SQLException {
PGobject pgo = (PGobject) rs.getObject(names[0]);
BinaryParser bp = new BinaryParser();
return (Point) bp.parse(pgo.getValue());
}
As the returned object is a PGobject (from a Geometry Postgis column), I use the PGobject getValue() method to access its content, so I can't generalize that.
Thank you in advance.
Nice regards.
Santiago.
Re: "package org.postgresql.util does not exist" compilation problem
Posted by Ognjen Blagojevic <og...@gmail.com>.
Hi Santiago,
On 3.8.2010 22:13, Santiago Álvarez Martínez wrote:
> Everything went OK, until I had to import the org.postgresql.util package, to use the PGobject class, in a UserType Hibernate class.
>
> I got the following errors:
Is this run-time or compile-time error? What is the exact command you
issue before you get this error?
-Ognjen
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org