Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

Failed to convert property value of type 'java.lang.String'

What am I doing wrong here:

                        ```<select th:field="*{role}">
                            <option value="#" disabled = "disabled" selected="selected">Role...</option>
                            <!--<option th:each="r : ${roles}" th:value="${r}" th:text="${r.name}">Developer</option>-->
                            <option th:each="r : ${roles}" th:value="${r.id}" th:text="${r.name}">Developer</option>
                        </select>```

I am getting this error:

Field error in object 'collaborator' on field 'role': rejected value [33]; codes [typeMismatch.collaborator.role,typeMismatch.role,typeMismatch.com.imprender.instateam.model.Role,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [collaborator.role,role]; arguments []; default message [role]]; default message [*Failed to convert property value of type 'java.lang.String' to required type 'com.imprender.instateam.model.Role' for property 'role'*; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'com.imprender.instateam.model.Role' for property 'role': no matching editors or conversion strategy found]

I says: Failed to convert property value of type 'java.lang.String' to required type 'com.imprender.instateam.model.Role' for property 'role'

but I don't understand where I am doing that...