Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3365

There will be no log4j error message while it displays warning "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"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.1.2
    • None
    • Core Interceptors
    • 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))

      { addFieldError(fieldName, object); }

      else if ((maxLength > -1) && (val.length() > maxLength))

      { log.logError("Input validation max length checking failure:"+fieldName); addFieldError(fieldName, object); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            jession jession ji
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: