-
1. Re: [jboss-metadata] Validation on completely merged view
emuckenhuber Oct 13, 2008 3:21 PM (in response to alrubinger)"ALRubinger" wrote:
Is there a mechanism to validate metadata after all the processing/merging is completed? I'm envisioning something in the form of a chain of validators run by by JBoss50Creator.create() after everything is merged.
Hmm, no there is not such a validation mechanism - we were thinking of adding smth like that, but this is actually not planned for the next future.
Maybe you can add this check to merging?
There you also have the xml data, if someone added the remote interface in the xml.
But not really sure if that makes sense to add all to merging!? -
2. Re: [jboss-metadata] Validation on completely merged view
alrubinger Oct 13, 2008 3:50 PM (in response to alrubinger)"emuckenhuber" wrote:
Hmm, no there is not such a validation mechanism - we were thinking of adding smth like that, but this is actually not planned for the next future.
Any objections to my adding a validator chain to be run at the end of Creator.create() please speak now or forever hold your piece."emuckenhuber" wrote:
But not really sure if that makes sense to add all to merging!?
Merge merges, validators validate. :)
Then we can even make the validation configurable/pluggable in the future if we want.
S,
ALR -
3. Re: [jboss-metadata] Validation on completely merged view
alrubinger Oct 13, 2008 10:07 PM (in response to alrubinger)This is tracked in https://jira.jboss.org/jira/browse/JBMETA-118 and has been committed in r79433.
The only place I've triggered the ValidatorChain to run is from JBoss50Creator. Can we think of other instances in which we'd need to validate a fully-merged metadata?
S,
ALR -
4. Re: [jboss-metadata] Validation on completely merged view
alrubinger Oct 13, 2008 10:52 PM (in response to alrubinger)I'm also giving the ValidatorChain the ability to report all Validation failures at once, instead of fail-fast (should make things easier for bean providers)
org.jboss.metadata.validation.ValidationException: An @RemoteBinding was defined on EJB MyStatelessBean, but this bean has no remote business interfaces defined. [JBMETA-117]
...becomes:org.jboss.metadata.validation.chain.ValidatorChainException: Validation has failed due to the following ValidationException(s) raised: An @RemoteBinding was defined on EJB MyStatelessBean, but this bean has no remote business interfaces defined. [JBMETA-117]
S,
ALR -
5. [jboss-metadata] Validation on completely merged view
henk53 Apr 15, 2011 7:29 PM (in response to alrubinger)Shouldn't this maybe be updated for EJB 3.1 and no-interface views?
I have an EJB 3.1 bean without an interface, for which I would like to specify a local binding, but JBoss AS 6 doesn't let me because there is no (business) interface specified.
-
6. [jboss-metadata] Validation on completely merged view
jaikiran Apr 16, 2011 12:20 AM (in response to henk53)We did not plan to support overriding of JBoss specifc JNDI names for no-interface views, since EJB3.1 introduced a portable JNDI name scheme. You are encouraged to use the EJB3.1 jndi names instead of JBoss specific ones. @LocalBinding isn't taken into account for no-interface views.
-
7. Re: [jboss-metadata] Validation on completely merged view
henk53 Apr 16, 2011 4:28 AM (in response to jaikiran)jaikiran pai wrote:
We did not plan to support overriding of JBoss specifc JNDI names for no-interface views, since EJB3.1 introduced a portable JNDI name scheme. You are encouraged to use the EJB3.1 jndi names instead of JBoss specific ones.
Yes, that does make sense.
I noticed though that internally JBoss sometimes uses the non-portable names, like in e.g. JBossEnterpriseBeanMetaData. I also have spotted code like this on a couple of occasions:
private static String getLocalJndiName(JBossEnterpriseBeanMetaData ejb, Class<?> ejbClass) { // See if local binding is explicitly-defined LocalBinding localBinding = ejbClass.getAnnotation(LocalBinding.class); // If none specified if (localBinding == null || (localBinding.jndiBinding() != null && localBinding.jndiBinding().trim().length() == 0)) { String name = ejb.getLocalJndiName(); return name; } // Local Binding was explicitly-specified, use it else { return localBinding.jndiBinding(); } }
(this is from ResteasyEjbDeployer)
Code such as this never works with no-interface views, so the only way out for the user (except for patching the code) would be if the LocalBinding annotation was allowed on EJB beans without an interface.
-
8. Re: [jboss-metadata] Validation on completely merged view
jaikiran Apr 16, 2011 8:26 AM (in response to henk53)Yeah, that's buggy for no-interface views. If this is causing you issues in AS6, then can you please open a JBAS JIRA with the relevant details?
-
9. Re: [jboss-metadata] Validation on completely merged view
henk53 Apr 16, 2011 1:12 PM (in response to jaikiran)jaikiran pai wrote:
Yeah, that's buggy for no-interface views. If this is causing you issues in AS6, then can you please open a JBAS JIRA with the relevant details?
Okay, I already created a RestEasy JIRA here: https://issues.jboss.org/browse/RESTEASY-531
The JBAS one, should that best be a request to add a no-interface property to JBossEnterpriseBeanMetaData or to support LocalBinding anyway on no-interface views?