Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5145

Form name and retire_reason field sizes in database should match hibernate

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Low

      Description

      An error message like "Caused by: org.openmrs.api.ValidationException: '' failed to validate with reason: name: This value exceeds the maximum length of

      {0} permitted for this field." occurs when those with forms whose names exceed 50 characters try to run them on platform 2.x as per the stack trace below:
      
      

      ERROR - PageController.handlePath(155) |2017-02-16 16:56:21,847| Error rendering page view for patientdashboard/patientDashboard. Model properties:
      sessionContext
      featureToggles
      patient
      selectedTab
      activeVisit
      encounterTemplateExtensions
      appContextModel
      overallActions
      includeFragments
      visitActions
      patientTabs
      dashboardUrl
      ui
      context
      contextPath
      session
      param
      out
      canBook
      locale
      allFormHistory
      appName
      org.openmrs.ui.framework.ViewException: Error rendering page view for patientdashboard/patientDashboard. Model properties:
      sessionContext
      featureToggles
      patient
      selectedTab
      activeVisit
      encounterTemplateExtensions
      appContextModel
      overallActions
      includeFragments
      visitActions
      patientTabs
      dashboardUrl
      ui
      context
      contextPath
      session
      param
      out
      canBook
      locale
      allFormHistory
      appName
      at org.openmrs.ui.framework.page.GroovyPageView.render(GroovyPageView.java:55)
      at org.openmrs.ui.framework.page.PageFactory.processThisFragment(PageFactory.java:187)
      at org.openmrs.ui.framework.page.PageFactory.process(PageFactory.java:116)
      at org.openmrs.ui.framework.page.PageFactory.handle(PageFactory.java:86)
      at org.openmrs.module.uiframework.PageController.handlePath(PageController.java:116)
      at org.openmrs.module.uiframework.PageController.handleUrlWithDotPage(PageController.java:83)
      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.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:177)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:446)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:434)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:60)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:72)
      at org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:57)
      at org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:70)
      at org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:54)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:108)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: org.openmrs.ui.framework.FragmentException: Error evaluating view: formsHistory
      at org.openmrs.ui.framework.fragment.GroovyFragmentView.render(GroovyFragmentView.java:78)
      at org.openmrs.ui.framework.fragment.FragmentFactory.processThisFragment(FragmentFactory.java:195)
      at org.openmrs.ui.framework.fragment.FragmentFactory.process(FragmentFactory.java:124)
      at org.openmrs.ui.framework.page.PageContext.includeFragment(PageContext.java:75)
      at org.openmrs.ui.framework.UiUtils.includeFragment(UiUtils.java:158)
      at org.openmrs.ui.framework.UiUtils$includeFragment$13.call(Unknown Source)
      at SimpleTemplateScript36$_run_closure5.doCall(SimpleTemplateScript36.groovy:87)
      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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021)
      at groovy.lang.Closure.call(Closure.java:426)
      at groovy.lang.Closure.call(Closure.java:442)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056)
      at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      at SimpleTemplateScript36.run(SimpleTemplateScript36.groovy:84)
      at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.writeTo(SimpleTemplateEngine.java:168)
      at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.toString(SimpleTemplateEngine.java:180)
      at org.openmrs.ui.framework.page.GroovyPageView.render(GroovyPageView.java:43)
      ... 65 more
      Caused by: java.lang.IllegalArgumentException: Failed to parse XML and build Form and HtmlForm
      at org.openmrs.module.htmlformentryui.HtmlFormUtil.getHtmlFormFromResourceXml(HtmlFormUtil.java:125)
      at org.openmrs.module.htmlformentryui.HtmlFormUtil.getHtmlFormFromUiResource(HtmlFormUtil.java:51)
      at org.openmrs.module.htmlformentryui.HtmlFormUtil.getHtmlFormFromUiResource(HtmlFormUtil.java:40)
      at org.openmrs.module.isanteplus.IsantePlusHtmlForm.<init>(IsantePlusHtmlForm.java:24)
      at org.openmrs.module.isanteplus.fragment.controller.IsantePlusFormsFragmentController.controller(IsantePlusFormsFragmentController.java:73)
      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.openmrs.ui.framework.UiFrameworkUtil.invokeMethodWithArguments(UiFrameworkUtil.java:109)
      at org.openmrs.ui.framework.UiFrameworkUtil.executeControllerMethod(UiFrameworkUtil.java:68)
      at org.openmrs.ui.framework.fragment.FragmentFactory.handleRequestWithController(FragmentFactory.java:241)
      at org.openmrs.ui.framework.fragment.FragmentFactory.processThisFragment(FragmentFactory.java:160)
      at org.openmrs.ui.framework.fragment.FragmentFactory.process(FragmentFactory.java:124)
      at org.openmrs.ui.framework.fragment.FragmentContext.includeFragment(FragmentContext.java:54)
      at org.openmrs.ui.framework.UiUtils.includeFragment(UiUtils.java:152)
      at org.openmrs.ui.framework.UiUtils$includeFragment$0.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
      at SimpleTemplateScript44.run(SimpleTemplateScript44.groovy:44)
      at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.writeTo(SimpleTemplateEngine.java:168)
      at groovy.text.SimpleTemplateEngine$SimpleTemplate$1.toString(SimpleTemplateEngine.java:180)
      at org.openmrs.ui.framework.fragment.GroovyFragmentView.render(GroovyFragmentView.java:46)
      ... 94 more
      Caused by: org.openmrs.api.ValidationException: '' failed to validate with reason: name: This value exceeds the maximum length of {0}

      permitted for this field.
      at org.openmrs.validator.ValidateUtil.validate(ValidateUtil.java:78)
      at org.openmrs.aop.RequiredDataAdvice.before(RequiredDataAdvice.java:124)
      at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:51)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      at com.sun.proxy.$Proxy192.saveForm(Unknown Source)
      at org.openmrs.module.htmlformentryui.HtmlFormUtil.getHtmlFormFromResourceXml(HtmlFormUtil.java:96)
      ... 117 more

      
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                dkayiwa Daniel Kayiwa
                Reporter:
                dkayiwa Daniel Kayiwa
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: