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

getHydratedObject giving class not found for person attributes that are org.openmrs.Patient.exitReason and org.openmrs.DrugOrder.discontinuedReason

    Details

    • Complexity:
      Low

      Description

      When you create/edit a Person Attribute Type, the available options for "format" are largely driven by fieldGen. However a couple of the available types don't work, and give an error like this one:

      WARN - PersonAttribute.getHydratedObject(294) |2011-07-14 16:21:17,428| Unable to hydrate value: null for type: Previous
      java.lang.ClassNotFoundException: org.openmrs.Patient.exitReason
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
      	at org.openmrs.util.OpenmrsClassLoader.loadClass(OpenmrsClassLoader.java:164)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
      	at org.openmrs.PersonAttribute.getHydratedObject(PersonAttribute.java:278)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:616)
      	at javax.el.BeanELResolver.getValue(BeanELResolver.java:261)
      	at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
      	at com.sun.el.parser.AstValue.getValue(AstValue.java:138)
      	at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:206)
      	at org.apache.jasper.runtime.PageContextImpl.evaluateExpression(PageContextImpl.java:984)
      	at org.apache.jsp.WEB_002dINF.view.admin.patients.shortPatientForm_jsp._jspx_meth_openmrs_fieldGen_0(org.apache.jsp.WEB_002dINF.view.admin.patients.shortPatientForm_jsp:7363)
      	at org.apache.jsp.WEB_002dINF.view.admin.patients.shortPatientForm_jsp._jspService(org.apache.jsp.WEB_002dINF.view.admin.patients.shortPatientForm_jsp:1807)
      	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
      	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
      	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
      	at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:285)
      	at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
      	at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
      	at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
      	at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
      	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
      	at org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      	at org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)
      	at org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      	at org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:111)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      	at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      	at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      	at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:83)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
      	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
      	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:324)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
      

      To fix this, explicitly remove the formats org.openmrs.Patient.exitReason and org.openmrs.DrugOrder.discontinuedReason within PersonAttributeTypeFormController.java so they are not choices when creating or editing person attribute types.

        Attachments

          Activity

            People

            • Assignee:
              dkayiwa Daniel Kayiwa
              Reporter:
              deadpool Deadpool V.
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: