Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
@CascadeValidation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @CascadeValidation

    Hi,

    it seems that I have some problem with @CascadeValidation in 0.9...

    Code:
    class A {
    @CascadeValidation private B b;
    }
    class B {
    @CascadeValidation private C c;
    }
    class C {
    //no validations
    }
    A,B and C are JPA-Entities with JPA-annotations too.

    This leads to

    Code:
     java.lang.IllegalArgumentException: org.springmodules.validation.util.condition.string.MaxLengthStringConditioncan only validation values of the following types: java.lang.String
    	at org.springmodules.validation.util.condition.TypeSpecificCondition.beforeObjectChecked(TypeSpecificCondition.java:74)
    	at org.springmodules.validation.util.condition.NonNullAcceptingTypeSpecificCondition.beforeObjectChecked(NonNullAcceptingTypeSpecificCondition.java:43)
    	at org.springmodules.validation.util.condition.AbstractCondition.check(AbstractCondition.java:35)
    	at org.springmodules.validation.util.condition.bean.PropertyBeanCondition.checkBean(PropertyBeanCondition.java:58)
    	at org.springmodules.validation.util.condition.bean.AbstractBeanCondition.doCheck(AbstractBeanCondition.java:39)
    	at org.springmodules.validation.util.condition.AbstractCondition.check(AbstractCondition.java:36)
    	at org.springmodules.validation.bean.BeanValidator.validateAndShortCircuitRules(BeanValidator.java:429)
    	at org.springmodules.validation.bean.BeanValidator.applyPropertiesValidationRules(BeanValidator.java:412)
    	at org.springmodules.validation.bean.BeanValidator.applyBeanValidation(BeanValidator.java:349)
    	at org.springmodules.validation.bean.BeanValidator.validateObjectGraphConstraints(BeanValidator.java:181)
    	at org.springmodules.validation.bean.BeanValidator.validatedSubBean(BeanValidator.java:328)
    	at org.springmodules.validation.bean.BeanValidator.validateObjectGraphConstraints(BeanValidator.java:219)
    	at org.springmodules.validation.bean.BeanValidator.validate(BeanValidator.java:99)
    	at org.springframework.validation.ValidationUtils.invokeValidator(ValidationUtils.java:63)
    	at org.springframework.web.servlet.mvc.BaseCommandController.bindAndValidate(BaseCommandController.java:395)
    	at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:263)
    	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
    	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
    	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    If I remove @CascadeValidation in B it works.

    Bug?
    My fault?

    Thank you

  • #2
    Well - I have learnt that modules validation is dead.
    Spring 3.0 will use jsr-303.

    ...

    Comment

    Working...
    X