-
1. Re: JBoss 4.2.1GA and Hibernate validator - broken
pmuir Aug 6, 2007 7:01 AM (in response to wschwendt)The hibernate-all.jar that we provide containing hibernate is actually quite old. The api for validator has changed between it and the version in JBossAS 4.2.1. So, replace hibernate-all.jar with the jars from hibernate/lib (in the seam distro).
-
2. Re: JBoss 4.2.1GA and Hibernate validator - broken
wschwendt Aug 6, 2007 7:28 AM (in response to wschwendt)Thanks for your reply, Pete. I forgot to mention that I'm using the CVS based Seam 2. When building the Seam example such as the hotel booking example, by default no Hibernate jars are packaged. Rather, the Hibernate jars shipped with JBoss AS are used (I'm using JBoss 4.2.1GA).
I looked at the hibernate/lib directory of the CVS based Seam:
It includes Hibernate 3.2.1.ga, Hibernate Annotations 3.2.1.GA and Hibernate EntityManager Version: 3.2.1.GA.
Thus, only the Hibernate version is more recent than the one shipped with JBoss 4.2.1GA, but the Hibernate Annotations and Hibernate EntityManager are the same as shipped with JBoss 4.2.1GA. While there are more recent versions available (Hibernate EntityManager 3.3.1GA and Hibernate Annotations 3.3.0GA, with Hibernate validator now separate in Hibernate validador 3.3.0GA.jar), these are not included in the Seam based CVS.
I also forgot to mention that only the @Min Hibernate validator failed. The @NotNull validator and other validators such as @Length are working fine. -
3. Re: JBoss 4.2.1GA and Hibernate validator - broken
pmuir Aug 6, 2007 7:34 AM (in response to wschwendt)Sure, no hibernate stuff from Seam is packaged in as runtime dependencies, but, for the examples at least, the hibernate-all.jar *is* used to compile the example (and hence the @Min annotation). The api for @Min has changed between the version of hibernate-all (not sure what this is btw) we have and the hibernate in the AS. I was able to fix it by removing hibernate-all.jar and adding the hibernate/lib to the compile classpath.
-
4. Re: JBoss 4.2.1GA and Hibernate validator - broken
tynor Aug 13, 2007 7:29 PM (in response to wschwendt)What he said. Our project just hit a different bug with the validators in JBoss 4.2.1 that has been fixed in validators-3.3.0 (@Email does not tolerate null values as happens with empty JSF text fields -- http://opensource.atlassian.com/projects/hibernate/browse/HV-3).
Clear instructions for how to update to a fixed version would be very helpful!"wschwendt" wrote:
The following is not a Seam issue, even though it may be important to Seam users.
...
Question:
=======
What needs to be done in order to successfully use the org.hibernate.validator.Min validator? Could a solution be the replacement of the Hibernate packages shipped with JBoss AS 4.2.1GA with more recent versions? I tried to replace those Hibernate jars with Hibernate core 3.3.0GA, Hibernate EntityManager 3.3.1.GA, Hibernate Annotations 3.3.0GA and Hibernate Validator 3.0.0GA, but this produces a a classloading error when Hibernate is started up.
Are there any instructions out there how JBossAS needs to be configured when using the latest Hibernate versions? -
5. Re: JBoss 4.2.1GA and Hibernate validator - broken
tynor Aug 13, 2007 9:22 PM (in response to wschwendt)FWIW,
I've managed to get a working @Email validator by replacing all the hiberate*.jar files in my JBOSS/server/default/lib directory with the following:hibernate-annotations.jar (from hibernate-annoations-3.3.0.GA) hibernate-commons-annotations.jar (ditto) hibernate-entitymanager.jar (from hibernate-entitymanager-3.3.1.GA) ejb3-persistance.jar (from hibernate-entitymanager-3.3.1.GA) hibernate-validator.jar (from hibernate-validator-3.0.0.GA) hibernate3.jar (from hibernate-3.2.5.ga)
I've replaced the lib/hibernate-all.jar bundled with Seam with the above for compile-time and all seems to work OK so far.
I've not tested the @Min validator that originally started this thread.
Seam 1.2.1-GA
JBoss 4.2.1 -
6. Re: JBoss 4.2.1GA and Hibernate validator - broken
chris.simons Feb 17, 2008 4:03 PM (in response to wschwendt)Does anyone know if this problem still exists in Seam 2.0?
-
7. Re: JBoss 4.2.1GA and Hibernate validator - broken
pmuir Feb 17, 2008 6:13 PM (in response to wschwendt)We now have a current version of Hibernate in 2.0.1