JDBC connection fails to SAP Hana Cloud: "RTEException: -708 Receive of connect failed." - jdbc

Similar to https://answers.sap.com/questions/12675326/sap-dbtech-jdbc-708-receive-of-connect-fail.html
Connection to SAP Hana Cloud fails with the error "RTEException: -708 Receive of connect failed."
Steps to reproduce:
java -version
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1)
java -jar ngdbc.jar -V
package package com.sap.db.jdbc, Java Platform API Specification, version 1.4, SAP HANA JDBC Driver, SAP SE, 1.120.05-8c23c50e159e9883edab0e2ebdd4e02c5919cd08
java -jar ngdbc.jar -u DBADMIN,PASSWORD -n BIG-IDENTIFIER.hana.trial-us10.hanacloud.ondemand.com:443 -d test -o encrypt=true -o validatecertificate=false
(the certificate is imported, and the error occurs even without the parameters encrypt and validatecertificate)
Contents of trace log:
ClassLoader: jdk.internal.loader.ClassLoaders$AppClassLoader#55054057
Process-ID: 320850
package package com.sap.db.jdbc, Java Platform API Specification, version 1.4, SAP HANA JDBC Driver, SAP SE, 1.120.05-8c23c50e159e9883edab0e2ebdd4e02c5919cd08 on Java 11.0.15
---- Thread 1eb44e46 main Timestamp: 2022-09-29 09:50:03.162
new Connection 'jdbc:sap://BIG-IDENTIFIER.hana.trial-us10.hanacloud.ondemand.com:443'
password=****
databaseName=test
host=BIG-IDENTIFIER....
options=
cmd=Select top 1 42 as "connect test" fro...
user=DBADMIN
HOSTLIST: [BIG-IDENTIFIER.hana.trial-us10.hanacloud.ondemand.com:443,]
new RTEException: -708 Receive of connect failed.
whereAmIjava.lang.Throwable
at com.sap.db.util.Tracer.whereAmI(Tracer.java:280)
at com.sap.db.rte.comm.RTEException.(RTEException.java:51)
at com.sap.db.rte.comm.BasicSocketComm.receiveInfoRequest(BasicSocketComm.java:587)
at com.sap.db.rte.comm.BasicSocketComm.doInfoRequest(BasicSocketComm.java:84)
at com.sap.db.rte.comm.BasicSocketComm.connectDB(BasicSocketComm.java:187)
at com.sap.db.rte.comm.SocketComm$1.open(SocketComm.java:47)
at com.sap.db.jdbc.topology.Topology.getSession(Topology.java:88)
at com.sap.db.jdbc.Driver.openByURL(Driver.java:1216)
at com.sap.db.jdbc.Driver.connect(Driver.java:313)
at com.sap.db.jdbc.Driver.main(Driver.java:858)
using null
=> FAILED
any thoughts on the why and how to solve it?

Since this is HANA Cloud Trial, I don't think, that you should use -d to specify a tenant database name. Please try to remove this parameter as you may be trying to connect to a non-existing tenant database. You can also refer to this tutorial.
Second thing to consider is the allowlist for IP addresses. Per default connections are blocked if you have not added your client ip to the allowlist. More details can be found in this blog.
Last but not least, please check if your are using the latest version of ngdb.jar. It can be obtained on this site.

Related

SQL Error when querying any tables/views on a Databricks cluster via Dbeaver

I am able to connect to the cluster, browse its hive catalog, see tables/views and columns/datatypes
Running a simple select statement from a view on a parquet file produces this error and no other results:
SQL Error [500540] [HY000]: [Databricks][DatabricksJDBCDriver](500540) Error caught in BackgroundFetcher. Foreground thread ID: 180. Background thread ID: 223. Error caught: sun.misc.Unsafe or java.nio.DirectByteBuffer.<init>(long, int) not available.
Standard Databricks cluster:
Standard_DS3_v2
JDBC URL:
jdbc:databricks://<reducted>.1.azuredatabricks.net:443/default;transportMode=http;ssl=1;httpPath=sql/protocolv1/o/<reducted>/<reducted>;AuthMech=3;UID=token;PWD=<reducted>
Advanced Options Spark Config:
spark.databricks.cluster.profile singleNode
spark.databricks.io.directoryCommit.createSuccessFile false
spark.master local[*, 4]
spark.driver.extraJavaOptions -Dio.netty.tryReflectionSetAccessible=true
spark.hadoop.fs.azure.account.key.<reducted>.blob.core.windows.net <reducted>
spark.executor.extraJavaOptions -Dio.netty.tryReflectionSetAccessible=true
parquet.enable.summary-metadata false
My local machine:
Dbeaver Version 22.1.2.202207091909
MacOS version (M1 chip): Monterey 12.4
Java version:
java --version
openjdk 18.0.1 2022-04-19
OpenJDK Runtime Environment Homebrew (build 18.0.1+0)
OpenJDK 64-Bit Server VM Homebrew (build 18.0.1+0, mixed mode, sharing)
I am able to do the following with no errors (Databricks default test dataset):
CREATE TABLE diamonds USING CSV OPTIONS (path "/databricks-datasets/Rdatasets/data-001/csv/ggplot2/diamonds.csv", header "true");
When I run this select color from diamonds; or this select * from diamonds;
I get this:
SQL Error [500618] [HY000]: [Databricks][DatabricksJDBCDriver](500618) Error occured while deserializing arrow data: sun.misc.Unsafe or java.nio.DirectByteBuffer.<init>(long, int) not available
Hence, any select query on any object (parquet file or anything else) causes the error described above.
What could be the problem? Any recommendations how to resolve this error? Why am I able to connect and see the metadata of the schemas/tables/views/columns, but not query or view the data?
P.S. I followed this guide exactly: https://learn.microsoft.com/en-us/azure/databricks/dev-tools/dbeaver#step-3-connect-dbeaver-to-your-azure-databricks-databases

