[hibernate-issues] [Hibernate-JIRA] Commented: (HV-456) The MethodValidator could not handle Proxied objects like in EJB environment

Gunnar Morling (JIRA) noreply at atlassian.com
Mon Mar 21 14:00:08 EDT 2011


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

Gunnar Morling commented on HV-456:
-----------------------------------

Right, only the root method of an overridden method in an inheritance hierarchy may be annoted with parameter constraints. HV-421 discusses the reason for this in detail. In case of a session bean the interface (if there is one) must be annotated as Kevin says (I think {{ResourceBundleFacade}} is the interface here).

If your situation is another one (I'm not sure how proxies/interceptors relate to the problem) a complete example demonstrating the issue would be very helpful.

> The MethodValidator could not handle Proxied objects like in EJB environment
> ----------------------------------------------------------------------------
>
>                 Key: HV-456
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-456
>             Project: Hibernate Validator
>          Issue Type: Bug
>          Components: engine
>    Affects Versions: 4.2.0.Beta2
>         Environment: linux, java 1.6.0_24, hibernate-validator-4.2.0.Beta2, JBoss-5.1.0.GA
>            Reporter: Ingo Bruell
>
> Using the MethodValidator with proxied objects via an interceptor in an ejb environment throws the following exception:
> javax.validation.ConstraintDeclarationException: Only the root method of an overridden method in an inheritance hierarchy may be annotated with parameter constraints. The following method itself has no parameter constraints but it is not defined on a sub-type of class de.enexoma.smartmeter.server.facade.config.ResourceBundleFacadeBean: MethodMetaData [method=public abstract java.util.Map de.enexoma.smartmeter.server.facade.ResourceBundleFacade.get(java.lang.String) throws de.enexoma.smartmeter.server.error.EnexomaException, parameterMetaData=[ParameterMetaData [type=class java.lang.String], [index=0], name=arg0], constraints=[], isCascading=false]], constraints=[], isCascading=false, hasParameterConstraints=false]
> The method in the "real" class has constraints defined:
> 	public Map<Locale,List<ResourceBundle>> get(@NotNull @Size(min=1)final String appName) 

-- 
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