Forum Stats

  • 3,767,980 Users
  • 2,252,736 Discussions
  • 7,874,399 Comments

Discussions

ORDS with TNS - error when trying to connect DB for APEX

Oracle 12.1.0.2 with APEX 21.1

ORDS 21.3 on Tomcat 9.0.54 - Windows Server 2019

I'm getting following error when starting Tomcat which prevents ORDS from connecting to the DB:

oracle.net.resolver.EZConnectResolver.parseExtendedProperties Extended settings parsing failed. java.lang.RuntimeException: Invalid character at 24 : \

oracle.dbtools.common.logging.JDKLogSink.record IO Error: Invalid connection string format, a valid format is: "host:port:sid" (CONNECTION_ID=X8ADepYuRpK1p8FSAKp41Q==),|apex||-2021-10-26T20-46-37.212127400Z,jdbc:oracle:thin:@myDB?TNS_ADMIN=D:\App\Oracle\tns

oracle.dbtools.common.logging.JDKLogSink.record The pool named: |apex|| is invalid and will be ignored: ORDS was unable to make a connection to the database. This can occur if the database is unavailable, the maximum number of sessions has been reached or the pool is not correctly configured. The connection pool named: |apex|| had the following error(s): IO Error: Invalid connection string format, a valid format is: "host:port:sid" (CONNECTION_ID=X8ADepYuRpK1p8FSAKp41Q==)

When I'm using Basic connection instead of TNS it works perfectly. The TNS file format is fine since it works with ORDS 21.1.

I have also tried ORDS 21.2: same issue as with 21.3.

ORDS seems to have an issue with tns connection starting from version 21.2.

Any idea?

Tagged:

Best Answer

«13

