You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tim Christopher <ti...@gmail.com> on 2005/11/05 12:28:12 UTC

Upgrade problems from 1.2.4 to 1.2.7

Hi,

I've read the upgrade notes on the Wiki and have followed all the
instructions, including updating the validation.xml file.

When run with the 1.2.4 version of Struts it runs run but now I have
upgraded I always get a message saying the servlet is unavailable when
trying to view a page.  The error occurs in ActionServlet.java:364 and
dumps to following message to the log file:

java.lang.NoSuchMethodError:
org.apache.commons.validator.ValidatorResources.<init>([Ljava/io/InputStream;)V
at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
....

This error always occurs after it tries to load the validation.xml
file, and yet when I remove references to the Struts Validator from
the Struts-Config file it all works fine:

  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames"
value="/WEB-INF/resources/xml/validator-rules.xml,/WEB-INF/resources/xml/validation.xml"
/>
  </plug-in>


Anyone got any ideas?!

Cheers :-)

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


Re: Upgrade problems from 1.2.4 to 1.2.7

Posted by Gareth Evans <ga...@msoft.co.uk>.
Hi tim,

At some point between 1.2.4 and 1.2.7 the validator was replaced for a newer version.  Each of the 
validate methods defined in the 'validator-rules.xml' now have an extra parameter, 'Validator'.

To fix this you can either:

1) Use the sample validator-rules.xml that comes with 1.2.7
2) Add in the extra parameter into the validator-rules.xml e.g.

Change:
<validator name="required"
             classname="org.apache.struts.validator.FieldChecks"
                method="validateRequired"
          methodParams="java.lang.Object,
                        org.apache.commons.validator.ValidatorAction,
                        org.apache.commons.validator.Field,
                        org.apache.struts.action.ActionMessages,
                        javax.servlet.http.HttpServletRequest"
                   msg="errors.required"/>
To:
<validator name="required"
             classname="org.apache.struts.validator.FieldChecks"
                method="validateRequired"
          methodParams="java.lang.Object,
                        org.apache.commons.validator.ValidatorAction,
                        org.apache.commons.validator.Field,
                        org.apache.struts.action.ActionMessages,
                        org.apache.commons.validator.Validator,
                        javax.servlet.http.HttpServletRequest"
                   msg="errors.required"/>

Regards,

Gareth

Tim Christopher wrote:
> Hi,
> 
> I've read the upgrade notes on the Wiki and have followed all the
> instructions, including updating the validation.xml file.
> 
> When run with the 1.2.4 version of Struts it runs run but now I have
> upgraded I always get a message saying the servlet is unavailable when
> trying to view a page.  The error occurs in ActionServlet.java:364 and
> dumps to following message to the log file:
> 
> java.lang.NoSuchMethodError:
> org.apache.commons.validator.ValidatorResources.<init>([Ljava/io/InputStream;)V
> at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)
> at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
> ....
> 
> This error always occurs after it tries to load the validation.xml
> file, and yet when I remove references to the Struts Validator from
> the Struts-Config file it all works fine:
> 
>   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
>     <set-property property="pathnames"
> value="/WEB-INF/resources/xml/validator-rules.xml,/WEB-INF/resources/xml/validation.xml"
> />
>   </plug-in>
> 
> 
> Anyone got any ideas?!
> 
> Cheers :-)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

-- 
Gareth Evans

MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN

-- 
Tel:    +44 (0)870 0100 704
Fax:    +44 (0)870 9010 705
E-Mail: gareth@msoft.co.uk
Web:    www.msoft.co.uk

----------------------------------------------
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
----------------------------------------------
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.



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