Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
2.1.2
-
None
-
None
-
Tomcat 6.0 + Struts 2.1.2
Description
We use log4j debug in all validator methods to get the detail for illegal input. And we found that there will might be no log4j log and a waring on tomcat server "The visited object is null, VisitorValidator will not be able to handle validation properly. Please make sure the visited object is not null for VisitorValidator to function properly". It will be OK after we restart tomcat server. This issue can not be found every time. Could anyone give me some advice?
public void validate(Object object) throws ValidationException {
String fieldName = getFieldName();
String val = (String) getFieldValue(fieldName, object);
log.logInfo("Field:" + fieldName + " &Value:" + val);
if ((minLength > -1) && (val.length() < minLength))
else if ((maxLength > -1) && (val.length() > maxLength))
{ log.logError("Input validation max length checking failure:"+fieldName); addFieldError(fieldName, object); }