[postgis-users] RE: RE: RE: PostGIS - hibernate (new postgis.jar)

rabbiaqaswar rabbiaqaswar at yahoo.com
Fri Apr 13 01:36:03 PDT 2007


Thanks a lot for your help. Earlier i just had the postgresql jdbc driver &
postgis.jar in my class path. In my entity bean POJO i did what was
mentioned in the ejb3spatial.pdf and included the package containing your
GeometryType.java (user type) in my project. In the persistence.xml file i
set the hibernate.dialect as org.hibernate.dialect.PostgreSQLDialect and my
program was able to retrieve the data from the tables containing
geographical information.

So far things are good :) now should i add PostGISDialect in my
persistence.xml instead of org.hibernate.dialect.PostgreSQLDialect and do i
have to include its java file with the GeometryType in my project? I am a
complete newbie with geographical information related work so please don't
mind my questions.

Many Thanks


Norman Barker-3 wrote:
> 
> Hi,
> 
> I appreciate your confusion it took me a while to work out what was
> going on (I don't have commit access :-( )
> 
> The dialect has been put in its own folder called hibernate at 
> http://svn.refractions.net/postgis/trunk/java/
> 
> you will also need the user type from the ejb3 folder.  Really they
> should be together, my fault I should have communicated this better to
> Markus.
> 
> Let me know I can be of help.
> 
> Thanks,
> 
> Norman
> 
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
> rabbiaqaswar
> Sent: 11 April 2007 23:38
> To: postgis-users at postgis.refractions.net
> Subject: [postgis-users] RE: RE: PostGIS - hibernate (new postgis.jar)
> 
> 
> Hello
> 
> Thanks for your reply. I found this 
> http://svn.refractions.net/postgis/trunk/java/ejb3/ svn link  from your
> earlier posts in this topic, which has that ejb3spatial.pdf file. Can
> you
> please tell me which svn link has the latest information.
> 
> Many Thanks
> 
> 
> 
> Norman Barker-3 wrote:
>> 
>> Hi,
>> 
>> There has been a lot of activity with the hibernate postgis driver,
> just
>> everyone thinks it isn't of interest to the list and mail me
> directly!!
>> (I have no problem with this). 
>> 
>> The major update is the spatial dialect for ejb3 (hibernate) allowing
>> you to make spatial queries in object space, e.g. select obj from
>> mytable where spatial.within(obj.box, ...) 
>> 
>> The code is in SVN, but I don't believe it is in postgis.jar, it is
>> heavily dependent on the JDBC driver and hibernate for its
>> functionality.
>> 
>> Thanks,
>> 
>> Norman
>> 
>> -----Original Message-----
>> From: postgis-users-bounces at postgis.refractions.net
>> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
>> rabbiaqaswar
>> Sent: 10 April 2007 13:29
>> To: postgis-users at postgis.refractions.net
>> Subject: [postgis-users] RE: PostGIS - hibernate (new postgis.jar)
>> 
>> 
>> Thankyou all for the support.
>> 
>> I  am using EJB3 with PostgreSQL & JBoss. Read through the tutorial on
>> svn
>> by Norman Barker. I compiled the GeometryType java file in
>> org.postgis.hibernate and included the org.postgis.hibernate package
> in
>> my
>> classpath and the whole thing worked.
>> 
>> Since the last post on this forum was in November 2006, i wanted to
> know
>> that is there any change in the method to handle gis data from
>> postgresql
>> tables using ejb3 architecture? Is the GeometryType class by Norman
>> included
>> in the latest release of postgis.jar or should it be included
> seperately
>> like i mentioned above?
>> 
>> Thanks again
>> 
>> 
>> Norman Barker-3 wrote:
>>> 
>>> 
>>> I think I missed the start of this thread (and I can't find it in the
>>> archives), can you summarize the problem, and the server you are
>> using?
>>> 
>>> 
>>> The GeometryUserType class doesn't do very much but call out to the
>>> utility functions provided in the postgis jar, so it does sound like
> a
>>> classpath issue.
>>> 
>>> If you can send me a summary I will try to recreate the problem.  (I
>>> have both tomcat and jboss set up here).
>>> 
>>> If the attachment is large please send it to
>> norman.barker<at>gmail.com
>>> 
>>> Thanks,
>>> 
>>> Norman
>>> 
>>> -----Original Message-----
>>> From: postgis-users-bounces at postgis.refractions.net
>>> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
>> Jan
>>> Syryn
>>> Sent: 27 November 2006 16:39
>>> To: 'PostGIS Users Discussion'
>>> Subject: RE: [postgis-users] PostGIS - hibernate (new postgis.jar)
>>> 
>>> ***********************
>>> Warning: Your file, postgis2.jar, contains more than 32 files after
>>> decompression and cannot be scanned.
>>> ***********-***********
>>> 
>>> 
>>> Hi Markus,
>>> 
>>> The thing I did to be able to continue is I have created a
>>> postgis_addon.jar
>>> lib that contained only new stuff like BinaryWriter.class and
>>> GeometryUserType.
>>> And that works. It does not solve the problem, though I can use the
>>> latest
>>> version of postgis.
>>> 
>>> I tried to use the tip I found in my previous posting by changing the
>>> name
>>> of the postgresql-jdbc.jar drvier to pg-jdbc.jar driver with my new
>>> build
>>> postgis2.jar (version 1.1.5)
>>> I did not help.  
>>> If I remove the 2 stub files (PGConnection and Connection) from
>>> postgis2.jar
>>> : same result.
>>> It stucks again on "No suitable driver".
>>> If I replace the postgis2.jar by postgis.jar(1.1.0) and
>>> postgis_addon.jar by
>>> changing the settings on the classpath, everything works again.
>>> 
>>> So, I assume there is a thing in postgis2.jar.
>>> And to create my postgis2.jar, I made a separate project in Eclipse,
>>> created
>>> a jar file of almost all java files(exl examples). This should do it,
>> no
>>> ?
>>> 
>>> Anyway, I included my postgis2.jar so maybe one can replace his one
>> with
>>> mine and see what that does.
>>> Or maybe one sees what I am doing wrong elsewhere...
>>> 
>>> TIA,
>>> Jan
>>> 
>>> -----Original Message-----
>>> From: postgis-users-bounces at postgis.refractions.net
>>> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
>>> Markus
>>> Schaber
>>> Sent: samedi 25 novembre 2006 10:16
>>> To: PostGIS Users Discussion
>>> Subject: Re: [postgis-users] RE: RE: RE: PostGIS - hibernate - EJB3
>>> 
>>> Hi,
>>> 
>>> Norman Barker wrote:
>>> 
>>>> 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.
>>> 
>>> [...]
>>>> 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.
>>> 
>>> Those 2 things look like a classpath/classloader problem.
>>> 
>>> You have to make sure that the postgis.jar and the
> postgresql-jdbc.jar
>>> are
>>> available via the same classloader (and that you don't have two
>>> incarnations
>>> of them in your classpath)
>>> 
>>> 
>>> HTH,
>>> Markus
>>> 
>>> 
>>> --
>>> Markus Schaber | Logical Tracking&Tracing International AG
>>> Dipl. Inf.     | Software Development GIS
>>> 
>>> Fight against software patents in Europe! www.ffii.org
>>> www.nosoftwarepatents.org
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>> 
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>> 
>>> 
>> 
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/PostGIS---hibernate---EJB3-tf2064211.html#a9926716
>> 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
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/PostGIS---hibernate---EJB3-tf2064211.html#a9953356
> 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
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 

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




More information about the postgis-users mailing list