Announcement Announcement Module
Collapse
No announcement yet.
Validation Error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Validation Error

    Hello developers,

    I am building a web application and i got some error:
    Code:
    javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Integer
    	org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:244)
    	org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:227)
    	org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:179)
    	org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:135)
    	org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:121)
    	org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:327)
    	org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:273)
    	org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:256)
    	org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:210)
    	org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119)
    	org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:86)
    	org.springframework.validation.DataBinder.validate(DataBinder.java:692)
    	org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doBind(HandlerMethodInvoker.java:817)
    	org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:359)
    	org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:171)
    	org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:427)
    	org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:415)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:788)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
    	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    and i got this entity class:
    Code:
    @Id
    	@GeneratedValue
    	private Long customerID;
    
    	@Length(min = 2, max = 25, message = "Firstname must contain 2 to 25 characters.")
    	@NotEmpty(message = "Firstname is required.")
    	@Pattern(regexp = "^\\D*$", message = "Firstname must not contain numeric characters.")
    	private String firstName;
    
    	@Length(min = 2, max = 35, message = "Lastname must contain 2 to 35 characters.")
    	@NotEmpty(message = "Lastname is required.")
    	@Pattern(regexp = "^\\D*$", message = "Lastname must not contain numeric characters.")
    	private String lastName;
    
    	@NotEmpty(message = "Middle initial is required")
    	@Length(min = 1, max = 1, message = "Middle initial should only contain 1 character.")
    	@Pattern(regexp = "^\\D*$", message = "Middle initial must not contain numeric characters.")
    	private String middleInitial;
    
    	private int contactNo;
    
    	@NotEmpty(message = "E-mail address is required")
    	@Email(message = "Must be a valid e-mail address")
    	private String emailAddress;
    
    	@NotEmpty(message = "Street is required")
    	@Length(min = 3, max = 50, message = "Street must contain 3 to 50 characters.")
    	private String street;
    
    	@NotEmpty(message = "City is required")
    	@Length(min = 3, max = 50, message = "City must contain 3 to 50 characters.")
    	private String city;
    
    	// @NotEmpty(message = "ZipCode is required")
    	@Pattern(regexp = "^(\\d{5}-\\d{4})|(\\d{5})$", message = "Must be a valid zip code.")
    	private int zipCode;
    
    	@NotEmpty(message = "Occasion is required")
    	private String occasion;
    
    	@Length(min = 1, max = 12, message = "Please choose the Occasion Month")
    	private String occasionDateMonth;
    
    	@Length(min = 1, max = 31, message = "Please choose the Occasion Day")
    	private String occasionDateDay;
    
    	@Length(min = 2011, message = "Please choose the Occasion Year")
    	private int occasionDateYear;
    
    	@Length(min = 1, max = 12, message = "Please choose the Eat time (Hour)")
    	private String eatTimeHour;
    
    	@Length(min = 1, max = 60, message = "Please choose the Eat time (Minute)")
    	private String eatTimeMinute;
    
    	@Length(min = 1, max = 12, message = "Please choose the End time (Hour)")
    	private String endTimeHour;
    
    	@Length(min = 1, max = 60, message = "Please choose the End time (Minute)")
    	private String endTimeMinute;
    
    	@Length(min = 25, max = 100, message = "No. of guest(s) must be minimum of 25 and not exceed 100")
    	private int noOfGuest;
    
    	private Long customerBudget;
    
    	private String venue;
    
    	private String extraMessage;
    can someone help me what should i do to correct this errors.

    Thanks.
    Rodel.
Working...
X