Hi,

Can you give some more details about the environment and project versions
you're using?

Are you by any chance declaring a producer method for j.v.Validator? The
Validator bean contributed by Seam Validation (which you seem to be using)
is application scoped, so the validator should only be bootstrapped once. I
don't think it's an issue with Hibernate Validator itself but with the
integration into CDI and how it is configured.

--Gunnar



2013/12/21 John D. Ament <john.d.am...@gmail.com>

> John,
>
> Hibernate Validator should only be creating a validator factory once
> for the deployment.  Hence, it should only be reading validation.xml
> at deployment time.  The fact that you are seeing it multiple times is
> why I'm thinking its a validator issue (I don't reproduce this on
> mine, I'm on AS 7.1.1 w/ Validator 4.3.1).  Hence why I'm curious what
> version you're on.  Hibernate Validator is responsible for the
> instantiation of the validator factory.
>
> Also, I assumed (possibly foolishly) that your rest endpoint is
> annotated with a CDI or EJB qualifying annotation.  Is that the case?
>
> Just as a heads up as well, the InjectingConstraintValidator was
> recently ported from Seam3 to DeltaSpike.  The code is almost
> verbatim.
>
> On Sat, Dec 21, 2013 at 11:02 AM, John Franey <jjfra...@gmail.com> wrote:
> > John,
> >
> > I'm excellent....thanks.  You?
> >
> > Yes, this seems more like a question for weld/hibernate, than
> resteasy...but
> > I thought to start at the top :)
> >
> > Maybe I misunderstand injection, within the jax-rs environment, or in
> > general.  I'm not sure which component drives the initialization of the
> > validator, I guess its weld.  On the other hand, if I have a faulty
> > understanding of jax-rs integration with cdi, I could be inadvertently
> > causing multiple initializations.
> >
> > Thanks for the response.  I posted a similar question to weld after you
> > implicitly confirmed my code is not at fault.
> >
> > John
> >
> >
> >
> >
> >
> > On Fri, Dec 20, 2013 at 6:50 PM, John D. Ament <john.d.am...@gmail.com>
> > wrote:
> >>
> >> Hey John,
> >>
> >> How are you?
> >>
> >> It seems like your issue is more Hibernate Validator related.  What
> >> version are you using?  I don't see that message on the 4.3 branch or
> >> the 4.1 branch.
> >>
> >> - John
> >>
> >> On Fri, Dec 20, 2013 at 5:53 PM, John Franey <jjfra...@gmail.com>
> wrote:
> >> > Hi,
> >> >
> >> > I have a resource that injects the validator, and the rest method
> >> > invokes
> >> > the validator.  On every request, I see these entries in the log.
>  That
> >> > is
> >> > 'Parsing XML based configuration by 4 on every request.  Is that
> >> > reasonable?
> >> > If not, how do I workaround?
> >> >
> >> > 17:38:14,022 INFO
> >> > [org.hibernate.validator.internal.xml.ValidationXmlParser]
> >> > (http-localhost/127.0.0.1:8080-1) HV000007: META-INF/validation.xml
> >> > found.
> >> > Parsing XML based configurati
> >> > on.
> >> > 17:38:14,027 INFO
> >> > [org.hibernate.validator.internal.xml.ValidationXmlParser]
> >> > (http-localhost/127.0.0.1:8080-1) HV000003: Using
> >> > org.jboss.seam.validation.InjectingConstraintValidator
> >> > Factory as constraint factory.
> >> > 17:38:14,046 INFO
> >> > [org.hibernate.validator.internal.xml.ValidationXmlParser]
> >> > (http-localhost/127.0.0.1:8080-1) HV000007: META-INF/validation.xml
> >> > found.
> >> > Parsing XML based configurati
> >> > on.
> >> > 17:38:14,051 INFO
> >> > [org.hibernate.validator.internal.xml.ValidationXmlParser]
> >> > (http-localhost/127.0.0.1:8080-1) HV000003: Using
> >> > org.jboss.seam.validation.InjectingConstraintValidator
> >> > Factory as constraint factory.
> >> > 17:38:14,068 INFO
> >> > [org.hibernate.validator.internal.xml.ValidationXmlParser]
> >> > (http-localhost/127.0.0.1:8080-1) HV000007: META-INF/validation.xml
> >> > found.
> >> > Parsing XML based configurati
> >> > on.
> >> > 17:38:14,073 INFO
> >> > [org.hibernate.validator.internal.xml.ValidationXmlParser]
> >> > (http-localhost/127.0.0.1:8080-1) HV000003: Using
> >> > org.jboss.seam.validation.InjectingConstraintValidator
> >> > Factory as constraint factory.
> >> > 17:38:14,093 INFO
> >> > [org.hibernate.validator.internal.xml.ValidationXmlParser]
> >> > (http-localhost/127.0.0.1:8080-1) HV000007: META-INF/validation.xml
> >> > found.
> >> > Parsing XML based configuration.
> >> > 17:38:14,099 INFO
> >> > [org.hibernate.validator.internal.xml.ValidationXmlParser]
> >> > (http-localhost/127.0.0.1:8080-1) HV000003: Using
> >> > org.jboss.seam.validation.InjectingConstraintValidatorFactory as
> >> > constraint
> >> > factory.
> >> >
> >> >
> >> >
> >> > This is a simplification of my code:
> >> >
> >> > @Path(....)
> >> > public class MyResource {
> >> >
> >> >   @Inject
> >> >   private Validator validator;
> >> >
> >> >   @PUT
> >> >   public create(MyObject myObject) {
> >> >        validator.validate(myObject);
> >> >   }
> >> > }
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> ------------------------------------------------------------------------------
> >> > Rapidly troubleshoot problems before they affect your business. Most
> IT
> >> > organizations don't have a clear picture of how application
> performance
> >> > affects their revenue. With AppDynamics, you get 100% visibility into
> >> > your
> >> > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
> >> > AppDynamics
> >> > Pro!
> >> >
> >> >
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> >> > _______________________________________________
> >> > Resteasy-users mailing list
> >> > Resteasy-users@lists.sourceforge.net
> >> > https://lists.sourceforge.net/lists/listinfo/resteasy-users
> >> >
> >
> >
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to