Search code examples
hadoophipi

Hadoop HiPi - hibImport NoClassDefFoundError


I'm using Hadoop 2.9.1 and the latest HiPi from Github. It's running on an Ubuntu 18.04.3 with OpenJDK 10.

The installation was successful and I tried to run the example from HiPi. After downloading a set of images I tried to convert it into HipiImageBundle. The following result is:

hadoop@master:~/workspace/hipi$ tools/hibImport.sh ~/workspace/SampleImages ~/workspace/SampleImages/sampleimages.hib
Input image directory: /home/hadoop/workspace/SampleImages
Input FS: local FS
Output HIB: /home/hadoop/workspace/SampleImages/sampleimages.hib
Overwrite HIB if it exists: false
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.hadoop.security.authentication.util.KerberosUtil (file:/opt/hadoop/share/hadoop/common/lib/hadoop-auth-2.9.1.jar) to method sun.security.krb5.Config.getInstance()
WARNING: Please consider reporting this to the maintainers of org.apache.hadoop.security.authentication.util.KerberosUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.NoClassDefFoundError: org/hipi/imagebundle/HipiImageBundle
        at org.hipi.tools.HibImport.main(HibImport.java:124)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:239)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:153)
Caused by: java.lang.ClassNotFoundException: org.hipi.imagebundle.HipiImageBundle
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        ... 7 more

Solution

  • Problem solved. There is a bug in Hipi.

    In tools/build.gradle there is the wrong line commented out:

    hadoop@master:/opt/hipi/tools$ cat build.gradle 
    subprojects {
    
      dependencies {
        compile project(':core')
      }
    
      jar {
        manifest {
          # Uncomment this line
          attributes("Class-Path" : configurations.runtime.collect { it.getAbsolutePath() }.join(' '));
          # Comment this line out
      //    attributes("Class-Path" : configurations.runtime.collect { it.toURI() }.join(' '));
        }
      }
    }
    

    A second problem were problem with corrupted images. When you load them you'll get a NullPointerException.