All Apps and Add-ons

How to get Splunk for Windows DB Connect to work with OpenJDK?

splunki67
New Member

Hello, I have the following problem:

I get the following message when trying to run db connect app 3.1.4 with these openJDK versions:

zulu8.36.0.1-ca-jdk8.0.202-win_x64

OpenJDK8U-jdk_x64_windows_hotspot_8u202b08

{'message': 'Unsupported JRE detected', 'jre_need': 'Need Oracle Corporation JRE version 1.8 or OpenSDK 1.8', 'jre_using': 'Using Azul Systems, Inc. JRE version 1.8, OpenJDK 64-Bit Server VM'} validate java command: D:\Java\zulu8.36.0.1-ca-jdk8.0.202-win_x64\bin\java.


{'message': 'Unsupported JRE detected', 'jre_need': 'Need Oracle Corporation JRE version 1.8 or OpenSDK 1.8', 'jre_using': 'Using AdoptOpenJdk JRE version 1.8, OpenJDK 64-Bit Server VM'} validate java command: D:\Java\OpenJDK8U-jdk_x64_windows_hotspot_8u202b08\jdk8u202-b08\bin\java.

I tried it with OpenJDK in versions 1.8 and 12 from RedHat.

I have already tried the following:
http://www.kylegato.com/2013/10/getting-splunk-db-connect-to-work-with-openjdk.html
https://answers.splunk.com/answers/696602/openjdk-support-plans-for-db-connect.html

Unfortunately without success!
Does anyone else have an idea??

Thanks

0 Karma

ww9rivers
Contributor

I think I got it fixed. Below is the change that I made on my Ubuntu 18.04.3 LTS instance.

diff --git a/bin/dbx2/C.py b/bin/dbx2/C.py
index daff29c..f26f089 100644
--- a/bin/dbx2/C.py
+++ b/bin/dbx2/C.py
@@ -93,7 +93,7 @@ DB_PARMS = [USE_CONN_POOL, JDBC_URL, JDBC_SSL_URL, JDBC_USE_SSL, DRIVER_CLASS, U
 # JRE parameters
 JRE_INFO_OPTIONS='-XshowSettings:properties -version'
 JRE_VERSION_KEY='java.vm.specification.version'
-JRE_VENDOR_KEY='java.vendor'
+JRE_VENDOR_KEY='java.specification.vendor'
 JRE_VM_KEY='java.vm.name'
 JRE_WANT_VERSION='1.8'
 JRE_WANT_VENDOR='Oracle Corporation'
diff --git a/local/dbx_settings.conf b/local/dbx_settings.conf
index d818f6f..c410735 100644
--- a/local/dbx_settings.conf
+++ b/local/dbx_settings.conf
@@ -1,4 +1,5 @@
 [java]
+javaHome = /usr/lib/jvm/java-8-openjdk-amd64

 [loglevel]
 dbxquery = INFO                                                                                                                                                                                                                                                                                                               

Primarily two things:

  1. Change the JRE_VENDOR_KEY value in C.py
  2. Setting javaHome in the app's settings via the web GUI.

The problem was that, with JRE_VENDOR_KEY originally set to "java.vendor", the value came out of the Ubuntu OpenSDK build is "Private Build". But with "java.specification.vendor", it would be:

 java.specification.vendor = Oracle Corporation

The change is made against version 3.1.4 from Splunkbase.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...