[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openmrs-dev
Subject:    Re: Unnecessary logged exceptions when saving forms
From:       Rafal Korytkowski <rafal () openmrs ! org>
Date:       2012-12-28 9:45:30
Message-ID: CAKNp=UMH=kmkYSa7esLYkr2WAVtxcbgE5ZjrQM+4CYovCyvzHQ () mail ! gmail ! com
[Download RAW message or body]

Skipping over @Deprecated properties sounds right to me.


-Rafał


On 28 December 2012 00:56, Darius Jazayeri <djazayeri@gmail.com> wrote:

> Since OpenMRS 1.9, when we moved Form's XSLT and template columns into
> FormResources, there's a long, misleading, and unnecessary amount of
> exception logged every time the FormService.saveForm method is called.
>
> For example, when I build the EMR module for Mirebalais, I get a longer
> version of this:
>
> Running org.openmrs.module.emr.htmlform.EnterHtmlFormTaskComponentTest
> WARN - OpenmrsObjectSaveHandler.handle(116) |2012-12-27 15:41:00,084|
> Failed to access property template; accessor threw exception.
> java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ...
> at
> org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)
> at
> org.openmrs.api.handler.OpenmrsObjectSaveHandler.handle(OpenmrsObjectSaveHandler.java:87)
>  at
> org.openmrs.aop.RequiredDataAdvice.recursivelyHandle(RequiredDataAdvice.java:268)
> ...
> Caused by: java.lang.UnsupportedOperationException: Templates no longer
> exist on Forms. Use Form Attributes.
>  at org.openmrs.Form.getTemplate(Form.java:141)
> ... 69 more
>
> I've been thinking about how we can stop this, and my current thought is
> to go through all of our handlers, and for each one that recurses on the
> object's properties (e.g. OpenmrsObjectSaveHandler recurses on all String
> properties to trim them), we should skip over @Deprecated properties.
>
> Anyone have opinions about this? (Yea, nay, or a better way?)
>
> -Darius
>
> --
> OpenMRS Developers: http://go.openmrs.org/dev
> Post: dev@openmrs.org
> Unsubscribe: dev+unsubscribe@openmrs.org
> Manage your OpenMRS subscriptions at https://id.openmrs.org/
>
>
>

-- 
OpenMRS Developers: http://go.openmrs.org/dev
Post: dev@openmrs.org
Unsubscribe: dev+unsubscribe@openmrs.org
Manage your OpenMRS subscriptions at https://id.openmrs.org/



[Attachment #3 (text/html)]

<div dir="ltr">Skipping over @Deprecated properties sounds right to me.</div><div \
class="gmail_extra"><br clear="all"><div><br>-Rafał</div> <br><br><div \
class="gmail_quote">On 28 December 2012 00:56, Darius Jazayeri <span dir="ltr">&lt;<a \
href="mailto:djazayeri@gmail.com" target="_blank">djazayeri@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">

<div dir="ltr">Since OpenMRS 1.9, when we moved Form&#39;s XSLT and template columns \
into FormResources, there&#39;s a long, misleading, and unnecessary amount of \
exception logged every time the FormService.saveForm method is called.<div>



<br></div><div>For example, when I build the EMR module for Mirebalais, I get a \
longer version of this:</div><div><br></div><div><div>Running \
org.openmrs.module.emr.htmlform.EnterHtmlFormTaskComponentTest</div>

<div>WARN - OpenmrsObjectSaveHandler.handle(116) |2012-12-27 15:41:00,084| Failed to \
access property template; accessor threw \
exception.</div><div>java.lang.reflect.InvocationTargetException</div><div><span \
style="white-space:pre-wrap">	</span>at \
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div>



<div><span style="white-space:pre-wrap">...</span></div><div><span \
style="white-space:pre-wrap">	</span>at \
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)</div><div><span \
style="white-space:pre-wrap">	</span>at \
org.openmrs.api.handler.OpenmrsObjectSaveHandler.handle(OpenmrsObjectSaveHandler.java:87)</div>




<div><span style="white-space:pre-wrap">	</span>at \
org.openmrs.aop.RequiredDataAdvice.recursivelyHandle(RequiredDataAdvice.java:268)</div><div><span \
style="white-space:pre-wrap">...</span></div><div>Caused by: \
java.lang.UnsupportedOperationException: Templates no longer exist on Forms. Use Form \
Attributes.</div>



<div><span style="white-space:pre-wrap">	</span>at \
org.openmrs.Form.getTemplate(Form.java:141)</div><div><span \
style="white-space:pre-wrap">	</span>... 69 \
more</div></div><div><br></div><div>I&#39;ve been thinking about how we can stop \
this, and my current thought is to go through all of our handlers, and for each one \
that recurses on the object&#39;s properties (e.g. OpenmrsObjectSaveHandler recurses \
on all String properties to trim them), we should skip over @Deprecated \
properties.<br>



</div><div><br></div><div>Anyone have opinions about this? (Yea, nay, or a better \
way?)</div><span class="HOEnZb"><font \
color="#888888"><div><br></div><div>-Darius</div></font></span></div><span \
class="HOEnZb"><font color="#888888">

<p></p>

-- <br>
OpenMRS Developers: <a href="http://go.openmrs.org/dev" \
                target="_blank">http://go.openmrs.org/dev</a><br>
Post: <a href="mailto:dev@openmrs.org" target="_blank">dev@openmrs.org</a><br>
Unsubscribe: <a href="mailto:dev%2Bunsubscribe@openmrs.org" \
target="_blank">dev+unsubscribe@openmrs.org</a><br> Manage your OpenMRS subscriptions \
at <a href="https://id.openmrs.org/" target="_blank">https://id.openmrs.org/</a><br>  \
<br>  <br>
</font></span></blockquote></div><br></div>

<p></p>

-- <br />
OpenMRS Developers: <a \
                href="http://go.openmrs.org/dev">http://go.openmrs.org/dev</a><br />
Post: dev@openmrs.org<br />
Unsubscribe: dev+unsubscribe@openmrs.org<br />
Manage your OpenMRS subscriptions at <a \
href="https://id.openmrs.org/">https://id.openmrs.org/</a><br /> &nbsp;<br />
&nbsp;<br />



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic