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

Indexes autogenerated by ServiceBuilder on localized fields are not created in MySQL 5.6/5.7

    Details

    • Fix Priority:
      3

      Description

      Steps to reproduce

      1. Create a new module using the servicebuilder Blade template
      2. Set a String column as localized
      3. Add a finder to that column
      4. Do gradlew buildService && gradlew build
      5. Deploy the two resulting jars into a Liferay installation configured with MySQL 5.6/5.7

      Actual result:

      • An exception is thrown:
        10:52:55,253 ERROR [Refresh Thread: Equinox Container: a0503ef0-626c-0017-11e4-e853c2ba52e1][com_liferay_portal_upgrade:97] Invocation to listener threw exception 
        java.lang.RuntimeException: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: BLOB/TEXT column 'field1' used in key specification without a key length
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:491)
                at com.liferay.portal.output.stream.container.OutputStreamContainerFactoryTracker.runWithSwappedLog(OutputStreamContainerFactoryTracker.java:100)
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.executeUpgradeInfos(ReleaseManagerOSGiCommands.java:295)
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands.doExecute(ReleaseManagerOSGiCommands.java:251)
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfoServiceTrackerMapListener.keyEmitted(ReleaseManagerOSGiCommands.java:441)
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfoServiceTrackerMapListener.keyEmitted(ReleaseManagerOSGiCommands.java:431)
                at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$DefaultEmitter.emit(ServiceTrackerMapImpl.java:225)
                at com.liferay.osgi.service.tracker.collections.map.PropertyServiceReferenceMapper.map(PropertyServiceReferenceMapper.java:43)
                at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$ServiceReferenceServiceTrackerCustomizer.addingService(ServiceTrackerMapImpl.java:264)
                at com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$ServiceReferenceServiceTrackerCustomizer.addingService(ServiceTrackerMapImpl.java:251)
                at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
                at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
                at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
                at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
                at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
                at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
                at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:917)
                at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
                at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
                at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)
                at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)
                at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:482)
                at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:1001)
                at com.liferay.portal.upgrade.registry.UpgradeStepRegistratorTracker._register(UpgradeStepRegistratorTracker.java:154)
                at com.liferay.portal.upgrade.registry.UpgradeStepRegistratorTracker.register(UpgradeStepRegistratorTracker.java:58)
                at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextExtender$ModuleApplicationContextExtension._processInitialUpgrade(ModuleApplicationContextExtender.java:421)
                at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextExtender$ModuleApplicationContextExtension.start(ModuleApplicationContextExtender.java:391)
                at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)
                at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)
                at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)
                at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:1)
                at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
                at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
                at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:905)
                at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
                at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
                at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)
                at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)
                at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)
                at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)
                at org.eclipse.osgi.container.Module.publishEvent(Module.java:461)
                at org.eclipse.osgi.container.Module.start(Module.java:452)
                at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)
                at org.eclipse.osgi.container.ModuleContainer.applyDelta(ModuleContainer.java:717)
                at org.eclipse.osgi.container.ModuleContainer.resolveAndApply(ModuleContainer.java:491)
                at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:437)
                at org.eclipse.osgi.container.ModuleContainer.refresh(ModuleContainer.java:955)
                at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1336)
                at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1)
                at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
                at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
        Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: BLOB/TEXT column 'field1' used in key specification without a key length
                at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextExtender$ModuleApplicationContextExtension$1.upgrade(ModuleApplicationContextExtender.java:462)
                at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:470)
                ... 53 more
        Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: BLOB/TEXT column 'field1' used in key specification without a key length
                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
                at com.mysql.jdbc.Util.getInstance(Util.java:386)
                at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
                at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
                at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
                at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
                at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
                at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2788)
                at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1816)
                at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1730)
                at com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:120)
                at com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java)
                at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:293)
                at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:262)
                at com.liferay.portal.dao.db.BaseDB.runSQLTemplateString(BaseDB.java:432)
                at com.liferay.portal.dao.db.BaseDB.runSQLTemplateString(BaseDB.java:489)
                at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextExtender$ModuleApplicationContextExtension$1.upgrade(ModuleApplicationContextExtender.java:458)
                ... 54 more
        

      Expected result:

      • A new table with an index for the column of type String are created successfully

        Attachments

          Activity

            People

            • Assignee:
              preston.crary Preston Crary
              Reporter:
              daniel.couso Daniel Couso
              Participants of an Issue:
              Recent user:
              Michael Saechang
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 5 days ago

                Packages

                Version Package