[hibernate-issues] [Hibernate-JIRA] Commented: (HV-250) No validator could be found for type: T

Hardy Ferentschik (JIRA) noreply at atlassian.com
Tue Oct 13 10:45:43 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=34169#action_34169 ] 

Hardy Ferentschik commented on HV-250:
--------------------------------------

Could you provide a test case? 
I've added

	public void testConstraintValidatorForGenericType() {
		Validator validator = TestUtil.getValidator();

		Set<ConstraintViolation<Batch<BatchItem>>> constraintViolations = validator.validate( new Batch<BatchItem>() );
		assertNumberOfViolations( constraintViolations, 1 );
		ConstraintViolation<Batch<BatchItem>> violation = constraintViolations.iterator().next();
		assertEquals(violation.getConstraintDescriptor().getAnnotation().annotationType(), NotNull.class);
	}

to ValidatorResolutionTest on the trunk. Batch is the class described in the forum post and BatchItem is just a subclass of Item. This works just fine.

A full test case would be appreciated.

> No validator could be found for type: T
> ---------------------------------------
>
>                 Key: HV-250
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-250
>             Project: Hibernate Validator
>          Issue Type: Bug
>          Components: validators
>    Affects Versions: 4.0.0.CR1
>         Environment: Win XP, Java 1.6
>            Reporter: Jaro Kuruc
>             Fix For: 4.1.0
>
>
> Please see my forum post https://forum.hibernate.org/viewtopic.php?f=26&t=999640
> From debugging the code, it seems to me that type resolving does not work properly, especially in case generics are used.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list