Bug 1684349 - mysql-connector-java error in RHEL 7.6
Summary: mysql-connector-java error in RHEL 7.6
Keywords:
Status: ASSIGNED
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: mysql-connector-java
Version: 7.6
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Honza Horak
QA Contact: RHEL CS Apps Subsystem QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-01 03:23 UTC by SHAURYA
Modified: 2019-08-31 19:45 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description SHAURYA 2019-03-01 03:23:35 UTC
Description of problem:

Currently in RHEL 7.6 the mysql connector for java is in version : 5.1.25 in channel rhel-x86_64-server-7
The same connector by Oracle is 8.0.13. 
We would have the opportunity to use a more recent connector from the RHEL base, for easily maintenance and updates. 
Is it possible to have a newer mysql connector for java in RHEL ? 

Version-Release number of selected component (if applicable):
Latest

How reproducible:
Always

Steps to Reproduce:
- Install a RHEL 7.6 with mysql-connector-java 
- Install Artifactory 6.6.0 for RHEL by following the procédure => Artifactory starts 
- Upgrade Artifactory to 6.6.1  with yum update => Artifactory will not start, and in the log file you will have the java error



It seems the function missing in the current version of this connector in RHEL 7 is this one : 
com.mysql.jdbc.JDBC4Connection.getSchema(JDBC4Connection.java:258

Quote : 

2018-12-27 15:30:22 [ARTIFACTORY] [ERROR] Failed to ensure db table 'master_key_status' exists: : java.sql.SQLFeatureNotSupportedException: Not supported
at com.mysql.jdbc.JDBC4Connection.getSchema(JDBC4Connection.java:258)
at org.jfrog.storage.util.DbUtils.getActiveSchema(DbUtils.java:185)
at org.jfrog.storage.util.DbUtils.tableExists(DbUtils.java:256)

The way we request it via the code is:
conn.getSchema();

Actual results:
Error in file

Expected results:
No error

Additional info:

Comment 2 Jakub Jančo 2019-03-01 07:11:55 UTC
Hello, unfortunately rebase is problematic, see https://bugzilla.redhat.com/show_bug.cgi?id=1647175#c1
Connector 8.0.15 requires a lot of dependencies not available in RHEL7.

We are preparing mariadb connector as a replacement in collections.
https://bugzilla.redhat.com/show_bug.cgi?id=1625989
https://brewweb.engineering.redhat.com/brew/packageinfo?packageID=71176

Is it usable for you?

Comment 7 Honza Horak 2019-06-28 06:56:32 UTC
The package mariadb Java client is now available in the RHSCL repository, it can be installed this way:

  # yum-config-manager --enable rhel-server-rhscl-7-rpms
  # yum install rh-mariadb103-mariadb-java-client

This JDBC driver works fine with both, MariaDB and MySQL servers.

As written in comment #2, this is the best we could do for the customers who need a recent version of the JDBC driver for MySQL/MariaDB. Is it ok to close the ticket now?

Comment 9 Laurent Hoss 2019-06-28 12:05:23 UTC
1) (Why) Couldn't we have had at least at more recent v5.1.x (like 5.1.47) in centos7 ?!

I did some proper research for the Cloudera community, which needed at least v5.1.26, more infos here  (and links below):
https://community.cloudera.com/t5/Batch-SQL-Apache-Hive/CDH6-installation-Failed-to-Validate-Hive-Metastore-schema/m-p/92091#M3238


2) >Connector 8.0.15 requires a lot of dependencies not available in RHEL7.
The 8.0.16 (or 8.0.15) that I found (link below) only required openjdk-8 (which can be easily deployed, fortunatelly, without the need for any extra yum repo).

And even for people that somehow need to stay with an (open)jdk-7, I found a working rpm , which is from Fedora however (but it flawlessly installed on centos7 and it worked).


Finally here the many working RPMs, even if not officially proposed by RH, they just work :)

* With Java >=v8, I recommend following:
Ref: https://centos.pkgs.org/7/mysql-connectors-i386/mysql-connector-java-8.0.16-1.el7.noarch.rpm.html
RPM: yum install http://repo.mysql.com/yum/mysql-connectors-community/el/7/i386//mysql-connector-java-8.0.16-1.el7.noarch.rpm

* With Java v7 you can try the latest 5.1.x from Fedora:
Ref: https://fedora.pkgs.org/29/fedora-x86_64/mysql-connector-java-5.1.38-7.fc29.noarch.rpm.html
RPM: http://download-ib01.fedoraproject.org/pub/fedora/linux/releases/29/Everything/x86_64/os/Packages/m/mysql-connector-java-5.1.38-7.fc29.noarch.rpm

* Find RPMs for other distros: https://pkgs.org/download/mysql-connector-java

Comment 10 Jakub Jančo 2019-07-24 11:05:00 UTC
In official repositories all Java libraries should run with JRE 7 and should not use bundled libraries. 
MySQL JDBC 8.x does not support JDK 7 neither JRE 7, so I cant build it with JDK 8 for JRE 7 to meet expectations.
MySQL JDBC 5.x added build dependencies that are not in repositories, this is why we cant update even 5.x version.
The dependencies are build dependencies instead of runtime ones. This is why you can download and use built driver from internet and they bundle them into source code so you cannot see it in maven central package details.


Note You need to log in before you can comment on or make changes to this bug.