UnrecoverableKeyException on trying to read key using alias from keystore

I am getting the following error on Line #4 of code below in IBM Websphere
Liberty Profile 16.0.0
InputStream keystoreStream = EncryptionUtility.class.getResourceAsStream(keyStoreLocation);
KeyStore keystore = KeyStore.getInstance("JCEKS");
keystore.load(keystoreStream, storePass.toCharArray());
Key key = keystore.getKey(alias, keyPass.toCharArray());
Which results in the following exception:
Caused by: java.security.UnrecoverableKeyException: com.ibm.crypto.provider.AESSecretKey
at com.sun.crypto.provider.KeyProtector.unseal(KeyProtector.java:358)
at com.sun.crypto.provider.JceKeyStore.engineGetKey(JceKeyStore.java:133)
at java.security.KeyStore.getKey(KeyStore.java:804)
at com.comdata.base.helper.EncryptionUtility.initSymmetricKey(EncryptionUtility.java:134)
Any ideas why this is happening? Is anything need to be configured for cryptography?
I poked through the code of keyProtector.java in JDK 7 and UnrecoverableKeyException is triggered by ClassNotFoundException
com.ibm.crypto.provider.AESSecretKey
Do we need to install any feature via installUtility?
Any ideas why this is happening? Is anything need to be configured for cryptography?
The class not being found (com.ibm.crypto.provider.AESSecretKey) is from the IBM JDK.
It looks like your keystore was created using the IBM JDK and thus has a key packaged in it that uses the AESSecretKey from the IBM JDK.
At runtime, your Liberty server is probably using a non-IBM JDK, which would not have this IBM JDK specific class in it.
Do we need to install any feature via installUtility?
Nope. The missing class should be provided by the JDK, as opposed to a Liberty feature.

Unable to connect to Oracle with SchemaSpy

I've installed Oracle Instant Client 64 bits, when connecting with SchemaSpy I get the error message below.
PLEASE NOTE: Both these files exist
C:\app\instantclient_12_1\ojdbc6.jar
C:\app\instantclient_12_1\ocijdbc12.dll
And "C:\app\instantclient_12_1\" is in the PATH.
I've tried C:\app\instantclient_12_1\ojdbc7.jar as well, same result.
Windows 7 64 bits.
Would greatly appreciate any help from anyone who got this to work correctly.
Error message:
Failed to load driver [oracle.jdbc.driver.OracleDriver] from classpath [file:/C:/app/instantclient_12_1/ojdbc6.jar]
Make sure the reported library (.dll/.lib/.so) from the following line can be
found by your PATH (or LIB*PATH) environment variable
java.lang.UnsatisfiedLinkError: C:\app\instantclient_12_1\ocijdbc12.dll: Specified process not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:4115)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:4111)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:308)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:662)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:54)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:560)
at net.sourceforge.schemaspy.SchemaAnalyzer.getConnection(SchemaAnalyzer.java:582)
at net.sourceforge.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:157)
at net.sourceforge.schemaspy.Main.main(Main.java:42)
E=3I=3
Here's how to run SchemaSpy 6 against an Oracle database:
Dependecies
Make sure you have the following available on your machine:
The lastest version from schemaspy.org, the following will describe the process for schemaspy-6.0.0-rc1.
The Oracle JDBC thin driver, otherwise you'll have to mess around with Oracle OCI. You can get it from Oracle Database 12.1.0.2 JDBC Driver & UCP Downloads
SchemaSpy uses GraphViz to generate the diagrams, get it from graphviz.org. You'll need to update you PATH variable, add C:\Program Files (x86)\Graphviz2.38\bin to it (make sure the version fits the one you downloaded).
Database Type
Note, SchemaSpy supports Oracle OCI (-t ora) and Oracle Thin (-t orathin) as database types. To get the list of available database types:
java -jar schemaspy-6.0.0-rc1.jar -dbhelp
Configuration
You can put most configuration parameters into a file called schemaspy.properties, put this file into the same directory as schemaspy-6.0.0-rc1.jar.
Example schemaspy.properties:
# type of database. Run with -dbhelp for details
schemaspy.t=orathin
# path to the dowloaded oracle jdbc drivers, for example
schemaspy.dp=C:\tools\dbdoc\drivers\ojdbc7.jar
# database properties: host, port number, name user, password
schemaspy.host=[orcale database host]
schemaspy.port=[orcale database port, usualy 1521]
schemaspy.db=[database name or SID]
schemaspy.u=[username]
schemaspy.p=[password, for complexer ones, put it in quotation marks]
# output dir to save generated files
schemaspy.o=C:\tools\dbdoc\output
# db scheme for which generate diagrams
schemaspy.s=[scheme name]
Generate documentation
With the configuration in place, now all you have to do is run:
java -jar schemaspy-6.0.0-rc1.jar

