As far as keeping validation logic in the entity itself, you can do something like this:
| @Entity
| @Name("foo")
| @Table(name = "foo")
| public class Foo implements Serializable {
| ...
| @AssertTrue(message = "{invalid.nonRepeatCycle.message}")
| public boolean isNonRepeatCycleValid() {
| return nonRepeatCycle > 0;
| }
| ...
| }
|
It seems to me you're better of using Hibernate's validation framework rather than creating your own; I imagine you'd end up duplicating a lot of it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073762#4073762
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073762
Okay - I have found the resolution and it is pretty simple but I think it would be important for people to know.
The exception was being thrown because I did a cut paste of the block of the JMS provider from MS Word into vi editor on linux (found out it does not matter - even while editing on windows give same issue). That made tab characters remain in the block rather than spaces for the jndi context properties. That was causing the jndi lookup to fail. So the properties being loaded had those tab characters and they were not removed (?? don't know why - shouldn't white space removed/trimmed) during the lookup and obviously the name could not be found.
Pretty silly mistake - but took quite a bit of time.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073761#4073761
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073761
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?
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073760#4073760
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073760
Hi, i'm getting a bit problem, i was using ExadelStudio Pro 3.5.1, but i migrated to 4.0.1 and the applications that before worked well, sudendly began to raise inexplicable and extrange exceptions. I think i found a clue to discover the mistery, i deployed the same .war in the ExadelStudio Pro 3.5.1 tomcat and in the ExadelStudio Pro 4.0.1(and 4.0.4) tomcat in the first one everythink work fine but in the second i get the error i refered to.
The ExadelStudio Pro 3.5.1 use Tomcat 5.0 and ExadelStudio Pro 4.0.1 and 4.0.4 use Tomcat 5.5
?There are some problem with the new versions of Tomcat?
?Something related to the use of an old version of the JVM by default?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073754#4073754
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073754