Forum Stats

  • 3,767,982 Users
  • 2,252,736 Discussions


Upgrade from ORDS 20.4.3 to 21.2 failing with TNS Settings on Windows

User_Z4K9S Member Posts: 20 Blue Ribbon


Trying to upgrade ORDS 20.4.3 to 21.2 - going through the procedure I usually use but getting this error:

C:\Oracle\ORDS\Install>java\Oracle\Middleware\Oracle_Home\network\ADMIN -jar ords.war install advanced

This Oracle REST Data Services instance has not yet been configured.

Please complete the following prompts

Enter the location to store configuration data: C:\Oracle\ORDS

Using existing ORDS configuration files located at C:\Oracle\ORDS\ords

Verify ORDS schema in Database Configuration apex using connection url jdbc:oracle:thin:@MYTNSALIAS?TNS_ADMIN=C:\Oracle\Middleware\Oracle_Home\network\ADMIN

2021-07-22T17:46:15.569Z SEVERE   Extended settings parsing failed.

java.lang.RuntimeException: Invalid character at 17 : \


2021-07-22T17:46:15.850Z WARNING   Failed to connect to user: ORDS_PUBLIC_USER url: jdbc:oracle:thin:@MYTNSALIAS?TNS_ADMIN=C:\Oracle\Middleware\Oracle_Home\network\ADMIN

IO Error: Invalid connection string format, a valid format is: "host:port:sid" (CONNECTION_ID=JKaY/TvQQOGGUQaZW5lZfg==)

My C:\Oracle\ORDS\ords\defaults.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "">
<comment>Saved on Thu Oct 01 11:27:24 CDT 2020</comment>
<entry key="db.connectionType">tns</entry>
<entry key="db.tnsAliasName">MYTNSALIAS</entry>
<entry key="db.tnsDirectory">C:\Oracle\Middleware\Oracle_Home\network\ADMIN</entry>

I re-ran the 20.4.3 installer using my existing configuration and there was no issue, so it's something that changed between 20.4.3 and 21.2.

The runtime exception says "invalid character at 17: \" - could it be having issues with my tnsDirectory having Windows backslashes instead of forward slashes? Anyone else seen this?

If anyone has any thoughts, I'd appreciate it. When I get a chance I'll try to do another upgrade by first modifying db.tnsDirectory to use forward slashes and see if it works.



  • User_Z4K9S
    User_Z4K9S Member Posts: 20 Blue Ribbon

    So I tried editing my defaults.xml in my config folder (C:\Oracle\ORDS\ords) and changed db.tnsDirectory to use forward slashes instead of backslashes - it didn't help. Same exact error message, and the error message still referenced the path with backslashes, as if it ignored my changes.

    Does anyone have any idea what might have been changed that could be causing this? I even tried feeding on the java -jar ords.war command line - it still seems to ignore it and use the backslash path.

    Hoping someone has some ideas... thanks in advance.

  • User_Z4K9S
    User_Z4K9S Member Posts: 20 Blue Ribbon

    I just tried this again with ORDS 21.3 - still getting the same error message. Does anyone have any idea how to get around this? It's preventing me from upgrading my installation.


  • User_NASSU
    User_NASSU Member Posts: 2 Employee

    From what you comment I understand you changed your defaults.xml to have the path with forward slashes as follows:

    <entry key="db.tnsDirectory">C:/Oracle/Middleware/Oracle_Home/network/ADMIN</entry>

    that is fine. Could you now retry your install command without the tns_admin parameter?

    change from:

    C:\Oracle\ORDS\Install>java\Oracle\Middleware\Oracle_Home\network\ADMIN -jar ords.war install advanced


    C:\Oracle\ORDS\Install>java -jar ords.war install advanced

    If it still fails please post the error + outputs with special attention to if this line changed.

    Verify ORDS schema in Database Configuration apex using connection url jdbc:oracle:thin:@MYTNSALIAS?TNS_ADMIN=C:\Oracle\Middleware\Oracle_Home\network\ADMIN

  • User_Z4K9S
    User_Z4K9S Member Posts: 20 Blue Ribbon

    Thanks for responding.

    I did as you asked and got the exact same error message I posted in my initial thread. I made sure I left off "" so that it should have only been using the db.tnsDirectory setting in my defaults.xml config file in my ORDS configuration folder. But even though I had changed all the backslashes to forward slashes, the error message still referenced TNS_ADMIN having backslashes just as before - it's like the change didn't register.

    As a test, I changed the TNS_ADMIN path to a different folder name in defaults.xml - just to see if that's what the ords.war was referencing. Sure enough, it tried to use my new bogus TNS_ADMIN path from defaults.xml, but it still automatically translated the forward slashes into backslashes.

    So I don't think it's the slashes - I think it might be the colon in the drive letter - I think it's getting parsed as part of the JDBC URL:

    "jdbc","oracle", "thin", "@MYTNSALIAS?TNS_ADMIN=C", "\Oracle\Middleware\Oracle_Home\network\ADMIN"

    I tried using a backslash to "escape" the colon after the C drive and just got a different "Illegal char at index 2" error.

    Any other suggestions? At this point I'm thinking about trying to install the newer version in a different folder that doesn't have an existing configuration - maybe if I see how it creates the new configuration I can figure out how to properly format db.tnsDirectory for versions 21.x since my defaults.xml from 20.x is clearly not compatible.

    Thanks again for trying to help - much appreciated.

  • User_Z4K9S
    User_Z4K9S Member Posts: 20 Blue Ribbon

    OK never mind - it's the slashes.

    For the heck of it I tried removing the "C:" altogether so it was reading the JDBC URL as:


    Obviously I assumed this wouldn't work as it's not a valid Windows path, but I still got the same syntax error, this time complaining about the invalid backslash character at position 15 (which makes sense, because with the C: out of there, it's finding the slash at position 15 instead of 17).

    So it's definitely the slashes. But I don't know what to do. My defaults.xml has forward slashes, but the ords.war is still interpreting them as backslashes and complaining about them.

    Next step is to try installing in a different folder and see what happens.

  • User_NASSU
    User_NASSU Member Posts: 2 Employee

    Try the following:

    1 Change the config directory to an empty folder to start clean

    C:\Oracle\ORDS\Install>java -jar ords.war configdir C:\Oracle\newfolder

    2 Run ords install without tns parameter:

    C:\Oracle\ORDS\Install>java -jar ords.war install advanced

    3 Select connection type TNS and set your TNS folder location to the path with double (escaped) backslashes

    Specify the database connection type to use.
    Enter number for [1] Basic  [2] TNS  [3] Custom URL [1]:2
    Enter the TNS Network Alias:MYTNSALIAS
    Enter the TNS folder location: C:\\Oracle\\Middleware\\Oracle_Home\\network\\ADMIN

    That should work.

    If for some reason it does not, select Connection type = 3 - Custom URL, and enter


    as your URL and share the full console output of the command.

  • User_Z4K9S
    User_Z4K9S Member Posts: 20 Blue Ribbon

    Thanks again - I will try that when I get a free moment.

    Of interest, I found that I could upgrade from 20.4.3 to 21.1.3 without encountering this issue with the TNS and the backslashes. I had to feed the parameter to the java -jar ords.war commandline as I've had with previous versions, but it worked.

    So whatever started this behavior with TNS and the backslashes in Windows, it was something that changed between 21.1.3 and 21.2.

    I'll post back when I'm able to try a clean installation. Thanks!