Oracle Webtier 12.2.1.1 on Windows startComponent.cmd "exit status = -1073741515"

I am attempting to install Oracle HTTP server 12.2.1.1 on Windows Server 2012 R2 in standalone mode. I believe I followed the Oracle documentation correctly. I have progressed to this point: https://docs.oracle.com/middleware/1221/core/WTINS/GUID-3ED8EE64-EE8B-4EF3-84A1-19CEF21B8547.htm#WTINS414
My attempts to run "startComponent.cmd ohs1" have resulted in this error:
weblogic.nodemanager.NMException: Received error message from Node Manager Serve
r: [Server start command for OHS server 'ohs1' failed due to: [Failed t
o start the server ohs1
The error message also says to check a log file. Contents are:
<2016-06-29 15:42:10> <INFO> <OHS-4018> <Starting server ohs1>
<2016-06-29 15:42:10> <INFO> <OHS-0> <Running C:\Middleware\Oracle_Home_12\ohs\bin\launch.exe C:\Middleware\Oracle_Home_12\ohs\bin\httpd.exe -DOHS_MPM_WINNT -d C:/Middleware/Oracle_Home_12/user_projects/domains/base_domain/config/fmwconfig/components/OHS/instances/ohs1 -f C:\Middleware\Oracle_Home_12\user_projects\domains\base_domain\config\fmwconfig\components\OHS\instances\ohs1\httpd.conf>
<2016-06-29 15:42:11> <SEVERE> <OHS-0> <C:\Middleware\Oracle_Home_12\ohs\bin\launch.exe C:\Middleware\Oracle_Home_12\ohs\bin\httpd.exe -DOHS_MPM_WINNT -d C:/Middleware/Oracle_Home_12/user_projects/domains/base_domain/config/fmwconfig/components/OHS/instances/ohs1 -f C:\Middleware\Oracle_Home_12\user_projects\domains\base_domain\config\fmwconfig\components\OHS\instances\ohs1\httpd.conf: exit status = -1073741515>
<2016-06-29 15:42:11> <INFO> <OHS-4005> <Check the instance log file for more information: C:\Middleware\Oracle_Home_12\user_projects\domains\base_domain\servers\ohs1\logs\ohs1.log>
<2016-06-29 15:42:11> <SEVERE> <OHS-0> <Failed to start the server ohs1>
The log file referenced here, "C:\Middleware\Oracle_Home_12\user_projects\domains\base_domain\servers\ohs1\logs\ohs1.log", does not exist.
I also made sure that the required Microsoft redistributable was installed.
What am I doing wrong?
I received help from the Oracle Community:
Do you have lastinvocation.log file under
C:/Middleware/Oracle_Home_12/user_projects/domains\base_domain\servers\ohs1\logs?
If yes, rename it to lastinvocation.cmd and run this from command line and check if the ohs1.log file gets generated.
If yes, what is the error message seen?
The error message returned was:
"The program can't start because MSVCR110.dll is missing from your computer. Try reinstalling the program to fix this problem."
The user then pointed me to an Oracle Doc:
This is also described in the below article
Oracle HTTP Server 12.2.1 Fails To Start With Error 'MSVCR110.dll' Missing From Your Computer (Doc ID 2078713.1)
This Oracle article had a link to a DIFFERENT (larger) version of vcredist_x64.exe than I had used when installing the components. This version worked.
Thanks to Aishwarya in the Oracle community!

Adding data source for jidea 11.0.2

i'm trying to connect to a oracle 10g database from inside jidea,i'm using ojdbc6-11.2.0.1.0.jar as the jdbc driver. attached is the error message i'm getting when
i'm trying to connect! can any one help me to solve this issue??
Connection to oracle - albi1dv1 failed
java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:388)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:381)
at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:564)
at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:431)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:366)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:752)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:359)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
Regards,
Rangana
i have used the jdbc driver named ojdbc14_noneXe.jar, it solved my problem. :)
FYI - i'm connecting to a remote oracle development database, not an local installation on my mechine!
You can set the timezone to IDEA. This will prevent this error.
Add the next line to file idea.vmoptions :
-Duser.timezone=your_database_timezone
Here's some explanation on how to get your database timezone
in eclipse go run - > run configuration
in there go to JRE tab in right side panels
in VM Arguments section paste this
-Duser.timezone=GMT
then Apply - > Run

Resources