Oracle NG failure caused by Oracle NG OCI support
-------------------------------------------------

                 Key: GEOT-2897
                 URL: http://jira.codehaus.org/browse/GEOT-2897
             Project: GeoTools
          Issue Type: Bug
          Components: data oraclespatial
    Affects Versions: 2.6.0, 2.6.1, 2.7-M0
            Reporter: Ben Caradoc-Davies
            Assignee: Andrea Aime
            Priority: Critical


Oracle NG OCI support added in GEOT-2873 breaks Oracle NG because it claims to 
be able to handle any parameters with dbtype=oracle, even those without "alias" 
defined. If OracleNGOCIDataStoreFactory is first in the SPI resource list, all 
Oracle connections will be OCI, even those without "alias" set, and connections 
will fail if OCI drivers are not installed. Even if OCI drivers are installed, 
connections will probably fail because "alias" is used to construct the jdbc 
connection string, and will probably result in an NPE. 

Symptoms: GeoServer users get the following trying to use a dbtype=oracle or 
dbtype=Oracle connection with ojdbc5.jar but no OCI drivers installed:
{code}
java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path no ocijdbc10 
in java.library.path
{code}

Workaround is to:
(1) Unjar the gt-jdbc-oracle jar
(2) Remove the org.geotools.data.oracle.OracleNGOCIDataStoreFactory line from 
META-INF/services/org.geotools.data.DataStoreFactorySpi to disable SPI for 
OracleNGOCIDataStoreFactory
(3) Rejar the gt-jdbc-oracle jar
(4) Restart GeoServer.
This is confirmed to fix the problem in GeoServer 2.1-SNAPSHOT (GeoTools 
2.7-SNAPSHOT).

Because OCI support was added to GeoTools 2.6.x, this bug will likely also 
affect it and thus GeoServer 2.0.x.

In the old OracleOCIDataStoreFactory, alias was mandatory, and so could be used 
to disambiguate the DataStoreFactory.

(I did not see this in Oracle testing for GeoServer 2.0.1 release because I 
used JNDI, which shielded me from the bug.)

Probable fix: make "alias" mandatory, as it was in the old 
OracleOCIDataStoreFactory.

In OracleNGOCIDataStoreFactory change this:

{code}
static final Param ALIAS = new Param("alias", String.class,
"The alias to the oracle server, as defined in the tnsnames.ora file", false);
{code}

to this:

{code}
static final Param ALIAS = new Param("alias", String.class,
"The alias to the oracle server, as defined in the tnsnames.ora file", true);
{code}

(Last parameter to Param constructor becomes true.)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to