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

Unclear exception when using incorrect mysql connector jar

    Details

    • Fix Priority:
      4
    • OS:
      Windows 10

      Description

      Steps to reproduce issue:

      1. Configure portal-ext.properties for mysql connection
      2. Copy 5.1.23 MySQL JDBC connector jar into lib/ext directory
      3. Start app server
      4. Verify exception is thrown

      Expected result: Exception thrown is related to an invalid class path (since 5.1.23 mysql.jar does not contain com.mysql.cj.jdbc)
      Actual result: Exception thrown is InvalidPathException:

      20-May-2019 17:36:29.870 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.liferay.portal.spring.context.PortalContextLoaderListener]
       java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayDataSourceImpl' defined in class path resource [META-INF/infrastructure-spring.xml]: Invocation of init method failed; nested exception is java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/achu/Desktop/liferay-dxp-7.2.10-rc3/tomcat-9.0.17/lib/ext/\mysql.jar
              at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:256)
              at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4682)
              at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5150)
              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:713)
              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:695)
              at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:631)
              at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1832)
              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:526)
              at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:425)
              at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1577)
              at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
              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:929)
              at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831)
              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
              at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1377)
              at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1367)
              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:902)
              at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
              at org.apache.catalina.core.StandardService.startInternal(StandardService.java:423)
              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
              at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:928)
              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
              at org.apache.catalina.startup.Catalina.start(Catalina.java:634)
              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)
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayDataSourceImpl' defined in class path resource [META-INF/infrastructure-spring.xml]: Invocation of init method failed; nested exception is java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/achu/Desktop/liferay-dxp-7.2.10-rc3/tomcat-9.0.17/lib/ext/\mysql.jar
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1631)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
              at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742)
              at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
              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:248)
              ... 41 more
      Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/achu/Desktop/liferay-dxp-7.2.10-rc3/tomcat-9.0.17/lib/ext/\mysql.jar
              at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
              at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
              at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
              at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
              at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
              at java.nio.file.Paths.get(Paths.java:84)
              at com.liferay.portal.util.JarUtil.downloadAndInstallJar(JarUtil.java:80)
              at com.liferay.portal.util.JarUtil.downloadAndInstallJar(JarUtil.java:107)
              at com.liferay.portal.dao.jdbc.DataSourceFactoryImpl.testDatabaseClass(DataSourceFactoryImpl.java:598)
              at com.liferay.portal.dao.jdbc.DataSourceFactoryImpl.initDataSource(DataSourceFactoryImpl.java:134)
              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:135)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1689)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1627)
              ... 54 more
      

      Note: This can also be reproduced by attempting to upgrade using a a 5.x mysql connector

      Reproduced on:
      Tomcat 9.0.17 + MySQL 5.7
      Portal master GIT ID: 177cf7b77e50603caa150ad069c639c759381a0d
      Portal 7.2.10 DXP RC3

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                support-lep@liferay.com SE Support
                Reporter:
                anthony.chu Anthony Chu
                Participants of an Issue:
                Recent user:
                Sorin Pop
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

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

                  Packages

                  Version Package