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

DB Partitioning refuses to use the JDBC connection to MySQL server through MariaDB driver

Details

    Description

      Current validation in the DB Partitioning refuses to use the connection through this MariaDB driver as Liferay determines the DB type from via the dialect detector which eventually checks against the JDBC driver name, however it should validate against the JDBC connection string because MariaDB Connector/J permits connection URLs beginning with both jdbc:mariadb and jdbc:mysql.
      Refs:

      • Portal props usage for MySQL server with MariaDB JDBC Driver
      jdbc.default.driverClassName=org.mariadb.jdbc.Driver
      jdbc.default.url=jdbc:mysql://localhost/testee?serverTimezone=GMT&useSSL=false
      • Diver version: mariadb-java-client-2.7.4.jar

      Stacktrace during startup:

      2021-12-09 15:10:30.684 INFO  [main][DialectDetector:149] Using dialect com.liferay.portal.dao.orm.hibernate.MariaDBDialect for MySQL 5.7
      09-Dec-2021 15:10:30.688 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.sun.proxy.$Proxy5]
              java.lang.reflect.UndeclaredThrowableException
                      at com.sun.proxy.$Proxy5.contextInitialized(Unknown Source)
                      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4766)
                      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5230)
                      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
                      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:698)
                      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
                      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:690)
                      at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1889)
                      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                      at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                      at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
                      at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:583)
                      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
                      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1618)
                      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
                      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
                      at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
                      at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
                      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:946)
                      at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
                      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
                      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
                      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                      at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                      at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
                      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
                      at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
                      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                      at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
                      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                      at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
                      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                      at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                      at java.lang.reflect.Method.invoke(Method.java:498)
                      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
                      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
              Caused by: java.lang.reflect.InvocationTargetException
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                      at java.lang.reflect.Method.invoke(Method.java:498)
                      at com.liferay.shielded.container.internal.proxy.ContextClassLoaderInvocationHandler.invoke(ContextClassLoaderInvocationHandler.java:43)
                      at com.liferay.shielded.container.internal.proxy.EventListenerInvocationHandler.invoke(EventListenerInvocationHandler.java:64)
                      ... 42 more
              Caused by: java.lang.Error: Database partition requires MySQL
                      at com.liferay.portal.db.partition.DBPartitionUtil.wrapDataSource(DBPartitionUtil.java:233)
                      at com.liferay.portal.dao.init.DBInitUtil._initDataSource(DBInitUtil.java:246)
                      at com.liferay.portal.dao.init.DBInitUtil.init(DBInitUtil.java:73)
                      at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:252)
                      ... 48 more
      

      Attachments

        Issue Links

          Activity

            People

              victor.ware Victor Ware
              zoltan.takacs Zoltan Takacs
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                23 weeks, 3 days ago

                Packages

                  Version Package
                  7.4.3.7 CE GA7
                  7.4.13 DXP U3
                  7.4.3.29 CE GA29
                  7.4.3.30 CE GA30
                  Master