GeoServer 3 Oracle OCI TNS problem

Hi,

I now successfully updated the server I’m using for seeding from GeoServer 2.28/Tomcat 9 to last week’s GeoServer 3 nightly build/Tomcat 11. Seeding the tile caches from Oracle and WMS sources works fine like before. The only problem I had is that the oracle.net.tns_names system property is now ignored and sqlnet.ora and tnsnames.ora from the ORACLE_HOME path are used. As those not necessarily reflect the settings I’m requiring, I am looking for a solution to this.

Does anyone have an idea?

Regards
Daniel

Hi @dcal

Are you still looking for a solution? Can you reproduce this on the 3.0-RC? If so, how can we guide you (as not many users have access to Oracle DBs) to test this problem for us in the RC period, before the 3.0.0 release?

It might help to ask in the Gitter/Matrix channel https://matrix.to/#/#geoserver:osgeo.org for more immediate back and forth.

Also, linking this to GeoServer 3.0-RC Planning - code freeze thursday

Peter

Hi,

GeoServer and GeoTools do not directly use that variable. However, ,we have been updating the Oracle JDBC driver, which is the part that actually uses that system variable.

GeoServer 3 should be shipping wit ojdbc17-23.26.1.0.0.jar. There is some documentation about it here, a bit sparse:

And more documentation here:

Looking at it…wondering if the tns_names changed to tns_admin?

Cheers
Andrea

1 Like

Hi,

thank you @Peter and @aaime-geosolutions for your ideas and suggestions. I tried a lot of different things and finally found a solution. Before, I had configured the Java parameters
-Doracle.net.tns_admin=C:\Tns\
-DTNS_ADMIN=C:\Tns\
but for whatever reason that value was only respected for accessing the tnsnames.ora file, but not for sqlnet.ora.

Now I added the TNS_ADMIN variable to the Tomcat Windows Service and removed the Java parameters and both files are read from the correct directory. To achieve this, I had to execute:

tomcat11.exe //US//GS3Tomcat ++Environment=TNS_ADMIN=C:\Tns\

For details see the Windows Service How-To. Alternatively this value can be found in the Windows registry at:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\GS3Tomcat\Parameters

Regards
Daniel

Congrats @dcal - glad it is working.

Is there any change or suggestion we could make to the oracle datastore page, or indeed update instructions?

References:

Hi @jive,

I now had a closer look on the documentation and at the moment OCI isn’t even mentioned. I can’t tell why that is and don’t know, what the exact differences between between the ‘normal’ and the OCI driver are, besides the ability to use TNS for specifying connection parameters.

What I’m doing to use OCI data sources in Tomcat 11 on Windows Server is:

  • Add the Oracle extension to the GeoServer installation.
  • Install an Oracle client.
  • Replace the ojdbc*.jar of the Oracle extension with the one included in the Oracle client.
  • Add the path to the Oracle client to the system PATH variable.
  • Set the TNS_NAMES environment variable to the folder where tnsnames.ora and sqlnet.ora reside.
  • If PATH or TNS_NAMES can’t be set system wide, add them to the Tomcat service parameters, f.e.
    tomcat11.exe //US//GS3Tomcat ++Environment=TNS_ADMIN=C:\Tns\

Regards
Daniel

Thanks @dcal, I do not think oracle cloud infrastructure is something we test against. So your email here is nice confirmation that it works.

If you would like to add a heading for OCI there is an edit button at the top of each page.