-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Compat broken for ResourceBundleLocator?
PostPosted: Tue Aug 12, 2014 1:55 am 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
I'm migrating an app from JBoss AS 7.1.1 (Validator 4.2.0) to WildFly 8.1.0 (Validator 5.1.0) and I'm getting a CNFE for

org.hibernate.validator.resourceloading.ResourceBundleLocator

according to the migration guide

"org.hibernate.validator.resourceloading.ResourceBundleLocator is deprecated and replaced by org.hibernate.validator.spi.resourceloading.ResourceBundleLocator"

but it looks more like it has been moved(?). How should this be handled if I'd like to deploy the app both in 7.1.1 and 8.1?


Top
 Profile  
 
 Post subject: Re: Compat broken for ResourceBundleLocator?
PostPosted: Tue Aug 12, 2014 9:18 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi Nik,

The ResourceBundleLocator contract has been re-located as of Hibernate Validator 5 as part of our efforts for clearly separating public API, SPI and internal parts of the code base. Generally HV 5 is no 100% drop-in replacement for HV 4; It might require this sort of adaption to a few changed packages, although we tried to minimize the impact.

Supporting both versions is an interesting challenge :) Out of my head I can see the following two approaches:

1) Build two different variants of your application, one compiled against HV 4.2, one compiled against HV 5.1. Often that's not desirable, though.
2) Have two versions of your ResourceBundleLocator implementation (one for 4.2, one for 5.1) and include both in your application (for this to work it may be required to put those two implementations into two different JARs which each are built against one HV version); then you could configure one or the other implementation in your META-INF/validation.xml file if you have a way to process that file during deployment or e.g. contribute it through some environment-specific configuration JAR etc. Alternatively, if you bootstrap your validator (factory) programmatically via Validation#buildValidatorFactory(), you could configure one locator or the other based on the environment (e.g. by reflectively checking which version of the RBL contract exists).

Hth,

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
 Post subject: Re: Compat broken for ResourceBundleLocator?
PostPosted: Wed Aug 13, 2014 3:23 am 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
Thanks for the exhaustive answer. I'll see what I come up with based on your suggestions...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.