RE: [Geoserver-devel] Problems recognising Oracle source fo r Feature Type

Hi Stuart,

Try using FISPATIAL as the feature type name. Unfortunately Oracle through JDBC only pays attention to table names in upper case for some reason. I have to Chris to add this to the documentation…

Hope this fixes it,
Sean


From: Stuart.Girvan@anonymised.com [mailto:Stuart.Girvan@anonymised.com]
Sent: Friday, 16 January 2004 12:01 PM
To: geoserver-devel@lists.sourceforge.net
Subject: [Geoserver-devel] Problems recognising Oracle source for Feature Type

Hi there,

I’ve recently just installed Geoserver on my PC. I can get responses to the GetCapabilities and GetFeature requests for the example data sources that come with the code but I can’t get it to recognise a new datasource/featuretype in Oracle. The stack trace while starting up Tomcat follows below (by the way the error about obtaining schema is a bit confusing - does it mean Oracle schema or XML.schema, it would be nice to make that a bit clearer in the error message). It seems to be a very similar problem to one reported by Bronwyn Cook (in December I think, can’t tell because the archives are down at the moment). I don’t know if Bronwyn,Sean or anyone else managed to solve the problem but it would be very handy to know. I’ve also added the text of the catalog.xml and info.xml files I’ve used, and the Oracle details at the end of this message.

Secondly, and you’ll have to excuse my ignorance on this because I’ve only been using Java for six months or so, while I was tracking through the code trying to work out the problem above, I kept hitting a dead end at some of the geotools class definitions (for example dataStoreFinder in org.geotools.data), where they are imported into gesoserver classes from jar files as opposed to being packaged up with the rest of the application. Is the source code for the geotools kept encapsulated for some reason (eg its proprietary)? And if not is it possible to look at the source somewhere?

Thanks,

Stuart

9250 [INFO] org.geotools.data.jdbc.JDBCDataStore - returning locking manager or

g.geotools.data.InProcessLockingManager@anonymised.com

org.vfny.geoserver.config.ConfigurationException: Error obtaining schema for cdf

:fispatial: Feature type could not be found for fispatial

at org.vfny.geoserver.config.FeatureTypeConfig.(FeatureTypeConfig.

java:148)

at org.vfny.geoserver.config.CatalogConfig.loadFeatureTypes(CatalogConfi

g.java:539)

at org.vfny.geoserver.config.CatalogConfig.loadFeatureTypes(CatalogConfi

g.java:530)

at org.vfny.geoserver.config.CatalogConfig.loadFeatureTypes(CatalogConfi

g.java:530)

at org.vfny.geoserver.config.CatalogConfig.(CatalogConfig.java:207

)

at org.vfny.geoserver.config.ServerConfig.load(ServerConfig.java:310)

at org.vfny.geoserver.config.ServerConfig.(ServerConfig.java:88)

at org.vfny.geoserver.config.ServerConfig.load(ServerConfig.java:205)

at org.vfny.geoserver.servlets.FreefsLog.init(FreefsLog.java:64)

at javax.servlet.GenericServlet.init(GenericServlet.java:256)

at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.

java:935)

at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:82

at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex

t.java:3420)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:3

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase

.java:821)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:80

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)

at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep

loyer.java:307)

at org.apache.catalina.core.StandardHost.install(StandardHost.java:772)

at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:492

)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:400

)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:718)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java

:358)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl

eSupport.java:166)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347

)

