[postgis-users] RE: RE: RE: PostGIS - hibernate - EJB3

Norman Barker nbarker at ittvis.com
Tue Nov 7 05:48:52 PST 2006


Hi,

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
whiteman
Sent: 07 November 2006 10:40
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] RE: RE: RE: PostGIS - hibernate - EJB3


Hi Norman (and others),

I have serveral questions/problems:

1. Can you point me where I can find your manual concerning PostGIS and
the
use of GeometryType ?

<ncb>Thanks to Markus this is now in SVN -
http://svn.refractions.net/postgis/trunk/java/ejb3/ in particular
http://svn.refractions.net/postgis/trunk/java/ejb3/ejb3spatial.pdf
</ncb>

2. In the thread here, people are using:
<driver-class>org.postgis.DriverWrapper</driver-class>
When I do the same, I get a "No suitable driver" exception.

For the moment I am using: 
<driver-class>org.postgresql.Driver</driver-class> and that seems to
work
for simple tests.

Is this important ? Maybe this is related with the errors I am getting
further the line.

<ncb>You need to use the driverwrapper class or register the geometry
types yourself; the tutorial has more details.  A sample datasource is
here 
http://svn.refractions.net/postgis/trunk/java/ejb3/jboss/geodata-ds.xml
</ncb>


3. I wanted to use the GeometryType that is packed in PostGIS 1.1.5.
After generating the new JAR and replacing the old one by this one,
I start getting new exceptions:
The class org.postgis.PGbox3d does not implement
org.postgresql.util.PGobject.

Any Idea what this means ??

<ncb>I don't know on this one, sorry.</ncb>

4. Now I put the old PostGIS back and make a very small JAR that
contains
BinaryWriter and GeometryType, and also add it to the classpath. This is
what he sais now:
org.hibernate.MappingException: Could not determine type for:
org.postgis.hibernate.GeometryType

My object looks like this:

                ........
	@Type(type = "org.postgis.hibernate.GeometryType")
	@Column(name="footprint", columnDefinition="Geometry")
	public Geometry getFootprint() {
		return footprint;
	}
	
	public void setFootprint(Geometry footprint) {
		this.footprint = footprint;
	}
               ....................

And if I add 'import org.postgis.hibernate.GeometryType' to the object,
he
does not complain he does not know that import, so the GeometryType is
well
added to the project.

<ncb>this just means that it can't find the jar file on the classpath
for this type.  Please go through the tutorial and do contact me if you
have any problems - quite happy to go through the steps required to get
this running.

Watch this space for my catalog tutorial before the end of this month on
PostGIS, hibernate and Lucene!

Thanks

</ncb> 

Is there anyone who sees a light through this strange effects ?

thanks in advance,
Jan




Norman Barker-3 wrote:
> 
> Hi,
> 
> I have been a bit busy, but it is my intention to write a simple
'spatial'
> tutorial on EJB3 using the postgis geometry type, the functionality
will
> be simple but should get you started.  I know I said I would have it
done
> by last w/end so I will put it top on my priority list.
> 
> Apologies for the delay, posting code with no instructions is bad!
> 
> Norman 
> 
> 

-- 
View this message in context:
http://www.nabble.com/PostGIS---hibernate---EJB3-tf2064211.html#a7216080
Sent from the PostGIS - User mailing list archive at Nabble.com.

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list