Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-125428

Liferay's MariaDB Connector/J JDBC URL lacks support for options

    Details

      Description

      Liferay 7.3.5 CE GA6
      MariaDB 10.2
      OpenJDK 11

      Liferay's MariaDB Connector/J [tomcat_home]/lib/ext/mariadb.jar version seems to be 1.1.9 (released in 2015). That connector version supports only two JDBC URL options: user and password.

      I noticed this when having useSSL=false option in my JDBC URL as I don't have SSL enabled in my test environment:

      jdbc.default.driverClassName=org.mariadb.jdbc.Driver
      jdbc.default.url=jdbc:mariadb://localhost/lportal?characterEncoding=UTF-8&useFastDateParsing=false&useUnicode=true&useSSL=false
      

      This caused the following exception:

      java.sql.SQLException: Trying to connect with ssl, but ssl not enabled in the server
              at org.mariadb.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:149)
              at org.mariadb.jdbc.internal.SQLExceptionMapper.throwException(SQLExceptionMapper.java:106)
              at org.mariadb.jdbc.Driver.connect(Driver.java:115)
      

      MariaDB Connector/J started supporting additional JDBC URL options in version 1.2.0 (released in 2015).

      As Liferay's database template for MariaDB is:

      jdbc.default.driverClassName=org.mariadb.jdbc.Driver
      jdbc.default.url=jdbc:mariadb://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
      jdbc.default.username=
      jdbc.default.password=

      and as it seems that MariaDB Connector/J version 1.1.9 is ignoring useUnicode, characterEncoding and useFastDateParsing options I think it would be important to get the connector version updated in Liferay Tomcat package.

      I updated manually the MariaDB Connector/J to a fresh version and this seemed to solve the problem in my test environment.

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            mikael.andersson@alekstra.com Mikael Andersson
            Participants of an Issue:
            Recent user:
            Mikael Andersson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              47 weeks, 5 days ago

                Packages

                Version Package