[Geoserver-devel] Oracle Spatial-NO connection error

Chris,
  I think the connection issue is solved as soon as i changed the tag
to <instance> from <database>.also the host tag has the ip-address of
the database machine instead of the name.,Because now i see these
message:
------------------------------------------------
80055 [FINER] org.vfny.geoserver.requests.RequestKvpReader - clean
request is
typename=topp:test_ora_layers
80075 [FINER] org.vfny.geoserver.config.ConfigInfo - returning typeDir

C:\Tomcat\webapps\geoserver\data/featureTypes/
80075 [FINER] org.vfny.geoserver.config.TypeRepository - about to read
types at
C:\Tomcat\webapps\geoserver\data\featureTypes
80085 [FINER] org.vfny.geoserver.config.TypeInfo - pathToSchema is
C:\Tomcat\w
ebapps\geoserver\data\featureTypes\test_ora_layers\schema.xml
80115 [FINER] org.vfny.geoserver.config.FeatureType - there are nodes:
29
80115 [FINER] org.vfny.geoserver.config.FeatureType - setting property
with 1.2.3.4
80125 [FINER] org.vfny.geoserver.config.FeatureType - setting property
with 1521
80125 [FINER] org.vfny.geoserver.config.FeatureType - setting property
with TESTORA
80135 [FINER] org.vfny.geoserver.config.FeatureType - setting property
with userme
80135 [FINER] org.vfny.geoserver.config.FeatureType - setting property
with passme
80135 [FINER] org.vfny.geoserver.config.FeatureType - setting property
with test_ora_layers
80145 [FINER] org.vfny.geoserver.config.FeatureType - setting property
with oracle
80145 [FINER] org.vfny.geoserver.config.FeatureType - [#text:] is the
node and the name is null
80185 [FINER] org.vfny.geoserver.config.TypeInfo - params is
{table=fw_layers_3
216, user=userme, instance=TESTORA, passwd=passme, host=1.2.3.4,
port=1521
, dbtype=oracle}
80185 [FINER] org.geotools.data.DataSourceFinder - Available Data
Sources:
80185 [FINER] org.geotools.data.DataSourceFinder - PostGIS spatial
database
80185 [FINER] org.geotools.data.DataSourceFinder - ESRI(tm) Shapefiles
(*.shp)
80185 [FINE] org.geotools.data.oracle.OracleDataSourceFactory - oracle
datasour
ce factory constructed
80185 [FINER] org.geotools.data.DataSourceFinder - Oracle Spatial
Database
80185 [FINER] org.geotools.data.oracle.OracleDataSourceFactory -
canProcess cal
led on {table=test_ora_layers, user=userme, instance=TESTORA,
passwd=passme,
host=1.2.3.4, port=1521, dbtype=oracle}
80185 [FINE] org.geotools.data.oracle.OracleDataSourceFactory - create
ds
called in oracle
80196 [FINER] org.geotools.data.oracle.OracleDataSourceFactory -
canProcess cal
led on {table=test_ora_layers, user=userme, instance=TESTORA,
passwd=passme,
host=1.2.3.4, port=1521, dbtype=oracle}
80306 [FINE] org.geotools.data.jdbc.ConnectionPool - No available
connections,
creating a new one.
81567 [FINE]
org.geotools.data.jdbc.ConnectionPool$ConnectionListManager -
Connection closed - adding to available connections.
81567 [FINE] org.vfny.geoserver.responses.WfsException - >
[test_ora_layers]:
  While getting connection to datasource:
org.geotools.data.DataSourceException:
SQL Error occured when generating unique key
81567 [FINE] org.vfny.geoserver.responses.WfsException - return wfs
exception
is <?xml version="1.0" ?>
<ServiceExceptionReport
   version="1.2.0"
   xmlns="http://www.opengis.net/ogc&quot;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
   xsi:schemaLocation="http://www.opengis.net/ogc
http://localhost/geoserver/dat
a/capabilities/wfs/1.0.0/OGC-exception.xsd">
   <ServiceException locator="test_ora_layers">
    While getting connection to datasource:
org.geotools.data.DataSourceException:
SQL Error occured when generating unique key
   </ServiceException>
</ServiceExceptionReport>
-----------------------------------------------
I think you did help me with my database connection issue.Thank you
very much for that.
As per the error that i am getting ,do you think its being caused
because of incorrect type in schema.xml
for the oracle SDO_geometry object??Here is my schema.xml file
  <xs:complexType name="test_ora_layers_Type">
    <xs:complexContent>
      <xs:extension base="gml:AbstractFeatureType">
        <xs:sequence>
          <xs:element name="layer_id" nillable="false" minOccurs="0"
maxOccurs="1">
            <xs:simpleType>
              <xs:restriction base="xs:integer">
                <xs:totalDigits value="10"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
    <xs:element name="shape" type="gml:PolygonPropertyType"
nillable="false" minOccurs="1" maxOccurs="1"/>
        </xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>

thanks again.
regards,
Gautam

<cholmes@anonymised.com> 11/28/03 01:28PM >>>

Could you try it with instance instead of database?
And actually is TESTORA the name of the computer? Is the database
running on your computer? If so you should use 'localhost'
or '127.0.0.1', if not then try the actual ip of the computer instead

TESTORA, for the host parameter.

       Chris

Quoting Gautam Ganguly <ggangul@anonymised.com>:

hi Chris,
I made the loggingLevel FINER.On calling
http://localhost/geoserver/GetCapabilities , i see the oracle part
in
the Tomcat windows.I am just placing the Oracle part of the log

which

i
hope helps you.

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

354900 [FINER] org.geotools.data.DataSourceFinder - Available Data
Sources:
354900 [FINER] org.geotools.data.DataSourceFinder - PostGIS spatial
database
354910 [FINER] org.geotools.data.DataSourceFinder - ESRI(tm)
Shapefiles (*.shp)
354910 [FINE] org.geotools.data.oracle.OracleDataSourceFactory -
oracle datasource factory constructed
354910 [FINER] org.geotools.data.DataSourceFinder - Oracle Spatial
Database
354910 [FINER] org.geotools.data.oracle.OracleDataSourceFactory -
canProcess called on {table=test_ora_layers, user=userme,
passwd=passme,
host=TESTORA, port=1521, database=TESTORA,
dbtype=oracle}
354910 [FINE] org.vfny.geoserver.responses.WfsException - could not
construct a datasource for topp:test_ora_layers with params:
{table=test_ora_layers, user=userme, passwd=passme, host=TESTORA,
port=1521, database=TESTORA, dbtype=oracle}
354910 [WARNING] org.vfny.geoserver.config.TypeInfo - Could not get
DataSource: topp:test_ora_layers during GetCapabilities: could not
construct a datasource for topp:test_ora_layers with params:
{table=test_ora_layers, user=userme, passwd=passme, host=TESTORA,
port=1521, database=TESTORA, dbtype=oracle} returning basic
Capabilities, but GetFeature requests will likely fail.
354920 [FINER] org.vfny.geoserver.servlets.Capabilities - response
is
<?xml version="1.0" encoding="UTF-8"?><WFS_Capabilities
version="1.0.0"
   xmlns="http://www.opengis.net/wfs&quot;
   xmlns:cdf="http://www.opengis.net/cite/data&quot;
   xmlns:topp="http://www.openplans.org/topp&quot;
   xmlns:cgf="http://www.opengis.net/cite/geometry&quot;
   xmlns:ogc="http://www.opengis.net/ogc&quot;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
   xsi:schemaLocation="http://www.opengis.net/wfs
http://localhost/geoserver/dat
a/capabilities/wfs/1.0.0/WFS-capabilities.xsd">
  <Service>
    <Name>FreeFS</Name>
    <Title>The Open Planning Project Basemap Server</Title>
    <Abstract>This is a test server. It contains some basemap data
from New Yor
k City.</Abstract>
    <Keywords>WFS. CITE. New York</Keywords>
    <OnlineResource>http://www.openplans.org/&lt;/OnlineResource&gt;
    <Fees>NONE</Fees>
    <AccessConstraints>NONE</AccessConstraints>
  </Service>

  <Capability>
    <Request>
      <GetCapabilities>
        <DCPType><HTTP><Get
onlineResource="http://localhost/geoserver/GetCapabi
lities?"/></HTTP></DCPType>
        <DCPType><HTTP><Post
onlineResource="http://localhost/geoserver/GetCapab
ilities"/></HTTP></DCPType>
      </GetCapabilities>
      <DescribeFeatureType>
       
<SchemaDescriptionLanguage><XMLSCHEMA/></SchemaDescriptionLanguage>
        <DCPType><HTTP><Get
onlineResource="http://localhost/geoserver/DescribeF
eatureType?"/></HTTP></DCPType>
        <DCPType><HTTP><Post
onlineResource="http://localhost/geoserver/Describe
FeatureType"/></HTTP></DCPType>
      </DescribeFeatureType>
      <GetFeature>
        <ResultFormat><GML2/></ResultFormat>
        <DCPType><HTTP><Get
onlineResource="http://localhost/geoserver/GetFeatur
e?"/></HTTP></DCPType>
        <DCPType><HTTP><Post
onlineResource="http://localhost/geoserver/GetFeatu
re"/></HTTP></DCPType>
      </GetFeature>
      <Transaction>
        <DCPType><HTTP><Get
onlineResource="http://localhost/geoserver/Transacti
on?"/></HTTP></DCPType>
        <DCPType><HTTP><Post
onlineResource="http://localhost/geoserver/Transact
ion"/></HTTP></DCPType>
      </Transaction>
      <LockFeature>
        <DCPType><HTTP><Get
onlineResource="http://localhost/geoserver/LockFeatu
re?"/></HTTP></DCPType>
        <DCPType><HTTP><Post
onlineResource="http://localhost/geoserver/LockFeat
ure"/></HTTP></DCPType>
      </LockFeature>
      <GetFeatureWithLock>
        <ResultFormat><GML2/></ResultFormat>
        <DCPType><HTTP><Get
onlineResource="http://localhost/geoserver/GetFeatur
eWithLock?"/></HTTP></DCPType>
        <DCPType><HTTP><Post
onlineResource="http://localhost/geoserver/GetFeatu
reWithLock"/></HTTP></DCPType>
      </GetFeatureWithLock>
    </Request>
  </Capability>
  <FeatureTypeList>
   <Operations>
    <Query/>
    <Lock/>
   </Operations>
    <FeatureType>
      <Name>topp:road</Name>
      <Title>Random Road Centerlines</Title>
      <Abstract>This is some random road features</Abstract>
      <Keywords>road, New York City, TOPP</Keywords>
      <SRS>http://www.opengis.net/gml/srs/epsg#32118&lt;/SRS&gt;
      <LatLongBoundingBox minx="-74.27000" miny="40.50000"
maxx="-73.80000" maxy
="40.94000"/>
    </FeatureType>
    <FeatureType>
      <Name>topp:rail</Name>
      <Title>NYC Rail Centerlines</Title>
      <Abstract>This is a simple rail coverage from New York
City</Abstract>
      <Keywords>OWS1, rail, railroad, New York City</Keywords>
      <SRS>http://www.opengis.net/gml/srs/epsg#32118&lt;/SRS&gt;
      <LatLongBoundingBox minx="-74.27000" miny="40.50000"
maxx="-73.80000" maxy
="40.94000"/>
    </FeatureType>
    <FeatureType>
      <Name>topp:test_ora_layers</Name>
      <Title>NYC Rail Centerlines</Title>
      <Abstract>This is a simple rail coverage from New York
City</Abstract>
      <Keywords>OWS1, rail, railroad, New York City</Keywords>
      <SRS>http://www.opengis.net/gml/srs/epsg#32118&lt;/SRS&gt;
      <LatLongBoundingBox minx="-74.27000" miny="40.50000"
maxx="-73.80000" maxy
="40.94000"/>
    </FeatureType>
  </FeatureTypeList>
  <ogc:Filter_Capabilities>
    <ogc:Spatial_Capabilities>
      <ogc:Spatial_Operators>
        <ogc:Disjoint/>
        <ogc:Equals/>
        <ogc:DWithin/>
        <ogc:Beyond/>
        <ogc:Intersect/>
        <ogc:Touches/>
        <ogc:Crosses/>
        <ogc:Within/>
        <ogc:Contains/>
        <ogc:Overlaps/>
        <ogc:BBOX/>
      </ogc:Spatial_Operators>
    </ogc:Spatial_Capabilities>
    <ogc:Scalar_Capabilities>
      <ogc:Logical_Operators/>
      <ogc:Comparison_Operators>
        <ogc:Simple_Comparisons/>
        <ogc:Between/>
        <ogc:Like/>
        <ogc:NullCheck/>
      </ogc:Comparison_Operators>
      <ogc:Arithmetic_Operators>
        <ogc:Simple_Arithmetic/>
      </ogc:Arithmetic_Operators>
    </ogc:Scalar_Capabilities>
  </ogc:Filter_Capabilities>
</WFS_Capabilities>

354940 [FINER] org.vfny.geoserver.servlets.Capabilities - response
encoding is
UTF-8
--------------------------------------
Hope that helps.
regards
Gautam

>>> <cholmes@anonymised.com> 11/28/03 12:37PM >>>
It looks like you're doing everything correctly. It should
definitely

be instance, not database, but if you've tried both then it should
work. I think the problem may be a classpath issue. If you could
turn your logging level to finer and start up geoserver, look for a
line like 'Postgis is an available datasource'. There should also

be

two more lines: 'Shapefile is an available datasource' and 'oracle

is

an available datasource' (I'm working off of memory here, might be
slightly different'. So look for those lines, and if the oracle one

is not there then that's probably the problem. If it is I can
probably fix it for you relatively easily (you just have to get the
servlet container recognizing the right meta-inf/service/Data...
line,

that tells which factories are available). If not then we'll have

to

investigate further. Let me know and we can better diagnose the
problem. And thanks for the nice detailed message.

          Chris

Quoting Gautam Ganguly <ggangul@anonymised.com>:

> hi all,
> I am trying to make Geoserver to use oracle-spatial.When i use
the
> url:
> http://localhost/geoserver/GetFeature?typename=topp:test_ora_layers

>
> i get the following on my browser:
> <?xml version="1.0" ?>
> <ServiceExceptionReport version="1.2.0"
> xmlns="http://www.opengis.net/ogc&quot;
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
> xsi:schemaLocation="http://www.opengis.net/ogc
>
> http://localhost/geoserver/data/capabilities/wfs/1.0.0/OGC-
exception.xsd">
> <ServiceException>Please contact the admin, the configuration
for
> topp:test_ora_layers has
> an error. No datasource could be constructed with the params:
> {table=test_ora_layers,
> user=userme, passwd=passme, host=TESTORA, port=1521,
> database=TESTORA, dbtype=oracle} from the
> info.xml file.</ServiceException></ServiceExceptionReport>
> ------------
> I did notice the following message on the tomcat screen:
> ---------------------------------------------------------
> 127853 [WARNING] org.vfny.geoserver.config.TypeInfo - Could not
get
> DataSource:
> topp:test_ora_layers during GetCapabilities: could not construct
a
> datasource
> for topp:test_ora_layers with params: {table=test_ora_layers,
> user=userme,
> passwd=passme, host=TESTORA, port=1521, database=TESTORA,
> dbtype=oracle} returning
> basic Capabilities, but GetFeature requests will likely fail.
>
-------------------------------------------------------------------
> My system settings are:
> OS-Win2000
> Database - oracle Spatial-1.1.7
> WebServer - IIS-5.0
> Tomcat-4.1.27
> Geoserver ver - 1.0
>
> As per the docs,i built Geoserver.war and also managed to
installed
> it
> under Tomcat.
> Calling the url http:\\localhost\geoserver\getcapabilities..i do
get
> the xml doc returned
> to me in the browser.
>
> As per the doc,to make it work with Oracle..i followed all the
> steps
> as mentioned there.
> I got the classes12.zip and sdoapi.zip from oracle and renamed
them
> to
> classes12.jar and sdoapi.jar and placed them into the
> c:\tomcat\webapps\geoserver\web-inf\lib dir.The oracle table has
the
> following table description:
> sql>desc test_ora_layers
> Name Null? Type
> ----------------------------------------- --------
> ----------------------------
> LAYER_ID NUMBER
> SHAPE
> MDSYS.SDO_GEOMETRY
>
> I have the directory under \data\featureTypes\test_ora_layers,as
> mentioned in the doc.
>
> The datasourceparams tag inside the info.xml looks like these:
> --------------------------------------------------------------
> <DatasourceParams>
> <host>TESTORA</host>
> <port>1521</port>
> <instance>TESTORA</instance>
> <user>userme</user>
> <passwd>passme</passwd>
> <table>test_ora_layers</table>
> <dbtype>oracle</dbtype>
> </DatasourceParams>
>
> The Schema.xml looks like these:
> ----------------------------------
> <xs:complexType name="test_ora_layers_Type">
> <xs:complexContent>
> <xs:extension base="gml:AbstractFeatureType">
> <xs:sequence>
> <xs:element name="layer_id" nillable="false"
minOccurs="0"
> maxOccurs="1">
> <xs:simpleType>
> <xs:restriction base="xs:integer">
> <xs:totalDigits value="10"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> <xs:element name="shape" type="gml:PolygonPropertyType"
> nillable="false" minOccurs="1" maxOccurs="1"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
>
> Also in the doc,it is mentioned that in case of oracle,the
> DataSourceParams tag has a child node called <instance> and not
> <database>.Looking at the FeatureType.java,were these
> tags are read in the function getDataParams(..), i saw that these
> function looks for tag called <database>,so i even changed it from
> "instance" to "database" tag but that didnot help it either.
>
> Any help or suggestion would be highly appreciated.
>
> regards,
> Gautam
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/