Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenericConversionService.convert() throws IllegalArgumentException after updating to Spring 3.2.1 [SPR-10243] #14876

spring-projects-issues opened this issue Jan 30, 2013 · 3 comments
type: bug


Copy link

@spring-projects-issues spring-projects-issues commented Jan 30, 2013

Phil Webb opened SPR-10243 and commented

After updating Spring from 3.2.0.RELEASE to 3.2.1.RELEASE I've got following error:

java.lang.IllegalArgumentException: The source to convert from must be an instance of @org.hibernate.validator.constraints.NotEmpty @javax.validation.constraints.Size @javax.validation.constraints.Pattern java.lang.String; instead it was a ru.mystamps.web.model.ActivateAccountForm
    at org.springframework.validation.AbstractPropertyBindingResult.formatFieldValue(
    at org.springframework.validation.AbstractBindingResult.getFieldValue(
    at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(
    at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(
    at org.springframework.web.servlet.tags.form.LabelTag.autogenerateFor(
    at org.springframework.web.servlet.tags.form.LabelTag.resolveFor(
    at org.springframework.web.servlet.tags.form.LabelTag.writeTagContent(
    at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(
    at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(
    at org.apache.jsp.WEB_002dINF.tiles.body.account.activate_jsp._jspx_meth_form_label_2(
    at org.apache.jsp.WEB_002dINF.tiles.body.account.activate_jsp._jspService(

JSP code:

<form:form method="post" action="${activateUrl}" modelAttribute="activateAccountForm">
    <form:label path="login">
        <spring:message code="t_login" />

Model declaration:

public class ActivateAccountForm implements ActivateAccountDto {                                    

    @NotEmpty(groups = Login1Checks.class)                                                          
            min = ValidationRules.LOGIN_MIN_LENGTH,                                                 
            message = "{value.too-short}",                                                          
            groups = Login2Checks.class                                                             
            max = ValidationRules.LOGIN_MAX_LENGTH,                                                 
            message = "{value.too-long}",                                                           
            groups = Login2Checks.class                                                             
        regexp = ValidationRules.LOGIN_REGEXP,                                                      
        message = "{login.invalid}",                                                                
        groups = Login3Checks.class                                                                 
    @UniqueLogin(groups = Login4Checks.class)                                                       
    private String login;



@RequestMapping(value = Url.ACTIVATE_ACCOUNT_PAGE, method = RequestMethod.POST)                 
public String processActivationForm(                                                            
        LoginChecks.class, NameChecks.class, PasswordChecks.class,                              
        PasswordConfirmationChecks.class, ActKeyChecks.class, FormChecks.class                  
    }) ActivateAccountForm form, BindingResult result) {                                        

    if (result.hasErrors()) {                                                                   
        return null;                                                                            


    return "redirect:" + Url.SUCCESSFUL_ACTIVATION_PAGE;                                        

Affects: 3.2.1

Reference URL:

Issue Links:

  • #13970 SpringValidatorAdapter is incorrectly resolving rejected value for bean based field level constraints
  • #14979 SpringValidationAdapter cannot handle disabled default constraint violation
  • #19648 Spring validation crashes with Hibernate Validation 5 style list constraint violations
  • #20725 NumberFormatException caused by property paths from JSR-303 based validation with no index into a collection

Referenced from: commits cef9781, 19eecb1

0 votes, 5 watchers

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 30, 2013

Phil Webb commented

I am having trouble replicating the issue. There is a sample project here that does not appear to fail.

Does the original project include any additional validation on the ActivateAccountForm class? What does the LoginChecks class look like?

If possible could you take a look at the sample project and try to get it to replicate the issue.

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Feb 10, 2013

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Feb 11, 2013

Juergen Hoeller commented

Fixed through applying both checks for retrieving the raw field value now: the previous one that we had in 3.2 GA and the new one from 3.2.1 (#13970).

In both cases, Bean Validation doesn't expose the right value to us, so we need to fall back to manually retrieving the raw field value from the target bean.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
type: bug
None yet

No branches or pull requests

2 participants