I'm implementing Struts 1.3.5 and have upgraded my commons-validator and commons-digester jars to version 1.3.1 and 1.8, respectively. When I run my code, I'm receiving a Struts error like the following: ...
[3/6/07 13:09:00:014 EST] 3b29421f ValidatorPlug I org.apache.struts.validator.ValidatorPlugIn Loading validation rules file from '/WEB-INF/validation.xml'
[3/6/07 13:09:00:155 EST] 3b29421f Digester E org.apache.commons.digester.Digester End event threw exception
[3/6/07 13:09:00:155 EST] 3b29421f Digester E org.apache.commons.digester.Digester TRAS0014I: The following exception was logged java.lang.NoSuchMethodException: No such accessible method: addVarParam() on object: org.apache.commons.validator.Field at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:214) at org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:585) at org.apache.commons.digester.Rule.end(Rule.java:228) at org.apache.commons.digester.Digester.endElement(Digester.java:1067) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLNSDTDValidator.endNamespaceScope(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1591) at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(ValidatorResourcesInitializer.java:259)
... and the list goes on and on...
until we get to
[3/6/07 13:09:00:155 EST] 3b29421f ValidatorReso E org.apache.commons.validator.ValidatorResourcesInitializer Error at (79, 11: No such accessible method: addVarParam() on object: org.apache.commons.validator.Field
[3/6/07 13:09:00:171 EST] 3b29421f ValidatorReso E org.apache.commons.validator.ValidatorResourcesInitializer TRAS0014I: The following exception was logged java.lang.NoSuchMethodException: No such accessible method: addVarParam() on object: org.apache.commons.validator.Field at org.apache.commons.digester.Digester.createSAXException(Digester.java:2792) at org.apache.commons.digester.Digester.createSAXException(Digester.java:2818) at org.apache.commons.digester.Digester.endElement(Digester.java:1070)
... yada yada yada ... I think you get the point.
Here's my question: the ValidatorResourcesIntializer class has been deprecated. So why is it even being called? I've mulled through source code in the org.apache.struts.validator, org.apache.commons.validator, and org.apache.commons.digester packages that's up to my ears
Any ideas? Am I missing another updated jar somewhere? Here's the list struts jars currently in my WEB-INF/lib directory (I've starred the ones I actually think I use, but they're all in there regardless):
Originally posted by Kris Ten: I'm implementing Struts 1.3.5 and have upgraded my commons-validator and commons-digester jars to version 1.3.1 and 1.8, respectively.
The best advice I can give is to not do that. Struts was created to work with specific versions of each of these open-source products, and if you change them, all bets are off. Is there really some feature in the latest releases of these products that would make it worthwhile to cause yourself this kind of pain?
You know, at the end of the day yesterday, I was wondering why I did that in the first place... The reason I think lies in the Digester more than in the Validator. There was a small J2EE-related bug in previous versions of the Commons Digester, so upon that upgrade, I found the Commons Validator 1.3.1 version, which was enhanced to "support" the newest version of Digester. Anyway, I've provided a link to the release notes below, and I think I'll go back and try it again, with the 1.6 Digester and the 1.3.0 Validator, and we'll see what we get.