Uploaded image for project: 'BVal'
  1. BVal
  2. BVAL-97

More than one META-INF/validation.xml in tomcat webapp

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.3-incubating
    • 0.4
    • None
    • None
    • Tomcat 7.0.16 + OpenEJB 4.0.0-SNAPSHOT

    Description

      To be spec compliant bval check there is only one validation.xml in the classloader.

      However in tomcat WEB-INF/classes/META-INF/validation.xml is returned twice so it fails because of the following code in ValidationParser:

                 if ( path.equals("META-INF/validation.xml") ) {
                      Enumeration<URL> urls = loader.getResources(path);
                      if ( urls.hasMoreElements() && (urls.nextElement() != null) && urls.hasMoreElements() ) {
                          throw new ValidationException("More than one " + path + " is found in the classpath");
                      }
                  }
      

      To fix it urls should be check to see if they are all equals or loader.findResources(path) could be used instead of loader.getResources(path).

      Attachments

        Activity

          People

            romanstumm Roman Stumm
            romain.manni-bucau Romain Manni-Bucau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: