Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-31015

MariaDB Connect JavaWrappers.Jar not found

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.11.2
    • N/A
    • None
    • Ubuntu Docker Image

    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:

      FROM mariadb:10.11
       
      RUN apt update \
          && apt install openjdk-8-jdk -y \
          && export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 \
          && apt install curl -y
       
      RUN curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | bash -s -- --mariadb-server-version="mariadb-10.11"
       
      RUN apt install mariadb-plugin-connect -y
          
      COPY JavaWrappers.jar /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/
      COPY mariadb-java-client-3.1.3.jar /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/
      # Additionally copy to plugin location
      COPY JavaWrappers.jar /usr/lib/mysql/plugin/
      COPY mariadb-java-client-3.1.3.jar /usr/lib/mysql/plugin/
      COPY ./connect.cnf /etc/mysql/mariadb.conf.d/connect.cnf
      RUN chmod 0444 /etc/mysql/mariadb.conf.d/connect.cnf
      

      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:
      Create sample data

      create table sample (bloodType varchar(100) not null);
      INSERT INTO sample (bloodType) VALUES ("O"), ("A"), ("AB");
      

      On MariaDB Image Two:
      Use Connect Engine To Migrate Data From Server One to Two

      create table sample_server1 (
        bloodType varchar(100) not null)
      engine=CONNECT table_type=JDBC
      connection='jdbc:mariadb://10.50.6.101:3306/test?user=root&password=r00t';
       
      create table sample like sample_server1;
      set global connect_jvm_path="/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server";
      alter table sample engine=InnoDB;
      

      Upon the last line I am greeted with the following error:

      MariaDB [test]> alter table sample engine=InnoDB;
      ERROR 1296 (HY000): Got error 174 'ERROR: class /usr/lib/mysql/plugin/JavaWrappers.jar not found!' from CONNECT
      

      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?

      Attachments

        Issue Links

          Activity

            advra Adrian Alonzo created issue -
            advra Adrian Alonzo made changes -
            Field Original Value New Value
            Component/s Storage Engine - Connect [ 10128 ]
            advra Adrian Alonzo added a comment -

            I should also note my docker deployment has a connect.cnf defined as the following:

            [mariadb]
            plugin-load-add=ha_connect.so
             
            connect_jvm_path=”/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server”
            connect_class_path=”/usr/lib/mysql/plugin:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/”
            

            advra Adrian Alonzo added a comment - I should also note my docker deployment has a connect.cnf defined as the following: [mariadb] plugin-load-add=ha_connect.so   connect_jvm_path=”/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server” connect_class_path=”/usr/lib/mysql/plugin:/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/”
            danblack Daniel Black added a comment -

            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:

            • lack of packaging of JavaWrappers.jar - MDEV-26218
            • poor Connect code attemps to load the JarWrappers.jar file as a class, which generates a confusing error message (this bug)
            • user/documentation error, connect_class_path should include the JavaWrappers.jar file.
            danblack Daniel Black added a comment - 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: lack of packaging of JavaWrappers.jar - MDEV-26218 poor Connect code attemps to load the JarWrappers.jar file as a class, which generates a confusing error message (this bug) user/documentation error, connect_class_path should include the JavaWrappers.jar file.
            danblack Daniel Black made changes -
            advra Adrian Alonzo added a comment - - edited

            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.

            MariaDB [test]> set global connect_class_path="/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/JavaWrappers.jar:/usr/lib/mysql/plugin";
            MariaDB [test]> alter table sample engine=InnoDB;
            ERROR 1296 (HY000): Got error 174 'ERROR: class wrappers/JdbcInterface not found!' from CONNECT
            

            MariaDB [test]> set global connect_class_path="/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext:/usr/lib/mysql/plugin";
            MariaDB [test]> alter table sample engine=InnoDB;
            ERROR 1296 (HY000): Got error 174 'ERROR: class wrappers/JdbcInterface not found!' from CONNECT
            

            advra Adrian Alonzo added a comment - - edited 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. MariaDB [test]> set global connect_class_path= "/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/JavaWrappers.jar:/usr/lib/mysql/plugin" ; MariaDB [test]> alter table sample engine=InnoDB; ERROR 1296 (HY000): Got error 174 'ERROR: class wrappers/JdbcInterface not found!' from CONNECT MariaDB [test]> set global connect_class_path= "/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext:/usr/lib/mysql/plugin" ; MariaDB [test]> alter table sample engine=InnoDB; ERROR 1296 (HY000): Got error 174 'ERROR: class wrappers/JdbcInterface not found!' from CONNECT
            danblack Daniel Black added a comment -

            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.

            danblack Daniel Black added a comment - 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.
            danblack Daniel Black made changes -
            Assignee Anel Husakovic [ anel ]
            advra Adrian Alonzo made changes -
            Attachment screenshot-1.png [ 69459 ]
            advra Adrian Alonzo added a comment - - edited

            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.

            set global connect_class_path="usr/lib/mysql/plugin/JavaWrappers.jar:usr/lib/mysql/plugin/JdbcMariaDB.jar:/usr/lib/mysql/plugin";
            MariaDB [test]> alter table sample engine=InnoDB;
            ERROR 1296 (HY000): Got error 174 'ERROR: class wrappers/JdbcInterface not found!' from CONNECT
            

            advra Adrian Alonzo added a comment - - edited 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. set global connect_class_path= "usr/lib/mysql/plugin/JavaWrappers.jar:usr/lib/mysql/plugin/JdbcMariaDB.jar:/usr/lib/mysql/plugin" ; MariaDB [test]> alter table sample engine=InnoDB; ERROR 1296 (HY000): Got error 174 'ERROR: class wrappers/JdbcInterface not found!' from CONNECT
            advra Adrian Alonzo added a comment -

            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?

            advra Adrian Alonzo added a comment - 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?
            danblack Daniel Black added a comment - - edited

            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.

            jar -tvf JdbcMariaDB.jar | more
              2510 Sun Nov 27 14:29:38 SGT 2016 META-INF/MANIFEST.MF
                 0 Thu Nov 24 18:33:48 SGT 2016 wrappers/
              2245 Thu Nov 24 18:33:48 SGT 2016 wrappers/MariadbInterface.class
              2238 Thu Nov 24 18:33:48 SGT 2016 wrappers/OracleInterface.class
              2286 Thu Nov 24 18:33:48 SGT 2016 wrappers/PostgresqlInterface.class
             17099 Thu Nov 24 18:33:48 SGT 2016 wrappers/JdbcInterface.class
              2304 Thu Nov 24 18:33:48 SGT 2016 wrappers/ApacheInterface.class
              5375 Thu Nov 24 18:33:48 SGT 2016 wrappers/Client.class
              2233 Thu Nov 24 18:33:48 SGT 2016 wrappers/MysqlInterface.class
              1776 Sat Jul 16 23:03:00 SGT 2016 wrappers/HikariCPInterface.Copie
            ...
            

            danblack Daniel Black added a comment - - edited 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. jar -tvf JdbcMariaDB.jar | more 2510 Sun Nov 27 14:29:38 SGT 2016 META-INF/MANIFEST.MF 0 Thu Nov 24 18:33:48 SGT 2016 wrappers/ 2245 Thu Nov 24 18:33:48 SGT 2016 wrappers/MariadbInterface.class 2238 Thu Nov 24 18:33:48 SGT 2016 wrappers/OracleInterface.class 2286 Thu Nov 24 18:33:48 SGT 2016 wrappers/PostgresqlInterface.class 17099 Thu Nov 24 18:33:48 SGT 2016 wrappers/JdbcInterface.class 2304 Thu Nov 24 18:33:48 SGT 2016 wrappers/ApacheInterface.class 5375 Thu Nov 24 18:33:48 SGT 2016 wrappers/Client.class 2233 Thu Nov 24 18:33:48 SGT 2016 wrappers/MysqlInterface.class 1776 Sat Jul 16 23:03:00 SGT 2016 wrappers/HikariCPInterface.Copie ...
            advra Adrian Alonzo made changes -
            Attachment screenshot-2.png [ 69521 ]
            advra Adrian Alonzo added a comment - - edited

            Good point. I provided read and changed ownership to mysql:

            chown -R mysql:mysql /usr/lib/mysql/plugin
            chmod o+r /usr/lib/mysql/plugin/*.jar
            chown -R mysql:mysql /usr/lib/mysql
            

            I now arrive at a different error.

            MariaDB [test]> set global connect_class_path="/usr/lib/mysql/pluginJavaWrappers.jar:/usr/lib/mysql/pluginJdbcMariaDB.jar:/usr/lib/mysql/plugin";
            Query OK, 0 rows affected (0.000 sec)
             
            MariaDB [test]> alter table sample engine=InnoDB;
            ERROR 1296 (HY000): Got error 174 'ERROR: class /usr/lib/mysql/plugin/ not found!' from CONNECT
            

            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?

            MariaDB [test]> create function envar returns string soname 'ha_connect.so';
            Query OK, 0 rows affected (0.008 sec)
             
            MariaDB [test]> select envar('CLASSPATH');
            +--------------------+
            | envar('CLASSPATH') |
            +--------------------+
            | NULL               |
            +--------------------+
            

            advra Adrian Alonzo added a comment - - edited Good point. I provided read and changed ownership to mysql: chown -R mysql:mysql /usr/lib/mysql/plugin chmod o+r /usr/lib/mysql/plugin/ *.jar chown -R mysql:mysql /usr/lib/mysql I now arrive at a different error. MariaDB [test]> set global connect_class_path= "/usr/lib/mysql/pluginJavaWrappers.jar:/usr/lib/mysql/pluginJdbcMariaDB.jar:/usr/lib/mysql/plugin" ; Query OK, 0 rows affected (0.000 sec)   MariaDB [test]> alter table sample engine=InnoDB; ERROR 1296 (HY000): Got error 174 'ERROR: class /usr/lib/mysql/plugin/ not found!' from CONNECT 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? MariaDB [test]> create function envar returns string soname 'ha_connect.so' ; Query OK, 0 rows affected (0.008 sec)   MariaDB [test]> select envar( 'CLASSPATH' ); + --------------------+ | envar( 'CLASSPATH' ) | + --------------------+ | NULL | + --------------------+

            Hi,
            before we start let's check do you have loaded connect SE, run select plugin_name from information_schema.plugins where plugin_name='connect';.
            If it is loaded, restart your container docker restart <cont-name>.
            What you should do are following steps:
            1. check jvm file path
            2. check Javawrapper.jar file path
            and make sure they are correct, I suppose this is not correct from your configuration "/usr/lib/mysql/pluginJavaWrappers.jar", missing `/`, right ?
            After that:
            3. check the path of you JDBC mariadb client
            4. add it to your class path connect_class_path together with Javawrapper.jar file
            5. don't care about envar('classpath')
            6. try example from documentation to create the table with {{mariadb}}JDBC and proper authentication. It should work.
            If doesn't work please add results from all above steps to debug.

            anel Anel Husakovic added a comment - Hi, before we start let's check do you have loaded connect SE, run select plugin_name from information_schema.plugins where plugin_name='connect'; . If it is loaded, restart your container docker restart <cont-name> . What you should do are following steps: 1. check jvm file path 2. check Javawrapper.jar file path and make sure they are correct, I suppose this is not correct from your configuration "/usr/lib/mysql/pluginJavaWrappers.jar" , missing `/`, right ? After that: 3. check the path of you JDBC mariadb client 4. add it to your class path connect_class_path together with Javawrapper.jar file 5. don't care about envar('classpath') 6. try example from documentation to create the table with {{mariadb}}JDBC and proper authentication. It should work. If doesn't work please add results from all above steps to debug.
            anel Anel Husakovic made changes -
            Fix Version/s N/A [ 14700 ]
            anel Anel Husakovic made changes -
            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:
            {code:dockerfile}
            FROM mariadb:10.11

            RUN apt update \
                && apt install openjdk-8-jdk -y \
                && export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 \
                && apt install curl -y

            RUN curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | bash -s -- --mariadb-server-version="mariadb-10.11"

            RUN apt install mariadb-plugin-connect -y
                
            COPY JavaWrappers.jar /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/
            COPY mariadb-java-client-3.1.3.jar /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/
            # Additionally copy to plugin location
            COPY JavaWrappers.jar /usr/lib/mysql/plugin/
            COPY mariadb-java-client-3.1.3.jar /usr/lib/mysql/plugin/
            COPY ./connect.cnf /etc/mysql/mariadb.conf.d/connect.cnf
            RUN chmod 0444 /etc/mysql/mariadb.conf.d/connect.cnf
            {code}

            It includes the Java Connector (Java 8 Connector v3.1.3) and Java Wrapper from[ MDEV-10936 |https://jira.mariadb.org/browse/MDEV-10936].

            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:*
            Create sample data
            {code:sql}
            create table sample (bloodType varchar(100) not null);
            INSERT INTO sample (bloodType) VALUES ("O"), ("A"), ("AB");
            {code}

            *On MariaDB Image Two:*
            Use Connect Engine To Migrate Data From Server One to Two
            {code:sql}
            create table sample_server1 (
              bloodType varchar(100) not null)
            engine=CONNECT table_type=JDBC
            connection='jdbc:mariadb://10.50.6.101:3306/test?user=root&password=r00t&#39;;

            create table sample like sample_server1;
            set global connect_jvm_path="/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server";
            alter table sample engine=InnoDB;
            {code}

            Upon the last line I am greeted with the following error:

            {code:sql}
            MariaDB [test]> alter table sample engine=InnoDB;
            ERROR 1296 (HY000): Got error 174 'ERROR: class /usr/lib/mysql/plugin/JavaWrappers.jar not found!' from CONNECT
            {code}

            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?
            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:
            {code:dockerfile}
            FROM mariadb:10.11

            RUN apt update \
                && apt install openjdk-8-jdk -y \
                && export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 \
                && apt install curl -y

            RUN curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | bash -s -- --mariadb-server-version="mariadb-10.11"

            RUN apt install mariadb-plugin-connect -y
                
            COPY JavaWrappers.jar /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/
            COPY mariadb-java-client-3.1.3.jar /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/ext/
            # Additionally copy to plugin location
            COPY JavaWrappers.jar /usr/lib/mysql/plugin/
            COPY mariadb-java-client-3.1.3.jar /usr/lib/mysql/plugin/
            COPY ./connect.cnf /etc/mysql/mariadb.conf.d/connect.cnf
            RUN chmod 0444 /etc/mysql/mariadb.conf.d/connect.cnf
            {code}

            It includes the Java Connector (Java 8 Connector v3.1.3) and Java Wrapper from [MDEV-1093|https://jira.mariadb.org/browse/MDEV-10936].

            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:*
            Create sample data
            {code:sql}
            create table sample (bloodType varchar(100) not null);
            INSERT INTO sample (bloodType) VALUES ("O"), ("A"), ("AB");
            {code}

            *On MariaDB Image Two:*
            Use Connect Engine To Migrate Data From Server One to Two
            {code:sql}
            create table sample_server1 (
              bloodType varchar(100) not null)
            engine=CONNECT table_type=JDBC
            connection='jdbc:mariadb://10.50.6.101:3306/test?user=root&password=r00t&#39;;

            create table sample like sample_server1;
            set global connect_jvm_path="/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server";
            alter table sample engine=InnoDB;
            {code}

            Upon the last line I am greeted with the following error:

            {code:sql}
            MariaDB [test]> alter table sample engine=InnoDB;
            ERROR 1296 (HY000): Got error 174 'ERROR: class /usr/lib/mysql/plugin/JavaWrappers.jar not found!' from CONNECT
            {code}

            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?
            anel Anel Husakovic made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            advra Adrian Alonzo added a comment - - edited

            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:

            # restarting pod from current directory
            restart helm upgrade --recreate-pods -i my-maria-a .
            

            MariaDB [test]>  select plugin_name from information_schema.plugins where plugin_name='connect';
            +-------------+
            | plugin_name |
            +-------------+
            | CONNECT     |
            +-------------+
            

            1. check jvm file path

            root@my-maria-b-deployment-7dd78565d9-r7mcq:/# echo $JAVA_HOME
             
            root@my-maria-b-deployment-7dd78565d9-r7mcq:/# which java
            /usr/bin/java
            root@my-maria-b-deployment-7dd78565d9-r7mcq:/# readlink -f /usr/bin/java
            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
            root@my-maria-b-deployment-7dd78565d9-r7mcq:/usr/lib/mysql/plugin# set global connect_jvm_path="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java:/usr/lib/mysql/plugin";
            
            

            2. check Javawrapper.jar file path and check the path of you JDBC mariadb client

            root@my-maria-b-deployment-7dd78565d9-r7mcq:/usr/lib/mysql/plugin# ll /usr/lib/mysql/plugin/*.jar
            -rw-r--r-- 1 mysql mysql   44053 Apr  4 22:47 /usr/lib/mysql/plugin/JavaWrappers.jar
            -rw-r--r-- 1 mysql mysql 6021947 Apr 10 16:24 /usr/lib/mysql/plugin/JdbcMariaDB.jar
            -rw-r--r-- 1 mysql mysql  638356 Apr  4 17:44 /usr/lib/mysql/plugin/mariadb-java-client-3.1.3.jar
            

            3. check the path of you JDBC mariadb client

            root@my-maria-b-deployment-7dd78565d9-r7mcq:/usr/lib/mysql/plugin# set global connect_class_path="/usr/lib/mysql/plugin/JavaWrappers.jar:/usr/lib/mysql/plugin/mariadb-java-client-3.1.3.jar";
            

            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.

            MariaDB [test]> drop table sample;
            Query OK, 0 rows affected (0.005 sec)
             
            MariaDB [test]> drop table sample_server1;
            Query OK, 0 rows affected (0.004 sec)
             
            MariaDB [test]> create table sample_server1 ( bloodType varchar(100) not null) engine=CONNECT table_type=JDBC connection='jdbc:mariadb://10.50.6.101:3306/test?user=root&password=r00t';
            Query OK, 0 rows affected (0.017 sec)
             
            MariaDB [test]> create table sample like sample_server1;
            Query OK, 0 rows affected (0.003 sec)
             
            MariaDB [test]> alter table sample engine=InnoDB;
            ERROR 1296 (HY000): Got error 174 'ERROR: class /usr/lib/mysql/plugin/ not found!' from CONNECT
            

            advra Adrian Alonzo added a comment - - edited 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: # restarting pod from current directory restart helm upgrade --recreate-pods -i my-maria-a . MariaDB [test]> select plugin_name from information_schema.plugins where plugin_name= 'connect' ; + -------------+ | plugin_name | + -------------+ | CONNECT | + -------------+ 1. check jvm file path root@my-maria-b-deployment-7dd78565d9-r7mcq:/ # echo $JAVA_HOME   root@my-maria-b-deployment-7dd78565d9-r7mcq:/ # which java /usr/bin/java root@my-maria-b-deployment-7dd78565d9-r7mcq:/ # readlink -f /usr/bin/java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java root@my-maria-b-deployment-7dd78565d9-r7mcq: /usr/lib/mysql/plugin # set global connect_jvm_path="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java:/usr/lib/mysql/plugin"; 2. check Javawrapper.jar file path and check the path of you JDBC mariadb client root@my-maria-b-deployment-7dd78565d9-r7mcq: /usr/lib/mysql/plugin # ll /usr/lib/mysql/plugin/*.jar -rw-r--r-- 1 mysql mysql 44053 Apr 4 22:47 /usr/lib/mysql/plugin/JavaWrappers .jar -rw-r--r-- 1 mysql mysql 6021947 Apr 10 16:24 /usr/lib/mysql/plugin/JdbcMariaDB .jar -rw-r--r-- 1 mysql mysql 638356 Apr 4 17:44 /usr/lib/mysql/plugin/mariadb-java-client-3 .1.3.jar 3. check the path of you JDBC mariadb client root@my-maria-b-deployment-7dd78565d9-r7mcq: /usr/lib/mysql/plugin # set global connect_class_path="/usr/lib/mysql/plugin/JavaWrappers.jar:/usr/lib/mysql/plugin/mariadb-java-client-3.1.3.jar"; 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 . MariaDB [test]> drop table sample; Query OK, 0 rows affected (0.005 sec)   MariaDB [test]> drop table sample_server1; Query OK, 0 rows affected (0.004 sec)   MariaDB [test]> create table sample_server1 ( bloodType varchar (100) not null ) engine= CONNECT table_type=JDBC connection = 'jdbc:mariadb://10.50.6.101:3306/test?user=root&password=r00t' ; Query OK, 0 rows affected (0.017 sec)   MariaDB [test]> create table sample like sample_server1; Query OK, 0 rows affected (0.003 sec)   MariaDB [test]> alter table sample engine=InnoDB; ERROR 1296 (HY000): Got error 174 'ERROR: class /usr/lib/mysql/plugin/ not found!' from CONNECT
            anel Anel Husakovic made changes -

            Hi,
            so you can create successfully table using JDBC, what was the purpose of MDEV right.

            Regarding your additional error, I couldn't reproduce it.

            • Source:

              MariaDB [db_maria]> create table sample (bloodType varchar(100) not null);
              Query OK, 0 rows affected (0.028 sec)
              MariaDB [db_maria]> INSERT INTO sample (bloodType) VALUES ("O"), ("A"), ("AB");
              MariaDB [db_maria]> select * from sample;
              +-----------+
              | bloodType |
              +-----------+
              | O         |
              | A         |
              | AB        |
              +-----------+
              

            • Target:

              MariaDB [test]> create table target_sample engine=connect table_type=JDBC tabname=sample connection='jdbc:mariadb://mariadb-source/db_maria?user=root&password';
              Query OK, 0 rows affected (0.014 sec)
               
              MariaDB [test]> select * from target_sample;
              +-----------+
              | bloodType |
              +-----------+
              | O         |
              | A         |
              | AB        |
              +-----------+
              3 rows in set (0.003 sec)
               
              MariaDB [test]> create table target_sample_innodb like target_sample;
              Query OK, 0 rows affected (0.020 sec)
               
              MariaDB [test]> select * from target_sample_innodb;
              +-----------+
              | bloodType |
              +-----------+
              | O         |
              | A         |
              | AB        |
              +-----------+
              3 rows in set (0.003 sec)
              

              Soon, we will publish the blog related to the JDBC and Connect.
              Feel free to create new MDEV related to new error, I will close this one .

            anel Anel Husakovic added a comment - Hi, so you can create successfully table using JDBC, what was the purpose of MDEV right. Regarding your additional error, I couldn't reproduce it. Source: MariaDB [db_maria]> create table sample (bloodType varchar(100) not null); Query OK, 0 rows affected (0.028 sec) MariaDB [db_maria]> INSERT INTO sample (bloodType) VALUES ("O"), ("A"), ("AB"); MariaDB [db_maria]> select * from sample; +-----------+ | bloodType | +-----------+ | O | | A | | AB | +-----------+ Target: MariaDB [test]> create table target_sample engine=connect table_type=JDBC tabname=sample connection='jdbc:mariadb://mariadb-source/db_maria?user=root&password'; Query OK, 0 rows affected (0.014 sec)   MariaDB [test]> select * from target_sample; +-----------+ | bloodType | +-----------+ | O | | A | | AB | +-----------+ 3 rows in set (0.003 sec)   MariaDB [test]> create table target_sample_innodb like target_sample; Query OK, 0 rows affected (0.020 sec)   MariaDB [test]> select * from target_sample_innodb; +-----------+ | bloodType | +-----------+ | O | | A | | AB | +-----------+ 3 rows in set (0.003 sec) Soon, we will publish the blog related to the JDBC and Connect. Feel free to create new MDEV related to new error, I will close this one .
            anel Anel Husakovic made changes -
            Resolution Not a Bug [ 6 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            anel Anel Husakovic added a comment - Here is the blog post about https://mariadb.org/connect-se-jdbc-table-type-accessing-tables-from-another-dbms/

            People

              anel Anel Husakovic
              advra Adrian Alonzo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.