• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts1 W org.apache.commons.validator.ValidatorResources getForm Form 'MyForm' not found

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[11/30/10 12:56:09:023 EST] 0000003b ValidatorReso W org.apache.commons.validator.ValidatorResources getForm Form 'MyForm' not found for locale 'en_US'

I keep getting this warning in SystemOut.log in WebSphere.
It doesn't seem to cause any issues but I would like to have a clean console without any warning.
I am using Struts 1.3.
Is there a properties file where i can specify the trace level for Struts.
It happens while the server is started.


Regards,
Giriraj.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I support an existing application and we've been working to upgrade to struts 1.3.10. This app has been running several years. I had never seen this warning message until the upgrade attempt, and it's only appearing for a few pages. Due to multiple issues, we've trying to run down all possibilities and this warning was one of them. Here's what I found to be causing this warning.

Most of the suggestions I had found talked about ensuring that all Forms that required validation be included in the validation.xml file as a <form> element, even if it is jsut an empty element. If the relevant <form> element can't be located, you get the warning. Well, my validation.xml had all the relevant <form> entries, so the solution is the same idea, but instead of the <form element not being there, the validation was looking for it using the wrong key value for the couple pages where I had the warning.

Most of the app's Form classes (myForm.java) are extending org.apache.struts.validator.ValidatorForm, but a couple (the ones generating the warning) extend org.apache.struts.validator.ValidatorActionForm (which itself extends ValidatorForm). In reviewing the API docs for both classes, there is a subtle difference in the key value that is retrieved from the <action> element of struts-config.xml. One class retrieves the 'path' attribute, the other the 'name' attribute. This key value is then used to locate the relevant <form> element in validation.xml, per the element's 'name' attribute.

Once I changed the couple Form classes to use ValidatorForm, the proper key value was retrieved which matched to the entries in validation.xml and the warning message went away.

For reference...
http://struts.apache.org/release/1.2.x/api/org/apache/struts/validator/ValidatorForm.html
https://struts.apache.org/release/1.3.x/struts-extras/apidocs/org/apache/struts/validator/ValidatorActionForm.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic