[Geoserver-devel] Issues connecting GeoServer to SAP HANA

Hello all,

For a proof of concept I am trying to connect SAP HANA to my GeoServer
setup. My GeoServer is currently running locally and I have attached a
PostGis database to save geometries drawn with my application. The goal is
to replace the PostGis database with the SAP HANA one.

My application consists of the use of OpenLayers and JTS methods to
calculate intersections and to draw and edit features.

When searching for ways to connect my GeoServer to a Database not present in
the list inside GeoServer, I found out that you could download a plugin so
that you can adjust your JDBC-properties called jdbcConfig. My config file
currently has the following parameters:

enabled=false
initdb=false

initScript=${GEOSERVER_DATA_DIR}/jdbcconfig/scripts/initdb.oracle.sql
import=false
jdbcUrl=jdbc\:sap\://saphana1.creetion.com\:30015
driverClassName=com.sap.db.jdbc.Driver
username=SYSTEM
password=Creetion01

pool.minIdle=4
pool.maxActive=10
pool.poolPreparedStatements=true
pool.maxOpenPreparedStatements=50
pool.testOnBorrow=true
pool.validationQuery=SELECT SRS_OID from SYS.ST_SPATIAL_REFERENCE_SYSTEMS_
WHERE SRS_OID = 151798

When running GeoServer it instantly gives the following errors:

org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'geoServerLoader' defined in URL
[jar:file:/D:/Programs/GeoServer%202.4.0/webapps/geoserver/WEB-INF/lib/main-2.4.0.jar!/applicationContext.xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'JDBCGeoServerLoader' defined in URL
[jar:file:/D:/Programs/GeoServer%202.4.0/
webapps/geoserver/WEB-INF/lib/jdbcconfig-2.4-SNAPSHOT.jar!/applicationContext.xml]:
Error setting property values;
nested exception is org.springframework.beans.PropertyBatchUpdateException;
nested PropertyAccessExceptions (1) are:
PropertyAccessException 1:
org.springframework.beans.MethodInvocationException: Property
'catalogFacade' threw exception;
nested exception is org.springframework.jdbc.UncategorizedSQLException:
PreparedStatementCallback; uncategorized SQLException for SQL [insert into
type (typename) values (?)];
SQL state [null]; error code [0]; Borrow prepareStatement from pool failed;
nested exception is org.apache.commons.dbcp.SQLNestedException: Borrow
prepareStatement from pool failed

My Database is currently behind a VPN connection and according to the errors
my validationQuery is correct.

Now, my question is:
Does anyone have any experience connecting an alternative database to
geoserver using the JDBC config plugin. If so, are there any adjustments I
should make to my file or?

Thanks in advance,
Niels

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Issues-connecting-GeoServer-to-SAP-HANA-tp5092357.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

On Tue, Dec 3, 2013 at 12:12 PM, NielsCreetion <nielsvandermade@anonymised.com

wrote:

Hello all,

For a proof of concept I am trying to connect SAP HANA to my GeoServer
setup. My GeoServer is currently running locally and I have attached a
PostGis database to save geometries drawn with my application. The goal is
to replace the PostGis database with the SAP HANA one.

Then you have to write a new DataStore. If HANA provides a JDBC interface
and
SQL language to access its capabilites, you should be able to leverage the
JDBCDataStore infrastructure (see the PostGIS, Oracle, DB2 database
connectors
back in GeoTools for examples).

What you're looking at now is just a way to store the GeoServer
configuration (the notion
of which layers, styles, stores, workspaces are available to GeoServer)
instead.

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

HANA provides its own version of a JDBC driver, called ngdbc.jar. I have
placed this file into the WEB-INF/lib folder inside the GeoServer directory.
Also, HANA is compatible with the SQL Language.

Niels

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Issues-connecting-GeoServer-to-SAP-HANA-tp5092357p5092365.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

On Tue, Dec 3, 2013 at 12:32 PM, NielsCreetion <nielsvandermade@anonymised.com

wrote:

HANA provides its own version of a JDBC driver, called ngdbc.jar. I have
placed this file into the WEB-INF/lib folder inside the GeoServer
directory.
Also, HANA is compatible with the SQL Language.

In that case, you should be able to use it and write your own DataStore by
coding
a SQLDialect and a FilterToSQL class specific to the HANA supported data
types,
geometry encoding, and spatial filtering primitives.

See these GeoTools modules as examples for the various spatial databases:
https://github.com/geotools/geotools/tree/master/modules/plugin/jdbc

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Hello again,

I have made my own implementation of a HANA Datastore. When starting my
GeoServer it displays the new DataStore succesfully in the list of available
datastores. When connecting to my DB, it does not give an error BUT:

When publishing my table to GeoServer it does not recognize the Geometry
column and in my GeoServer log I get the following errors:
WARN [geotools.jdbc] - Could not find mapping for 'GEOM', ignoring the
column and setting the feature type read only
WARN [gwc.layer] - Requested layer CGIS has no geometry. Won't create
TileLayer

I have a link to GitHub of my implementation of the SQLDialect and
FilterToSQL classes:
https://github.com/akkerman/geotools/tree/master/modules/plugin/jdbc/jdbc-hana/src/main/java/org/geotools/data/hana
<https://github.com/akkerman/geotools/tree/master/modules/plugin/jdbc/jdbc-hana/src/main/java/org/geotools/data/hana&gt;

My create script of my Database in HANA:
CREATE COLUMN TABLE CGis
(
gid INTEGER PRIMARY KEY,
fid DOUBLE,
geom ST_GEOMETRY,
);

Can you help us out?

Niels

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Issues-connecting-GeoServer-to-SAP-HANA-tp5092357p5093925.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.