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.
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?
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?
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:
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
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\