<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=slandelle" rel="nofollow">Stéphane Landelle</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8766?redirect=false" rel="nofollow">SPR-8766</a></strong> and commented</p>
<p dir="auto">Bean property 'statusCodes' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?</p>
<p dir="auto">indeed :<br>
public void setStatusCodes(Properties statusCodes)<br>
Map&lt;String, Integer&gt; getStatusCodes()</p>
<p dir="auto">Probably a regression due to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398112975" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13098" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13098/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13098">#13098</a>. Works with 3.1.0.M2. Maybe works on jdk7 as Introspector was modified.</p>
<p dir="auto">Why not make statusCodes a Map instead of Properties?</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 RC1</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398114934" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13402" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13402/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13402">#13402</a> SimpleMappingExceptionResolver: setStatusCodes getter return not same as setter. Makes override impossible (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=mschipperheyn" rel="nofollow">marc schipperheyn</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8759?redirect=false" rel="nofollow">SPR-8759</a></strong> and commented</p>
<p dir="auto">The getter return type (Map) is not the same as setter (Properties). Since Spring 3.1, this is a problem. I get</p>
<p dir="auto">org.springframework.beans.NotWritablePropertyException: Invalid property 'statusCodes' of bean class [nl.project.interceptor.MySimpleExceptionResolver]: Bean property 'statusCodes' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?<br>
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1057)<br>
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:920)</p>
<p dir="auto">This makes it impossible to configure properties for 'statusCodes' in dispatcher-servlet.xml</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 RC1</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398114984" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13409" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13409/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13409">#13409</a> Impossible to set SimpleMappingExceptionResolver.statusCodes (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/5d42a6242fe0146423fceb266901d03021d0de89/hovercard" href="https://github.com/spring-projects/spring-framework/commit/5d42a6242fe0146423fceb266901d03021d0de89"><tt>5d42a62</tt></a></p>
<p dir="auto">1 votes, 1 watchers</p>