Answers

  • User_Z4K9S
    User_Z4K9S Member Posts: 20 Blue Ribbon

    I don't have any ideas, but you're not alone. I experienced a similar issue with ORDS and TNS starting with 21.2 (https://community.oracle.com/tech/developers/discussion/4487085/upgrade-from-ords-20-4-3-to-21-2-failing-with-tns-settings-on-windows) and so did someone else (https://community.oracle.com/mosc/discussion/4499937/ords-21-2-uninstall-issue-on-windows).

    The person who made the second post referenced above tried to open an SR with Oracle but didn't get very far.

    I was able to upgrade from 20.4.3 to 21.1.3, but I still can't figure out how to get 21.2 to work. I'm trying to figure out what would have changed that would have affected the TNS connection between those two versions, but no luck so far. It seems to not like the backslashes in the TNS_ADMIN path, but when I change them to forward slashes, they still get interpreted as backslashes.

    Please post back if you figure out a workaround or solution with your situation - I will do the same. Thanks!

  • Suresh-Sangaran-Oracle
    Suresh-Sangaran-Oracle Member Posts: 197 Employee

    alacourb, User_Z4K9S

    If you are using non-Oracle JDK(OpenJDK), this problem is known.

    Share the complete stacktrace of the exception.

    Thanks, Suresh

  • cormaco
    cormaco Member Posts: 1,721 Bronze Crown

    OpenJDK is owned by Oracle:

    OpenJDK Trademark Notice (java.net)

    OpenJDK (the "Name") is a trademark of Oracle America, Inc. ("Oracle")
    (the "Trademark Owner").
    


  • User_Z4K9S
    User_Z4K9S Member Posts: 20 Blue Ribbon

    The issue I'm having is using Oracle JDK 1.8 u311, but I don't want to hijack alacourb's thread so I'll keep the details about my particular issue in my own thread.

    Curious to hear if alacourb is using Oracle's JDK or OpenJDK.

    alacourb
  • alacourb
    alacourb Member Posts: 14 Blue Ribbon

    I'm using OpenJDK 17.

    User_Z4K9S no issue if you share also your details, this will allow to have a better scope of the issue, thanks fo sharing.

  • alacourb
    alacourb Member Posts: 14 Blue Ribbon
    edited Oct 30, 2021 8:56AM

    Suresh-Sangaran-Oracle Here the full stacktrace as requested:

    oracle.net.resolver.EZConnectResolver.parseExtendedProperties Extended settings parsing failed.

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

    at oracle.net.resolver.EZConnectResolver.parseExtendedProperties(EZConnectResolver.java:428)

    at oracle.net.resolver.EZConnectResolver.parseExtendedSettings(EZConnectResolver.java:401)

    at oracle.net.resolver.EZConnectResolver.parse(EZConnectResolver.java:187)

    at oracle.net.resolver.EZConnectResolver.<init>(EZConnectResolver.java:146)

    at oracle.net.resolver.EZConnectResolver.newInstance(EZConnectResolver.java:155)

    at oracle.jdbc.driver.OracleDriver.resolveNonSimpleURL(OracleDriver.java:860)

    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:657)

    at oracle.jdbc.datasource.impl.OracleDataSource.getPhysicalConnection(OracleDataSource.java:579)

    at oracle.jdbc.datasource.impl.OracleDataSource.getConnection(OracleDataSource.java:352)

    at oracle.jdbc.datasource.impl.OracleDataSource.getConnectionInternal(OracleDataSource.java:2023)

    at oracle.jdbc.datasource.impl.OracleDataSource.getConnection(OracleDataSource.java:325)

    at oracle.jdbc.datasource.impl.OracleDataSource.getConnection(OracleDataSource.java:286)

    at oracle.dbtools.common.config.db.OracleConnectionFactory._connection(OracleConnectionFactory.java:37)

    at oracle.dbtools.common.config.db.ConnectionFactory.getConnection(ConnectionFactory.java:87)

    at oracle.dbtools.common.jdbc.provider.HasConnection.getConnection(HasConnection.java:31)

    at oracle.dbtools.common.config.db.ValidatedConnectionFactory.from(ValidatedConnectionFactory.java:99)

    at oracle.dbtools.common.config.db.ConfiguredPoolDataSourceImplLoader.validatePool(ConfiguredPoolDataSourceImplLoader.java:323)

    at oracle.dbtools.common.config.db.ConfiguredPoolDataSourceImplLoader.load(ConfiguredPoolDataSourceImplLoader.java:94)

    at oracle.dbtools.common.config.db.ConfiguredPoolDataSourceLoaderImpl.load(ConfiguredPoolDataSourceLoaderImpl.java:16)

    at oracle.dbtools.common.config.db.RefreshablePoolDataSourceFactory.load(RefreshablePoolDataSourceFactory.java:28)

    at oracle.dbtools.common.config.db.DatabasePoolLoader.load(DatabasePoolLoader.java:35)

    at oracle.dbtools.common.config.db.DatabasePoolLoader.load(DatabasePoolLoader.java:8)

    at oracle.dbtools.common.config.db.ConfiguredPoolDataSourceLoader.load(ConfiguredPoolDataSourceLoader.java:40)

    at oracle.dbtools.common.config.db.DatabasePoolLoader.load(DatabasePoolLoader.java:43)

    at oracle.dbtools.common.config.db.DatabasePoolLoader.load(DatabasePoolLoader.java:8)

    at oracle.dbtools.common.config.db.RefreshablePoolDataSources$PoolFromDataSourceIdentifierLoader.call(RefreshablePoolDataSources.java:144)

    at oracle.dbtools.common.config.db.RefreshablePoolDataSources$PoolFromDataSourceIdentifierLoader.call(RefreshablePoolDataSources.java:133)

    at oracle.dbtools.common.functions.Functions$3.get(Functions.java:41)

    at oracle.dbtools.common.functions.MaybeValidImpl.load(MaybeValidImpl.java:217)

    at oracle.dbtools.common.functions.MaybeValidImpl.<init>(MaybeValidImpl.java:20)

    at oracle.dbtools.common.functions.MaybeValidImpl.<init>(MaybeValidImpl.java:14)

    at oracle.dbtools.common.functions.MaybeValidImpl$LoaderImpl.load(MaybeValidImpl.java:282)

    at oracle.dbtools.common.functions.MaybeValidCache$MaybeValidCacheLoader.call(MaybeValidCache.java:346)

    at oracle.dbtools.common.functions.MaybeValidCache$MaybeValidCacheLoader.call(MaybeValidCache.java:335)

    at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4864)

    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)

    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)

    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2155)

    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045)

    at com.google.common.cache.LocalCache.get(LocalCache.java:3962)

    at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4859)

    at oracle.dbtools.common.functions.MaybeValidCache.get(MaybeValidCache.java:101)

    at oracle.dbtools.common.functions.MaybeValidCache.get(MaybeValidCache.java:85)

    at oracle.dbtools.common.config.db.RefreshablePoolDataSources.pool(RefreshablePoolDataSources.java:69)

    at oracle.dbtools.common.config.db.DatabasePools.pool(DatabasePools.java:241)

    at oracle.dbtools.common.config.db.DatabasePools.validity(DatabasePools.java:206)

    at oracle.dbtools.common.config.db.DataSourceIdentifiers.lambda$validity$0(DataSourceIdentifiers.java:36)

    at oracle.dbtools.common.functions.MaybeValidImpl.load(MaybeValidImpl.java:217)

    at oracle.dbtools.common.functions.MaybeValidImpl.<init>(MaybeValidImpl.java:20)

    at oracle.dbtools.common.functions.MaybeValidImpl.<init>(MaybeValidImpl.java:14)

    at oracle.dbtools.common.functions.MaybeValidImpl$LoaderImpl.load(MaybeValidImpl.java:282)

    at oracle.dbtools.common.functions.MaybeValidImpl$LoaderImpl.load(MaybeValidImpl.java:252)

    at oracle.dbtools.common.config.db.DataSourceIdentifiers.validity(DataSourceIdentifiers.java:53)

    at oracle.dbtools.common.config.db.DataSourceValidation.startup(DataSourceValidation.java:45)

    at oracle.dbtools.common.app.PluginLifeCycles.startup(PluginLifeCycles.java:39)

    at oracle.dbtools.common.app.ApplicationContext.<init>(ApplicationContext.java:110)

    at oracle.dbtools.common.app.ApplicationContext.<init>(ApplicationContext.java:66)

    at oracle.dbtools.common.app.ApplicationContext.using(ApplicationContext.java:230)

    at oracle.dbtools.entrypoint.WebApplicationContext.<init>(WebApplicationContext.java:43)

    at oracle.dbtools.entrypoint.WebApplicationContext.<init>(WebApplicationContext.java:31)

    at oracle.dbtools.entrypoint.WebApplicationContext$Builder.build(WebApplicationContext.java:181)

    at oracle.dbtools.entrypoint.WebApplicationEntryPoint.contextInitialized(WebApplicationEntryPoint.java:35)

    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4768)

    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)

    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)

    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)

    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1024)

    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1911)

    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)

    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)

    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:825)

    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:475)

    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)

    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)

    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)

    at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)

    at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)

    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)

    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)

    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)

    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)

    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)

    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)

    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)

    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

    at org.apache.catalina.startup.Catalina.start(Catalina.java:772)

    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.base/java.lang.reflect.Method.invoke(Method.java:568)

    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)

    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)


    And then I get also:

    oracle.dbtools.common.logging.JDKLogSink.record IO Error: Invalid connection string format, a valid format is: "host:port:sid" (CONNECTION_ID=X8ADepYuRpK1p8FSAKp41Q==),|apex||-2021-10-26T20-46-37.212127400Z,jdbc:oracle:thin:@myDB?TNS_ADMIN=D:\App\Oracle\tns

  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 8,056 Employee

    OpenJDK not technically supported, neither is 17 (yet) - suggest you try Oracle Java 8 or 11 and see if that helps.

  • User_Z4K9S
    User_Z4K9S Member Posts: 20 Blue Ribbon

    alacourb,

    I'd be curious to see your results if you're able to try it using the latest Oracle JDK 1.8. The stack trace you posted has some similarities to the one I get when trying to install an ORDS upgrade 21.2 or higher in my environment, which is running 1.8 update 311.

  • alacourb
    alacourb Member Posts: 14 Blue Ribbon
    edited Nov 1, 2021 9:49PM

    Suresh-Sangaran-Oracle thanks for your feedback. I did not use the Oracle Java because of the license fees. Could you please confirm if I can use it in my DEV environment for free, at least to validate the issue doesn't occur the same way?