prasadreddy
(Prasad Reddy Penumallu)
1
Hi Team,
We are looking to consume rest module for appointments. we tried to invoke below end point
http://13.235.31.213:8080/openmrs/ws/rest/v1/appointmentscheduling/appointment
Output error:
{
"error": {
"message": "[converting class org.openmrs.module.appointmentscheduling.Appointment to org.openmrs.module.webservices.rest.web.representation.RefRepresentation@1b0c35c8]",
"code": "org.openmrs.module.webservices.rest.web.ConversionUtil:409",
"detail": "org.openmrs.module.webservices.rest.web.response.ConversionException: converting class org.openmrs.module.appointmentscheduling.Appointment to org.openmrs.module.webservices.rest.web.representation.RefRepresentation@1b0c35c8\n\tat org.openmrs.module.webservices.rest.web.ConversionUtil.convertToRepresentation(ConversionUtil.java:409)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BasePageableResult.toSimpleObject(BasePageableResult.java:55)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource.getAll(DelegatingCrudResource.java:233)\n\tat org.openmrs.module.webservices.rest.web.v1_0.controller.MainResourceController.get(MainResourceController.java:209)\n\tat sun.reflect.GeneratedMethodAccessor1814.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:177)\n\tat org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:446)\n\tat org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:434)\n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)\n\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)\n\tat org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:621)\n\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:728)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:60)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:73)\n\tat org.openmrs.web.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:65)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:105)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.webservices.rest.web.filter.ContentTypeFilter.doFilter(ContentTypeFilter.java:64)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:93)\n\tat org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:61)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:57)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:109)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:165)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)\n\tat org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1195)\n\tat org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:654)\n\tat org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:319)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: org.openmrs.module.webservices.rest.web.response.ConversionException\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.asRepresentation(BaseDelegatingResource.java:406)\n\tat org.openmrs.module.webservices.rest.web.ConversionUtil.convertToRepresentation(ConversionUtil.java:406)\n\t... 73 more\nCaused by: java.lang.reflect.InvocationTargetException\n\tat sun.reflect.GeneratedMethodAccessor1922.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.asRepresentation(BaseDelegatingResource.java:396)\n\t... 74 more\nCaused by: org.openmrs.module.webservices.rest.web.response.ConversionException: display on class org.openmrs.module.appointmentscheduling.Appointment\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.getProperty(BaseDelegatingResource.java:762)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription$Property.evaluate(DelegatingResourceDescription.java:245)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingConverter.convertDelegateToRepresentation(BaseDelegatingConverter.java:144)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.DataDelegatingCrudResource.asRef(DataDelegatingCrudResource.java:34)\n\t... 78 more\nCaused by: java.lang.NoSuchMethodException: Unknown property 'display' on class 'class org.openmrs.module.appointmentscheduling.Appointment'\n\tat org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1269)\n\tat org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:808)\n\tat org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:884)\n\tat org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:464)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.getProperty(BaseDelegatingResource.java:756)\n\t... 81 more\n"
}
}
Please help if i am missing something. Please share if there is any documentation for appointment scheduling rest api module
dkayiwa
(Daniel Kayiwa)
2
Are you able to reproduce it here? http://demo.openmrs.org/
prasadreddy
(Prasad Reddy Penumallu)
3
we are trying to hit from postman rest end point
prasadreddy
(Prasad Reddy Penumallu)
4
@dkayiwa we are using rest appointments. do we have any documentation for appointments rest module
dkayiwa
(Daniel Kayiwa)
5
Am not aware of anything besides the online swagger docs. Did you reproduce it on the demo server link that i gave above?
prasadreddy
(Prasad Reddy Penumallu)
6
Yes @dkayiwa i tried to create appointment for provider jake smith and try to get appointments using the below url
http://demo.openmrs.org/openmrs/ws/rest/v1/appointmentscheduling/appointment?provider=bb1a7781-7896-40be-aaca-7d1b41d843a6
still i am getting below exception
{
"error": {
"message": "[converting class org.openmrs.module.appointmentscheduling.Appointment to org.openmrs.module.webservices.rest.web.representation.RefRepresentation@3c6be118]",
"code": "org.openmrs.module.webservices.rest.web.ConversionUtil:409",
"detail": "org.openmrs.module.webservices.rest.web.response.ConversionException: converting class org.openmrs.module.appointmentscheduling.Appointment to org.openmrs.module.webservices.rest.web.representation.RefRepresentation@3c6be118\n\tat org.openmrs.module.webservices.rest.web.ConversionUtil.convertToRepresentation(ConversionUtil.java:409)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BasePageableResult.toSimpleObject(BasePageableResult.java:55)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource.search(DelegatingCrudResource.java:203)\n\tat org.openmrs.module.webservices.rest.web.v1_0.controller.MainResourceController.get(MainResourceController.java:201)\n\tat sun.reflect.GeneratedMethodAccessor1595.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:177)\n\tat org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:446)\n\tat org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:434)\n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)\n\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)\n\tat org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:624)\n\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:731)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:73)\n\tat org.openmrs.web.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:65)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:105)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.webservices.rest.web.filter.ContentTypeFilter.doFilter(ContentTypeFilter.java:64)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:93)\n\tat org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:61)\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)\n\tat org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:57)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:109)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)\n\tat org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)\n\tat org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1137)\n\tat org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)\n\tat org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2512)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: org.openmrs.module.webservices.rest.web.response.ConversionException\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.asRepresentation(BaseDelegatingResource.java:406)\n\tat org.openmrs.module.webservices.rest.web.ConversionUtil.convertToRepresentation(ConversionUtil.java:406)\n\t... 74 more\nCaused by: java.lang.reflect.InvocationTargetException\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.asRepresentation(BaseDelegatingResource.java:396)\n\t... 75 more\nCaused by: org.openmrs.module.webservices.rest.web.response.ConversionException: display on class org.openmrs.module.appointmentscheduling.Appointment\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.getProperty(BaseDelegatingResource.java:762)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription$Property.evaluate(DelegatingResourceDescription.java:245)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingConverter.convertDelegateToRepresentation(BaseDelegatingConverter.java:144)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.DataDelegatingCrudResource.asRef(DataDelegatingCrudResource.java:34)\n\t... 80 more\nCaused by: java.lang.NoSuchMethodException: Unknown property 'display' on class 'class org.openmrs.module.appointmentscheduling.Appointment'\n\tat org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1269)\n\tat org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:808)\n\tat org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:884)\n\tat org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:464)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.getProperty(BaseDelegatingResource.java:756)\n\t... 83 more\n"
}
}
dkayiwa
(Daniel Kayiwa)
7
Can you create a ticket for this?