[Geoserver-users] how to get spatialite in GeoServer 2.1.4

2012-07-08 Thread Harold-Jeffrey Ship

Hi all

I've been using GeoServer for developing a geospatial application, and up
to
now I've been storing my data in a directory of shapefiles. I've found
that when I add features to the shapefiles, the id returned is not correct,
and so I have no idea how to read back the feature later on.

I found this in the archives, which seems to say that it cannot work:
http://permalink.gmane.org/gmane.comp.gis.geoserver.user/10631

I thought I could solve this by using SpatiaLite, so I tried to get it
working in GeoServer 2.1.4.

I found these instructions:
http://docs.geoserver.org/stable/en/user/community/spatialite/index.html

The first issue I encountered was that the link provided
(http://gridlock.opengeo.org/geoserver/trunk/community-latestO/) does not
contain a spatialite plugin. I navigated my way to this link, which does:
http://gridlock.opengeo.org/geoserver/2.1.x/community-latest/

However, I am also supposed to install the GEOS and PROJ repositories
separately. The link provided for GEOS has itself a link to OSGeo4W
which can install 150 different libraries. The PROJ link is dead.

I tried to use OSGeo4W to install the libs, but I can't figure out how
to get spatialite plugin to find them.

When I simply copy the spatialite plugin jars to GeoServer, and try to
create a Spatialite datastore, I get the exception below on the console.

Any help would be appreciated.
-Harold Ship

java.lang.UnsatisfiedLinkError: C:\Users\harold\AppData\Local\Temp
\sqlite-unknown-sqlitejdbc.dll (JVMPORT015E Unable to resolve shared
library references - a prerequisite shared library may be missing)
org.ibex.nestedvm.Runtime$FaultException:
java.lang.ArrayIndexOutOfBoundsException at (unknown)
at org.sqlite.SQLite._execute(target/build/SQLite.mips)
at org.ibex.nestedvm.Runtime.__execute(Runtime.java:506)
at org.ibex.nestedvm.Runtime.call(Runtime.java:678)
at org.ibex.nestedvm.Runtime.call(Runtime.java:647)
at org.sqlite.NestedDB.call(NestedDB.java:574)
at org.sqlite.NestedDB.call(NestedDB.java:560)
at org.sqlite.NestedDB._open(NestedDB.java:73)
at org.sqlite.DB.open(DB.java:88)
at org.sqlite.Conn.open(Conn.java:145)
at org.sqlite.Conn.init(Conn.java:57)
at org.sqlite.JDBC.createConnection(JDBC.java:77)
at org.sqlite.JDBC.connect(JDBC.java:64)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection
(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject
(PoolableConnectionFactory.java:582)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject
(GenericObjectPool.java:1148)
at org.apache.commons.dbcp.PoolingDataSource.getConnection
(PoolingDataSource.java:106)
at org.apache.commons.dbcp.BasicDataSource.getConnection
(BasicDataSource.java:1044)
at
org.geotools.data.spatialite.SpatiaLiteDataStoreFactory.initializeDataSource
(SpatiaLiteDataStoreFactory.java:158)
at
org.geotools.data.spatialite.SpatiaLiteDataStoreFactory.createDataSource
(SpatiaLiteDataStoreFactory.java:137)


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Re: [Geoserver-users] cannot add features with WFS-T

2012-07-03 Thread Harold-Jeffrey Ship

Hi Andrea

Thanks for your answer. I do indeed see a thread deadlock in the thread
dump! In fact, my thread dump (attached) has the exact same deadlock as the
one in the  bug report you mention below. The only difference is I am using
GeoServer 2.1.4.

I have noted this in the bug report.


(See attached file: geoserver.stack)


From:   Andrea Aime andrea.a...@geo-solutions.it
To: Harold-Jeffrey Ship/Haifa/IBM@IBMIL,
Cc: David Winslow dwins...@opengeo.org,
geoserver-users@lists.sourceforge.net
Date:   02/07/2012 05:58 PM
Subject:Re: [Geoserver-users] cannot add features with WFS-T
Sent by:andrea.a...@gmail.com



On Mon, Jul 2, 2012 at 4:35 PM, Harold-Jeffrey Ship har...@il.ibm.com
wrote:
  Hi David

  I tried your suggestion of changing the order, but it makes no
  difference:
  the Feature is not saved and the GeoServer stops responding to all WFS
  calls afterwards.

It probably means it's locked trying to get some XML schema cited in
the WFS request, and failing to do so (there is probably a very long
network timeout in place as well).

This one might be relevant:

http://jira.codehaus.org/browse/GEOS-5174

Cheers
Andrea

--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313
mob:    +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf


geoserver.stack
Description: Binary data
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Re: [Geoserver-users] cannot add features with WFS-T

2012-07-02 Thread Harold-Jeffrey Ship
Hi David

I tried your suggestion of changing the order, but it makes no difference:
the Feature is not saved and the GeoServer stops responding to all WFS
calls afterwards.

I've verified that I can write to this table in PostGIS, and that when I
do, I can see the results in GeoServer. I just cannot write using WFS-T.

-Harold



From:   David Winslow dwins...@opengeo.org
To: Harold-Jeffrey Ship/Haifa/IBM@IBMIL,
Cc: geoserver-users@lists.sourceforge.net
Date:   02/07/2012 04:50 PM
Subject:Re: [Geoserver-users] cannot add features with WFS-T



I think that your problem is that you call FeatureCollection::addFeatures
before setting the transaction - I guess that this means your features are
being added in a different transaction than the one you have a handle to,
so when you commit there are no pending changes.  If you reverse the order
of those operations, does it work better?  It's also important to ensure
you close the transaction (just declare it outside of your try block and
close it in a finally block.)

BTW, this question would be better suited for the GeoTools users list - if
the above suggestions don't help you'll probably get better help there.

--
David Winslow
OpenGeo - http://opengeo.org/

On Sun, Jul 1, 2012 at 8:50 AM, Harold-Jeffrey Ship har...@il.ibm.com
wrote:

  Hi

  This is my first post, and I'm new to GeoServer (and GIS).

  I'm using GeoTools 2.1.4, and trying to develop a WFS-T service which can
  add, update, delete features and of course query them. I'm using
  Java/Geotools 8.0-RC1, and originally was trying to use a shapefile to
  store the layer, but this didn't work. I tried switching to PostGIS but
  the
  problem is the same.

  The problem is this:
  When I try to commit the transaction, the commit returns successfully but
  the feature is NOT saved. Furthermore, the server no longer responds to
  requests to that layer (describeLayerType for example), until I restart
  it.

  My code looks like this:

                  String typeName =
  postgis_runtime:runtime_postgis_layer;
                  try {
                          SimpleFeatureType schema = dataStore.getSchema
  (typeName);
                          SimpleFeatureBuilder featureBuilder = new
  SimpleFeatureBuilder(schema);
                          GeometryFactory geometryFactory =
  JTSFactoryFinder.
  getGeometryFactory(null);
                          com.vividsolutions.jts.geom.Point p =
  geometryFactory.createPoint(new Coordinate(35.0, 32.0));
                          featureBuilder.add(p);
                          featureBuilder.add(my name);
                          SimpleFeature simplefeature =
  featureBuilder.buildFeature
  (null);
                          SimpleFeatureCollection collection =
  FeatureCollections.
  newCollection();
                          collection.add(simplefeature);
                          SimpleFeatureStore store =
  (SimpleFeatureStore)dataStore.getFeatureSource(typeName);
                          Transaction t = new DefaultTransaction();
                          store.addFeatures(collection);
                          store.setTransaction(t);
                          t.commit();
                  } catch (IOException e) {
                          // TODO Auto-generated catch block
                          e.printStackTrace();
                  }

  From the geoserver.log, I can see the request looks like this:

  ?xml version=1.0 encoding=UTF-8?
  Transaction
  xmlns:postgis_runtime=http://www.ibm.com/polaris/postgis_runtime;
  xmlns=http://www.opengis.net/wfs; xmlns:gml=http://www.opengis.net/gml;
  xmlns:ogc=http://www.opengis.net/ogc;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://www.ibm.com/polaris/postgis_runtime
  
http://localhost:8080/geoserver/wfs?request=DescribeFeatureTypeamp;SERVICE=WFSamp;VERSION=1.0.0amp;TYPENAME=postgis_runtime:runtime_postgis_layer
  
   version=1.0.0 service=WFS lockAction=ALL
          Insert
                  postgis_runtime:runtime_postgis_layer
  fid=newpostgis_runtime:runtime_postgis_layer.9223372036854775807
                  postgis_runtime:the_geom
                          gml:Point srsName=EPSG:4326
                                  gml:coordinates decimal=. cs=, ts=
  35.0,32.0/gml:coordinates
                          /gml:Point
                  /postgis_runtime:the_geom
                  gml:namemy name/gml:name
                  /postgis_runtime:runtime_postgis_layer
          /Insert
  /Transaction

  After this there is a sequence of nul's in the log.

  First of all, is my code OK? If so, what can I do to get addFeatures()
  etc.
  working?


  --

  Live Security Virtual Conference
  Exclusive live event will cover all the ways today's security and
  threat landscape has changed and how IT managers can respond. Discussions
  will include endpoint security, mobile security

[Geoserver-users] cannot add features with WFS-T

2012-07-01 Thread Harold-Jeffrey Ship

Hi

This is my first post, and I'm new to GeoServer (and GIS).

I'm using GeoTools 2.1.4, and trying to develop a WFS-T service which can
add, update, delete features and of course query them. I'm using
Java/Geotools 8.0-RC1, and originally was trying to use a shapefile to
store the layer, but this didn't work. I tried switching to PostGIS but the
problem is the same.

The problem is this:
When I try to commit the transaction, the commit returns successfully but
the feature is NOT saved. Furthermore, the server no longer responds to
requests to that layer (describeLayerType for example), until I restart it.

My code looks like this:

String typeName = postgis_runtime:runtime_postgis_layer;
try {
SimpleFeatureType schema = 
dataStore.getSchema(typeName);
SimpleFeatureBuilder featureBuilder = new
SimpleFeatureBuilder(schema);
GeometryFactory geometryFactory = JTSFactoryFinder.
getGeometryFactory(null);
com.vividsolutions.jts.geom.Point p =
geometryFactory.createPoint(new Coordinate(35.0, 32.0));
featureBuilder.add(p);
featureBuilder.add(my name);
SimpleFeature simplefeature = 
featureBuilder.buildFeature
(null);
SimpleFeatureCollection collection = FeatureCollections.
newCollection();
collection.add(simplefeature);
SimpleFeatureStore store =
(SimpleFeatureStore)dataStore.getFeatureSource(typeName);
Transaction t = new DefaultTransaction();
store.addFeatures(collection);
store.setTransaction(t);
t.commit();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

From the geoserver.log, I can see the request looks like this:

?xml version=1.0 encoding=UTF-8?
Transaction
xmlns:postgis_runtime=http://www.ibm.com/polaris/postgis_runtime;
xmlns=http://www.opengis.net/wfs; xmlns:gml=http://www.opengis.net/gml;
xmlns:ogc=http://www.opengis.net/ogc;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://www.ibm.com/polaris/postgis_runtime
http://localhost:8080/geoserver/wfs?request=DescribeFeatureTypeamp;SERVICE=WFSamp;VERSION=1.0.0amp;TYPENAME=postgis_runtime:runtime_postgis_layer;
 version=1.0.0 service=WFS lockAction=ALL
Insert
postgis_runtime:runtime_postgis_layer
fid=newpostgis_runtime:runtime_postgis_layer.9223372036854775807
postgis_runtime:the_geom
gml:Point srsName=EPSG:4326
gml:coordinates decimal=. cs=, ts=
35.0,32.0/gml:coordinates
/gml:Point
/postgis_runtime:the_geom
gml:namemy name/gml:name
/postgis_runtime:runtime_postgis_layer
/Insert
/Transaction

After this there is a sequence of nul's in the log.

First of all, is my code OK? If so, what can I do to get addFeatures() etc.
working?


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users