'circunstances for a Couldn't load manifest attributes exception

I am asking to you for this code from hive-jdbc is failing to me:

private static synchronized void loadManifestAttributes() throws IOException {
    if (manifestAttributes != null) {
      return;
    }
    Class<?> clazz = HiveDriver.class;
    String classContainer = clazz.getProtectionDomain().getCodeSource()
        .getLocation().toString();
    URL manifestUrl = new URL("jar:" + classContainer
        + "!/META-INF/MANIFEST.MF");
    Manifest manifest = new Manifest(manifestUrl.openStream());
    manifestAttributes = manifest.getMainAttributes();
  }

It seems the manifest for the jar is not being accesed correctly.. I wonder under what circunstances this can happen.. I assume this jar file has to have a manifest file since is a driver package. hive-jdbc classes are being loaded so I assume the classContainer is correct.. so How is possible the manifest is failing to be loaded?

Best Regard

Rob



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source