[MDEV-31015] MariaDB Connect JavaWrappers.Jar not found Created: 2023-04-05 Updated: 2023-05-29 Resolved: 2023-05-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.11.2 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Adrian Alonzo | Assignee: | Anel Husakovic |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu Docker Image |
||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
I have a docker container which includes MariaDB v10.11, openjdk 8, ,MariaDB Connect and Javawrapper and java connector 8. The docker image is created like so:
It includes the Java Connector (Java 8 Connector v3.1.3) and Java Wrapper from MDEV-1093. Using this container image I ran two instances of MariaDB to test and migrate data from MariaDB to MariaDB using the following procedures: On MariaDB Image One:
On MariaDB Image Two:
Upon the last line I am greeted with the following error:
As a sanity check I checked the directory to ensure server 2 has the necessary jar files including JavaWrappers.jar as shown in the attached screenshot. Why is this failing? |
| Comments |
| Comment by Adrian Alonzo [ 2023-04-05 ] | ||||||||||||||||||||||||||||||||||||
|
I should also note my docker deployment has a connect.cnf defined as the following:
| ||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-04-05 ] | ||||||||||||||||||||||||||||||||||||
|
The error "ERROR 1296 (HY000): Got error 174 'ERROR: class /usr/lib/mysql/plugin/JavaWrappers.jar not found!' from CONNECT" is from the failed env->findClass which according to the Java classloader API takes a binary name and not a jar path file which is what it is called with. Looking at the connect test cases connect_class_path is set to include the JavaWrappers.jar file which might work around the problem. Note on your Dockerfile, "mariadb_repo_setup" isn't needed. The MariaDB repos are already configured in the container, after apt-get update, the mariadb-plugin-connect is installable. The lack of packaging of JavaWrappers.jar is MDEV-26218. So three bugs:
| ||||||||||||||||||||||||||||||||||||
| Comment by Adrian Alonzo [ 2023-04-05 ] | ||||||||||||||||||||||||||||||||||||
|
Hi Daniel, With that in mind I've attempted to change the connect_class_path to attempt a work around in the mean time. I've tried the following two cases: include the jar file and include the jar folder. Unfortunately, both resulting in the same error.
| ||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-04-06 ] | ||||||||||||||||||||||||||||||||||||
|
Upon closer examination the error is different. I suspect it needs https://github.com/MariaDB/server/blob/10.11/storage/connect/mysql-test/connect/std_data/JdbcMariaDB.jar in the connect_class_path too. | ||||||||||||||||||||||||||||||||||||
| Comment by Adrian Alonzo [ 2023-04-10 ] | ||||||||||||||||||||||||||||||||||||
|
Good morning. I included the JdbcMariaDB. jar file in the directory usr/lib/mysql/plugin as seen below: I then set the globals to include JdbcMariaDB.jar. But I get the same error.
| ||||||||||||||||||||||||||||||||||||
| Comment by Adrian Alonzo [ 2023-04-12 ] | ||||||||||||||||||||||||||||||||||||
|
It seems like this is a debian related issue. In the mean time do you think I can bypass this issue by creating a dockerfile for rockylinux and executing mariadb connect from there instead? | ||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-04-12 ] | ||||||||||||||||||||||||||||||||||||
|
I think the issue based on your screen shot is there is no global read permissions on the jar files in the /usr/lib/mysql/plugins directory and they are root owned. MariaDB is starting as the mysql user so won't be able to read these. I checked the jar file and the class is there.
| ||||||||||||||||||||||||||||||||||||
| Comment by Adrian Alonzo [ 2023-04-13 ] | ||||||||||||||||||||||||||||||||||||
|
Good point. I provided read and changed ownership to mysql:
I now arrive at a different error.
Alternatively, I tried to only include the jar files but the same error occured. " set global connect_class_path="/usr/lib/mysql/pluginJavaWrappers.jar:/usr/lib/mysql/pluginJdbcMariaDB.jar" I found this page which details how to check classpath. Checking classpath I get null. Is this another issue?
| ||||||||||||||||||||||||||||||||||||
| Comment by Anel Husakovic [ 2023-04-14 ] | ||||||||||||||||||||||||||||||||||||
|
Hi, | ||||||||||||||||||||||||||||||||||||
| Comment by Adrian Alonzo [ 2023-04-27 ] | ||||||||||||||||||||||||||||||||||||
|
Hello. Thanks for the reply. The "/" was a typo but correcting it had similar results. So I followed your instructions to ensure it was correct. Im using Kubernetes with Helm so after checking whether connect was installed I restarted with the following:
1. check jvm file path
2. check Javawrapper.jar file path and check the path of you JDBC mariadb client
3. check the path of you JDBC mariadb client
The example below was an adaptation from the docs (although I cannot find the link). It is similar to the SO instructions in the answer.
| ||||||||||||||||||||||||||||||||||||
| Comment by Anel Husakovic [ 2023-05-23 ] | ||||||||||||||||||||||||||||||||||||
|
Hi, Regarding your additional error, I couldn't reproduce it.
| ||||||||||||||||||||||||||||||||||||
| Comment by Anel Husakovic [ 2023-05-29 ] | ||||||||||||||||||||||||||||||||||||
|
Here is the blog post about https://mariadb.org/connect-se-jdbc-table-type-accessing-tables-from-another-dbms/ |