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

Web Form portlet fails to submit when field "comment" is over 2000 characters on SQLServer - java.sql.BatchUpdateException: Data truncation occurs in the log due to the limitation in ExpandoValue "data_": nvarchar(2000)

    Details

    • Branch Version/s:
      6.2.x, 6.1.x
    • Backported to Branch:
      Committed
    • Story Points:
      8
    • Fix Priority:
      4
    • Databases:
      SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012

      Description

      1- Start portal on SQLServer
      2- Build & deploy Web Form portlet
      3- Add portlet to a page
      4- Fill the form: paste a text as "Comment" that is longer than 2000 characters
      5- Submit

      Result: Form cannot be submitted, exception occurs in the log

      13:07:50,143 ERROR [JDBCExceptionReporter:75] Data truncation
      13:07:50,145 ERROR [JDBCExceptionReporter:75] String or binary data would be truncated.
      13:07:50,149 ERROR [WebFormPortlet:343] The web form data could not be saved to the database
      com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.DataException: Could not execute JDBC batch update
              at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:193)
              at com.liferay.portlet.expando.service.persistence.ExpandoValuePersistenceImpl.updateImpl(ExpandoValuePersistenceImpl.java:495)
              at com.liferay.portlet.expando.service.persistence.ExpandoValuePersistenceImpl.updateImpl(ExpandoValuePersistenceImpl.java:1)
              at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.update(BasePersistenceImpl.java:257)
              at com.liferay.portlet.expando.service.impl.ExpandoValueLocalServiceImpl.doAddValue(ExpandoValueLocalServiceImpl.java:1977)
              at com.liferay.portlet.expando.service.impl.ExpandoValueLocalServiceImpl.addValue(ExpandoValueLocalServiceImpl.java:54)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:112)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
              at $Proxy144.addValue(Unknown Source)
              at com.liferay.portlet.expando.service.impl.ExpandoValueLocalServiceImpl.addValue(ExpandoValueLocalServiceImpl.java:530)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:112)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:108)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
              at $Proxy144.addValue(Unknown Source)
              at com.liferay.portlet.expando.service.ExpandoValueLocalServiceUtil.addValue(ExpandoValueLocalServiceUtil.java:449)
              at com.liferay.webform.portlet.WebFormPortlet.saveDatabase(WebFormPortlet.java:335)
              at com.liferay.webform.portlet.WebFormPortlet.saveData(WebFormPortlet.java:187)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.liferay.portal.kernel.portlet.LiferayPortlet.callActionMethod(LiferayPortlet.java:146)
              at com.liferay.util.bridges.mvc.MVCPortlet.callActionMethod(MVCPortlet.java:250)
              at com.liferay.portal.kernel.portlet.LiferayPortlet.processAction(LiferayPortlet.java:76)
              at com.liferay.util.bridges.mvc.MVCPortlet.processAction(MVCPortlet.java:220)
              at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:70)
              at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)
              at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:93)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:71)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
              at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
              at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
              at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:637)
              at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:686)
              at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:361)
              at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:887)
              at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:638)
              at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:249)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
              at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:174)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
              at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:538)
              at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:515)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
              at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:289)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
              at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:247)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:71)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
              at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
              at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
              at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
              at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:135)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
              at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:310)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
              at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
              at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:289)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
              at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:241)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
              at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:55)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
              at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:247)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
              at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
              at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
              at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:216)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:71)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
              at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:619)
      Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.DataException: Could not execute JDBC batch update
              at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:30)
              at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:122)
              at com.liferay.portal.kernel.dao.orm.ClassLoaderSession.flush(ClassLoaderSession.java:218)
              at com.liferay.portal.service.persistence.BatchSessionImpl.update(BatchSessionImpl.java:95)
              at com.liferay.portal.service.persistence.BatchSessionUtil.update(BatchSessionUtil.java:49)
              at com.liferay.portlet.expando.service.persistence.ExpandoValuePersistenceImpl.updateImpl(ExpandoValuePersistenceImpl.java:490)
              ... 176 more
      Caused by: org.hibernate.exception.DataException: Could not execute JDBC batch update
              at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:102)
              at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
              at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
              at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
              at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
              at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
              at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
              at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
              at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:119)
              ... 180 more
      Caused by: java.sql.BatchUpdateException: Data truncation
              at net.sourceforge.jtds.jdbc.JtdsStatement.executeBatch(JtdsStatement.java:947)
              at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
              at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
              at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
              ... 186 more
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 20 weeks, 1 day ago

                  Zendesk Support