at org.apache.catalina.core.StandardService.start(StandardService.java:4

at org.apache.catalina.core.StandardServer.start(StandardServer.java:219

at org.apache.catalina.startup.Catalina.start(Catalina.java:512)

at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)

at org.apache.catalina.startup.Catalina.process(Catalina.java:180)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

Caused by: org.geotools.data.SchemaNotFoundException: Feature type could not be

found for fispatial

at org.geotools.data.jdbc.JDBCDataStore.getSchema(JDBCDataStore.java:246

)

at org.geotools.data.jdbc.JDBCDataStore.getFeatureSource(JDBCDataStore.j

ava:355)

at org.vfny.geoserver.config.FeatureTypeConfig.getRealFeatureSource(Feat

ureTypeConfig.java:352)

at org.vfny.geoserver.config.FeatureTypeConfig.getSchema(FeatureTypeConf

ig.java:482)

at org.vfny.geoserver.config.FeatureTypeConfig.(FeatureTypeConfig.

java:146)

… 37 more

9265 [WARNING] org.vfny.geoserver.config.CatalogConfig - could not add FeatureT

ype at C:\jakarta-tomcat-4.1.24\webapps\geoserver\data\featureTypes\fispatial\in

fo.xml due to org.vfny.geoserver.config.ConfigurationException: Error obtaining

schema for cdf:fispatial: Feature type could not be found for fispatial

Catalog.xml

<?xml version="1.0" encoding="UTF-8"?>

British Columbia sample road shapefiles

My local postgis testing database

My local postgis testing database

A test SDE database

info.xml <?xml version="1.0" encoding="UTF-8"?> fispatial Fluid Inclusions These are fluid inclusions geology 4283 Oracle details Host=Mica Instace=ORADEV Username=sgirvan Port=1521 Version 9.2.0.4.0

Ok, updated the documentation, check it to make sure it's right. And let
me know if the attribute thing is the same, and I can do that as well.

And does it matter if the tablename in oracle itself is upper or lower
case? Or is oracle not case-sensitive?

Chris

On Fri, 16 Jan 2004, Geoghegan, Sean wrote:

Hi Stuart,

Try using FISPATIAL as the feature type name. Unfortunately Oracle through JDBC only pays attention to table names in upper case for some reason. I have to Chris to add this to the documentation...

Hope this fixes it,
Sean

  _____

From: Stuart.Girvan@anonymised.com [mailto:Stuart.Girvan@anonymised.com]
Sent: Friday, 16 January 2004 12:01 PM
To: geoserver-devel@lists.sourceforge.net
Subject: [Geoserver-devel] Problems recognising Oracle source for Feature Type

Hi there,

I've recently just installed Geoserver on my PC. I can get responses to the GetCapabilities and GetFeature requests for the example data sources that come with the code but I can't get it to recognise a new datasource/featuretype in Oracle. The stack trace while starting up Tomcat follows below (by the way the error about obtaining schema is a bit confusing - does it mean Oracle schema or XML.schema, it would be nice to make that a bit clearer in the error message). It seems to be a very similar problem to one reported by Bronwyn Cook (in December I think, can't tell because the archives are down at the moment). I don't know if Bronwyn,Sean or anyone else managed to solve the problem but it would be very handy to know. I've also added the text of the catalog.xml and info.xml files I've used, and the Oracle details at the end of this message.

Secondly, and you'll have to excuse my ignorance on this because I've only been using Java for six months or so, while I was tracking through the code trying to work out the problem above, I kept hitting a dead end at some of the geotools class definitions (for example dataStoreFinder in org.geotools.data), where they are imported into gesoserver classes from jar files as opposed to being packaged up with the rest of the application. Is the source code for the geotools kept encapsulated for some reason (eg its proprietary)? And if not is it possible to look at the source somewhere?

Thanks,

Stuart

9250 [INFO] org.geotools.data.jdbc.JDBCDataStore - returning locking manager or

g.geotools.data.InProcessLockingManager@anonymised.com

org.vfny.geoserver.config.ConfigurationException: Error obtaining schema for cdf

:fispatial: Feature type could not be found for fispatial

        at org.vfny.geoserver.config.FeatureTypeConfig.<init>(FeatureTypeConfig.

java:148)

        at org.vfny.geoserver.config.CatalogConfig.loadFeatureTypes(CatalogConfi

g.java:539)

        at org.vfny.geoserver.config.CatalogConfig.loadFeatureTypes(CatalogConfi

g.java:530)

        at org.vfny.geoserver.config.CatalogConfig.loadFeatureTypes(CatalogConfi

g.java:530)

        at org.vfny.geoserver.config.CatalogConfig.<init>(CatalogConfig.java:207

)

        at org.vfny.geoserver.config.ServerConfig.load(ServerConfig.java:310)

        at org.vfny.geoserver.config.ServerConfig.<init>(ServerConfig.java:88)

        at org.vfny.geoserver.config.ServerConfig.load(ServerConfig.java:205)

        at org.vfny.geoserver.servlets.FreefsLog.init(FreefsLog.java:64)

        at javax.servlet.GenericServlet.init(GenericServlet.java:256)

        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.

java:935)

        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:82

3)

        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex

t.java:3420)

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3

608)

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase

.java:821)

        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:80

7)

        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)

        at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep

loyer.java:307)

        at org.apache.catalina.core.StandardHost.install(StandardHost.java:772)

        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:492

)

        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:400

)

        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:718)

        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java

:358)

        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl

eSupport.java:166)

        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)

        at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)

        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)

        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347

)

        at org.apache.catalina.core.StandardService.start(StandardService.java:4

97)

        at org.apache.catalina.core.StandardServer.start(StandardServer.java:219

0)

        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)

        at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)

        at org.apache.catalina.startup.Catalina.process(Catalina.java:180)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:324)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

Caused by: org.geotools.data.SchemaNotFoundException: Feature type could not be

found for fispatial

        at org.geotools.data.jdbc.JDBCDataStore.getSchema(JDBCDataStore.java:246

)

        at org.geotools.data.jdbc.JDBCDataStore.getFeatureSource(JDBCDataStore.j

ava:355)

        at org.vfny.geoserver.config.FeatureTypeConfig.getRealFeatureSource(Feat

ureTypeConfig.java:352)

        at org.vfny.geoserver.config.FeatureTypeConfig.getSchema(FeatureTypeConf

ig.java:482)

        at org.vfny.geoserver.config.FeatureTypeConfig.<init>(FeatureTypeConfig.

java:146)

        ... 37 more

9265 [WARNING] org.vfny.geoserver.config.CatalogConfig - could not add FeatureT

ype at C:\jakarta-tomcat-4.1.24\webapps\geoserver\data\featureTypes\fispatial\in

