Encrypted JdbcSample session returns UnsatisfiedLinkError in TIBCO Data Virtualization

Encrypted JdbcSample session returns UnsatisfiedLinkError in TIBCO Data Virtualization

book

Article ID: KB0074549

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization 8.2 and 8.3

Description

When using the TIBCO Data Virtualization (TDV) /apps/jdbc/JdbcSample.bat tool (in Windows) in encrypted mode, you receive an UnsatisfiedLinkError.  You may see this occur only in selective Windows environments.
 

EXAMPLE OF USE CASE
-----------------------------------------------------------------------------

C:\Program Files\TIBCO\TDV Server 8.3\apps\jdbc>JdbcSample.bat system localhost 9401 admin admin composite "select * from all_users" -encrypt

Exception in thread "main" java.lang.UnsatisfiedLinkError: sun.security.ec.ECKeyPairGenerator.isCurveSupported([B)Z
at jdk.crypto.ec/sun.security.ec.ECKeyPairGenerator.isCurveSupported(Native Method)
at jdk.crypto.ec/sun.security.ec.ECKeyPairGenerator.ensureCurveIsSupported(ECKeyPairGenerator.java:135)
at jdk.crypto.ec/sun.security.ec.ECKeyPairGenerator.initialize(ECKeyPairGenerator.java:114)
at java.base/java.security.KeyPairGenerator$Delegate.initialize(KeyPairGenerator.java:699)
at java.base/sun.security.ssl.ECDHKeyExchange$ECDHEPossession.<init>(ECDHKeyExchange.java:111)
at java.base/sun.security.ssl.SSLKeyExchange$T13KeyAgreement.createPossession(SSLKeyExchange.java:575)
at java.base/sun.security.ssl.SSLKeyExchange.createPossessions(SSLKeyExchange.java:88)
at java.base/sun.security.ssl.KeyShareExtension$CHKeyShareProducer.produce(KeyShareExtension.java:263)
at java.base/sun.security.ssl.SSLExtension.produce(SSLExtension.java:532)
at java.base/sun.security.ssl.SSLExtensions.produce(SSLExtensions.java:249)
at java.base/sun.security.ssl.ClientHello$ClientHelloKickstartProducer.produce(ClientHello.java:648)
at java.base/sun.security.ssl.SSLHandshake.kickstart(SSLHandshake.java:515)
at java.base/sun.security.ssl.ClientHandshakeContext.kickstart(ClientHandshakeContext.java:107)
at java.base/sun.security.ssl.TransportContext.kickstart(TransportContext.java:234)
at java.base/sun.security.ssl.SSLEngineImpl.writeRecord(SSLEngineImpl.java:167)
at java.base/sun.security.ssl.SSLEngineImpl.wrap(SSLEngineImpl.java:136)
at java.base/sun.security.ssl.SSLEngineImpl.wrap(SSLEngineImpl.java:116)
at java.base/javax.net.ssl.SSLEngine.wrap(SSLEngine.java:479)
at cs.jdbc.driver.protocol.WireEncoder.sendEverything(WireEncoder.java:335)
at cs.jdbc.driver.protocol.WireEncoder.flush(WireEncoder.java:314)
at cs.jdbc.driver.protocol.WireEncoder.sendCommand(WireEncoder.java:2382)
at cs.jdbc.driver.protocol.WireEncoder.sendCommand(WireEncoder.java:2361)
at cs.jdbc.driver.ClientChannelConnection.invokeCommand(ClientChannelConnection.java:1023)
at cs.jdbc.driver.ClientChannelConnection.handshake(ClientChannelConnection.java:1697)
at cs.jdbc.driver.ClientChannelConnection.<init>(ClientChannelConnection.java:216)
at cs.jdbc.driver.CompositeConnection.getChannel(CompositeConnection.java:179)
at cs.jdbc.driver.DatabaseMetaDataImpl.<init>(DatabaseMetaDataImpl.java:49)
at cs.jdbc.driver.CompositeConnection.<init>(CompositeConnection.java:137)
at cs.jdbc.driver.CompositeDriver.connect(CompositeDriver.java:58)
at cs.jdbc.driver.CompositeDriver.connect(CompositeDriver.java:25)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at JdbcSample.main(JdbcSample.java:56)

Issue/Introduction

This concerns our /apps/jdbc/JdbcSample tool.

Resolution

Verify the current PATH of your java home in your Windows cmd session.  If your session's PATH is pointed to a version of java earlier than version 11, the JdbcSample tool will use the older SunEC library, resulting in this exception.  
It's normally expected that the JdbcSample tool would utilize the local jre/jdk that is native to the TDV installation, but a system PATH could override the tool, giving the (incorrect) external java environment a higher priority during runtime.

The solution is to nullify the external java system PATH in this session and allow the JdbcSample.bat script to fall back on its own directive to set JAVA_HOME to its own local jre/jdk.