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

Liferay crashes on enable Tomcat JNDI with MariaDB

    Details

    • Branch Version/s:
      7.1.x
    • Fix Priority:
      5

      Description

      Edit: The reason for this is new JDBC driver Updated in Tomcat

      I have working Liferay Portal (Clean setup without installed portlets and so on) with portal-ext.properties file:

      jdbc.default.driverClassName=org.mariadb.jdbc.Driver
      jdbc.default.url=jdbc:mariadb://mariadb:3306/liferaydb?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
      jdbc.default.username=liferay
      jdbc.default.password=start123
      

      Next I want to have JNDI datasource on Liferay's Tomcat servlet container Approach 2 here: https://community.liferay.com/es/blogs/-/blogs/database-connection-pool-sharing-between-portal-and-portlets

      I have only change /tomcat/conf/context.xml and server.xml
      After start Liferay server:

      2019-02-14 16:59:30.702 ERROR [main][DialectDetector:147] org.hibernate.HibernateException: Unable to determine Dialect to use [name=MariaDB, majorVersion=10]; user must register resolver or explicitly set 'hibernate.dialect'
      org.hibernate.HibernateException: Unable to determine Dialect to use [name=MariaDB, majorVersion=10]; user must register resolver or explicitly set 'hibernate.dialect'
      	at org.hibernate.dialect.resolver.DialectFactory.determineDialect(DialectFactory.java:130)
      	at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:96)
      	at com.liferay.portal.spring.hibernate.DialectDetector.getDialect(DialectDetector.java:129)
      	at com.liferay.portal.dao.jdbc.DataSourceFactoryImpl.initDataSource(DataSourceFactoryImpl.java:205)
      	at com.liferay.portal.kernel.dao.jdbc.DataSourceFactoryUtil.initDataSource(DataSourceFactoryUtil.java:39)
      	at com.liferay.portal.dao.jdbc.spring.DataSourceFactoryBean.createInstance(DataSourceFactoryBean.java:44)
      	at com.liferay.portal.dao.jdbc.spring.DataSourceFactoryBean.createInstance(DataSourceFactoryBean.java:30)
      	at org.springframework.beans.factory.config.AbstractFactoryBean.afterPropertiesSet(AbstractFactoryBean.java:134)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736)
      	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:762)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
      	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
      	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
      	at com.liferay.portal.spring.context.ArrayApplicationContext.<init>(ArrayApplicationContext.java:33)
      	at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:251)
      	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4643)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5109)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:742)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
      	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
      	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1840)
      	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:525)
      	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:424)
      	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
      	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
      	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
      	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
      	at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
      	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:966)
      	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
      	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
      	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:943)
      	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      	at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
      	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:350)
      	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
      

      Dialect cannot be set in portal-ext.properties like:
      hibernate.dialect=org.hibernate.dialect.MySQL5Dialect

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                32 weeks, 1 day ago

                Packages

                Version Package
                7.1.X