fo.xml due to org.vfny.geoserver.config.ConfigurationException: Error obtaining

schema for cdf:fispatial: Feature type could not be found for fispatial

Catalog.xml

<?xml version="1.0" encoding="UTF-8"?>

<catalog>

  <datastores>

    <!--

    a datastore configuration element serves as a common data source connection

    parameters repository for all featuretypes it holds.

    -->

    <datastore id="bc.shp" enabled="true" namespace="topp">

      <description>British Columbia sample road shapefiles</description>

      <connectionParams>

        <!-- The filename parameter can be used for shapefiles if they are

             in the conf/featureTypes directory. The value should be given

             relative to conf/featureTypes, so for the sample file located

             in geoserver/conf/featureTypes/bc_roads the following works:

          -->

        <parameter name="filename" value="/bc_roads/bc_roads.shp"/>

        <!-- The parameter can also be given as an absolute url, to a file

              or even an http location. It can be tricky getting the

              exact string correct, but it allows more flexibility. -->

        <!--

         <parameter name="url" value="file:/tmp/geoserver/conf/featureTypes/bc_roads/bc_roads.shp"/>

         -->

      </connectionParams>

    </datastore>

    <datastore id="local.postgis" enabled="false" namespace="topp">

      <!-- enabled is optional, defaults to true -->

      <description>My local postgis testing database</description>

      <connectionParams>

        <parameter name="dbtype" value="postgis"/>

        <parameter name="host" value="localhost"/>

        <parameter name="port" value="5432"/>

        <parameter name="database" value="testdb"/>

        <parameter name="user" value="postgres"/>

        <parameter name="passwd" value="postgres"/>

        <!-- optional charset param. -->

        <parameter name="charset" value="iso-8859-1"/>

      </connectionParams>

    </datastore>

    <datastore id="oradev.sgirvan" enabled="true" namespace="cdf">

      <description>My local postgis testing database</description>

      <connectionParams>

        <parameter name="dbtype" value="oracle"/>

        <parameter name="host" value="mica"/>

        <parameter name="port" value="1521"/>

        <parameter name="instance" value="ORADEV"/>

        <parameter name="user" value="sgirvan"/>

        <parameter name="passwd" value="xxxxxxx"/>

      </connectionParams>

    </datastore>

    <datastore id="bizkaia.sde" enabled="false" namespace="cgf">

      <!-- enabled is optional, defaults to true -->

      <description>A test SDE database</description>

      <connectionParams>

        <parameter name="dbtype" value="arcsde"/>

        <parameter name="server" value="localhost"/>

        <parameter name="port" value="5151"/>

        <parameter name="instance" value="sde"/>

        <parameter name="user" value="sde"/>

        <parameter name="password" value="carto"/>

      </connectionParams>

    </datastore>

  </datastores>

  <!-- Defines namespaces to be used by the datastores. -->

  <namespaces>

    <!-- Those in the default namespace can be queried without a xml prefix-->

    <namespace default="true" uri="http://www.openplans.org/topp&quot; prefix="topp"/>

    <namespace uri="http://www.opengis.net/cite/data&quot; prefix="cdf"/>

    <namespace uri="http://www.opengis.net/cite/geometry&quot; prefix="cgf"/>

  </namespaces>

  <!-- Defines the style ids to be used by the wms. The files must be

       contained in geoserver/misc/wms/styles. We're working on finding

       a better place for them, but for now that's where you must put them

       if you want them on the server.

   -->

  <styles>

    <style id="thick outline" filename="polyshp.sld"/>

    <style id="dotty" filename="funkypolyshp.sld"/>

    <style id="green" filename="green.sld"/>

    <style id="blue" filename="blue.sld"/>

    <style id="maleVsFemale" filename="usa_ratio.sld"/>

    <style id="normal" filename="normal.sld" default="true"/>

  </styles>

</catalog>

info.xml

<?xml version="1.0" encoding="UTF-8"?>

<featureType datastore="oradev.sgirvan">

  <!-- the name of the featureType in the dataStore, for postgis it

             should be the tablename. -->

  <name>fispatial</name>

  <!-- service elements returned for the capabilities document. -->

  <title>Fluid Inclusions</title>

  <abstract>These are fluid inclusions</abstract>

  <keywords>geology</keywords>

  <!-- The bounding box for this featureType, in lat long coords. -->

  <!--latLonBoundingBox minx="-74.27000" miny="40.50000" maxx="-73.80000" maxy="40.94000"/-->

  <latLonBoundingBox dynamic="false" minx="114" miny="-40" maxx="157" maxy="-12"/>

  <!-- EPSG code for the FeatureType -->

  <SRS>4283</SRS>

  <!-- the list of exposed attributes. If the list is empty or not present

        at all, all the FeatureType's attributes are exposed, if is present,

        only those oattributes in this list will be exposed by the services.

        So if the geom_test table also contained a 'length' field, it would

        never be seen by the user. -->

  <styles default="normal"/>

</featureType>

Oracle details

Host=Mica

Instace=ORADEV

Username=sgirvan

Port=1521

Version 9.2.0.4.0

--