Meaningless Drivel is fun!*
The moose likes Struts and the fly likes ValidatorResourcesInitializer class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ValidatorResourcesInitializer class?" Watch "ValidatorResourcesInitializer class?" New topic
Author

ValidatorResourcesInitializer class?

Kris Ten
Greenhorn

Joined: Feb 28, 2007
Posts: 11
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):

  • antlr-2.7.2.jar*
  • bsf-s.3.0.jar
  • commons-beanutils-1.7.0.jar*
  • commons-chain-1.1.jar*
  • commons-digester-1.8.jar*
  • commons-fileupload-1.1.1.jar
  • commons-io-1.1.jar
  • commons-logging-1.0.4.jar*
  • commons-validator-1.3.1.jar*
  • jstl-1.0.2.jar
  • oro-2.0.8.jar*
  • standard-1.0.2.jar
  • struts-core-1.3.5.jar*
  • struts-el-1.3.5.jar
  • struts-extras-1.3.5.jar
  • struts-faces-1.3.5.jar
  • struts-mailreader-dao-1.3.5.jar
  • struts-scripting-1.3.5.jar
  • struts-taglib-1.3.5.jar*
  • struts-tiles-1.3.5.jar




  • Any ideas? Please help !

    Cheers,
    Kristen
    Merrill Higginson
    Ranch Hand

    Joined: Feb 15, 2005
    Posts: 4864
    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?


    Merrill
    Consultant, Sima Solutions
    Kris Ten
    Greenhorn

    Joined: Feb 28, 2007
    Posts: 11
    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.

    Link to Digester release notes http://jakarta.apache.org/commons/digester/commons-digester-1.8/RELEASE-NOTES.txt)

    Thanks again, Merrill!


    Kristen
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: ValidatorResourcesInitializer class?
     
    Similar Threads
    Commons Digester --- java.lang. No Such Method Exception
    Struts javascript validator issue
    Help using Jakarta Commons Digester
    ClassCastException
    Parse error in application web.xml (addChild: Child name 'jsp' is not unique)