You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by John D Dinh <sd...@gmail.com> on 2006/03/03 00:31:42 UTC

error in Common Validor 1.2.0 with Struts 1.2.8

Hi,

I'm getting an error when validating email with Common Validator 1.2.0 in
conjunction with Struts 1.2.8 and Jakarta ORO 2.0.7 (we also tried the
latest ORO 2.0.8).

[3/2/06 13:39:21:469 PST] 19c79c30 WebGroup      E SRVE0026E: [Servlet
Error]-[org.apache.oro.text.regex.Util: method
substitute&#40;Ljava/lang/StringBuffer&#59;Lorg/apache/oro/text/regex/PatternMatcher&#59;Lorg/apache/oro/text/regex/Pattern&#59;Lorg/apache/oro/text/regex/Substitution&#59;Ljava/lang/String&#59;I&#41;I
not found]: java.lang.NoSuchMethodError: org.apache.oro.text.regex.Util:
method
substitute(Ljava/lang/StringBuffer;Lorg/apache/oro/text/regex/PatternMatcher;Lorg/apache/oro/text/regex/Pattern;Lorg/apache/oro/text/regex/Substitution;Ljava/lang/String;I)I
not found
    at org.apache.oro.text.perl.Perl5Util.substitute(Unknown Source)
    at org.apache.oro.text.perl.Perl5Util.substitute(Unknown Source)
    at org.apache.commons.validator.EmailValidator.stripComments(
EmailValidator.java:249)
    at org.apache.commons.validator.EmailValidator.isValid(
EmailValidator.java:98)
    at org.apache.commons.validator.GenericValidator.isEmail(
GenericValidator.java:256)
    at org.apache.struts.validator.FieldChecks.validateEmail(
FieldChecks.java:778)

Rolled back to Common Validator 1.1.4 works, but we like to take advantages
of numerous fixes in email validation in the latest Common Validator.
Any help would be greatly appreciated.

john dinh

Re: error in Common Validor 1.2.0 with Struts 1.2.8

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
First I tried to re-create this problem in the Struts 1.2 branch, by adding
validation for the three validators which use ORO (email, url and mask) to
the type form:

http://svn.apache.org/viewcvs.cgi?rev=382882&view=rev

...and dropping in the Validator 1.2.0 jar - but it worked fine for me (with
ORO 2.0.7)

The difference between Validator 1.1.4 and Validator 1.2.0 in respect to
EmailValidator use of ORO is that the 1.2.0 version calls the Perl5Util's
substitute() method:

http://svn.apache.org/viewcvs.cgi?rev=140178&view=rev

... which in turn calls the org.apache.oro.text.regex.Util's substitute
method which you're getting the "method not found" issue on. According to
the ORO javadoc - that flavour of the substitute() method was added in ORO
2.0.6 (although it looks to me like it was actually added on 2.0.5)

So it looks to me like your deployment is picking up a version of ORO
earlier than 2.0.5 / 2.0.6.

Niall

----- Original Message ----- 
From: "John D Dinh" <sd...@gmail.com>
Sent: Thursday, March 02, 2006 11:31 PM


Hi,

I'm getting an error when validating email with Common Validator 1.2.0 in
conjunction with Struts 1.2.8 and Jakarta ORO 2.0.7 (we also tried the
latest ORO 2.0.8).

[3/2/06 13:39:21:469 PST] 19c79c30 WebGroup      E SRVE0026E: [Servlet
Error]-[org.apache.oro.text.regex.Util: method
substitute&#40;Ljava/lang/StringBuffer&#59;Lorg/apache/oro/text/regex/Patter
nMatcher&#59;Lorg/apache/oro/text/regex/Pattern&#59;Lorg/apache/oro/text/reg
ex/Substitution&#59;Ljava/lang/String&#59;I&#41;I
not found]: java.lang.NoSuchMethodError: org.apache.oro.text.regex.Util:
method
substitute(Ljava/lang/StringBuffer;Lorg/apache/oro/text/regex/PatternMatcher
;Lorg/apache/oro/text/regex/Pattern;Lorg/apache/oro/text/regex/Substitution;
Ljava/lang/String;I)I
not found
    at org.apache.oro.text.perl.Perl5Util.substitute(Unknown Source)
    at org.apache.oro.text.perl.Perl5Util.substitute(Unknown Source)
    at org.apache.commons.validator.EmailValidator.stripComments(
EmailValidator.java:249)
    at org.apache.commons.validator.EmailValidator.isValid(
EmailValidator.java:98)
    at org.apache.commons.validator.GenericValidator.isEmail(
GenericValidator.java:256)
    at org.apache.struts.validator.FieldChecks.validateEmail(
FieldChecks.java:778)

Rolled back to Common Validator 1.1.4 works, but we like to take advantages
of numerous fixes in email validation in the latest Common Validator.
Any help would be greatly appreciated.

john dinh



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org