[jboss-dev-forums] [JBoss Microcontainer Development POJO Server] - Re: Deploying ValidatorFactory

pete.muir@jboss.org do-not-reply at jboss.com
Tue Sep 15 14:20:50 EDT 2009


Hi Stan,

I've tried out the getting the ValidatorFactory from the DeploymentUnit, however, I'm running into a problem, which *I think* is probably a bug, but I'm happy to be convinced otherwise :-)

If you have an EAR, the current deployer attaches the ValidatorFactory to the relevant modules of the EAR (e.g. war, ejb jars), and not to the top-level-deployment-unit (the EAR itself). I think it should (also) be attached to the top level deployment unit, because the ValidatorFactory is an application wide instance, not a per-module instance. Adding this to the deployer solves it:

            if (!unit.isTopLevel() && !unit.getTopLevel().isAttachmentPresent(ValidatorFactory.class))
  |             {
  |                unit.getTopLevel().addAttachment(ValidatorFactory.class, vf);
  |             }

If you are happy with this, I'll commit it.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4255370#4255370

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4255370



More information about the jboss-dev-forums mailing list