REST, can not see error log

0 views
Skip to first unread message

ttk

unread,
Nov 24, 2014, 3:52:04 PM11/24/14
to d...@openmrs.org

I am trying to learn more about the REST module. There are two problems to start with:

1. According to this link, I can access /openmrs/ws/rest/v1/patient to get a list of all patient. However, the test page results an error. But the /openmrs/ws/rest/v1/order has no error and displayed all the orders. 

2. How can I see the full error log on the test page. As show in my screen cap, it only shows first couple words and "....". I can use curl to get the full error message but it all in one line. It's hard to read. For the first question, I post the curl error message in the following.

{"error":{"message":"The Resource Does not Support the Requested Operation","code":"org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource:218","detail":"org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException\n\tat org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource.doGetAll(DelegatingCrudResource.java:218)\n\tat org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource.getAll(DelegatingCrudResource.java:205)\n\tat org.openmrs.module.webservices.rest.web.v1_0.controller.MainResourceController.get(MainResourceController.java:176)\n\tat sun.reflect.GeneratedMethodAccessor963.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:622)\n\tat


Thanks for your help.





Darius Jazayeri

unread,
Nov 24, 2014, 3:57:20 PM11/24/14
to dev
Hi Ttk,

Recently someone created this ticket about the fact that not enough is logged: https://issues.openmrs.org/browse/RESTWS-472

Could you make a change to the BaseRestController in the webservices.rest module (and do a Pull Request for this) to add a line that logs exceptions in the handleException method?

-Darius

--
OpenMRS Developers: http://om.rs/dev
Post: d...@openmrs.org | Unsubscribe: dev+uns...@openmrs.org
Manage your OpenMRS subscriptions at http://om.rs/id
 
Register today for our Maputo 2015 Implementers Meeting: http://om.rs/moz15

ttk

unread,
Nov 24, 2014, 9:47:19 PM11/24/14
to d...@openmrs.org
I am not a java programmer yet, I just started watching your tutorials on YouTube. I wish I could follow your advice soon.
Reply all
Reply to author
Forward
0 new messages