In my Spring 3.0.5 Web MVC application I have defined a model class with a property annotated with @SafeHtml. When Spring tries to validate this model object, it blows up with the following:
HTTP ERROR: 500
org.jsoup.Jsoup.isValid(Ljava/lang/String;Lorg/jsoup/safety/Whitelist;)Z
RequestURI=/guestbook/process-new-entry
Caused by:
java.lang.NoSuchMethodError: org.jsoup.Jsoup.isValid(Ljava/lang/String;Lorg/jsoup/safety/Whitelist;)Z
at org.hibernate.validator.constraints.impl.SafeHtmlValidator.isValid(SafeHtmlValidator.java:62)
at org.hibernate.validator.constraints.impl.SafeHtmlValidator.isValid(SafeHtmlValidator.java:34)
at org.hibernate.validator.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:278)
... (abbreviated)
I understand this is caused by my not using the right version of Jsoup. (I'm using 0.2.2) In this version I am using, the method signature for isValid() has changed or has been removed altogether. So to resolve this, I believe I should use a different version of Jsoup. Am I right?
Hypothetically, what if I wanted to keep using the version I am currently using - what is the other part that needs a change in version? Is it the Hibernate validator?
Also, can anyone suggest a way to find out which version of Jsoup to use? How do you usually resolve this kind of errors?
And, one final question, what does to "Z" letter at the end of the line mean? I sometimes come across other letters as well. What do these letters mean? Is this documented anywhere?
Thank you all in advance for helping me arrive at a better understanding of how these version discrepancies should be resolved, so I wouldn't need to waste so much of my time in the future... Cheers!