Support Questions

Find answers, ask questions, and share your expertise

Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: com/tinkerpop/blueprints/Graph

avatar
Explorer

Hi All,

While trying to take Atlas metadata Backup in HDP 3.1.0.0.0-78 using CLI getting below error,

 

Followed this official link: https://docs.cloudera.com/HDPDocuments/HDP3/HDP-3.1.5/installing-atlas/content/grate_atlas_metadata_...

 

atlas@xxxx-0x00x00xx:~$ python /usr/hdp/3.1.0.0-78/atlas/tools/migration-exporter/atlas_migration_export.py -d /atlas_metadata

 

Using Java version: 1.8.0_232 and Python 2.7.5

 

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: com/tinkerpop/blueprints/Graph
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: com.tinkerpop.blueprints.Graph
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 7 more

 

Please help me on this issue,

 

Thanks in advance

1 REPLY 1

avatar
Expert Contributor

Hi @ManjuN ,

 

NoClassDefFoundError Is usually seen when required jar is missing. In this case atlas migration script is looking for a jar which contains class "com/tinkerpop/blueprints/Graph". This class definition is available in blueprints-core-2.6.0.jar which is available on HDP-2.6.x.

 

 

# jar -tf /usr/hdp/2.6.<version>/atlas/server/webapp/atlas/WEB-INF/lib/blueprints-core-2.6.0.jar | grep -i "com/tinkerpop/blueprints/Graph"
com/tinkerpop/blueprints/Graph.class
com/tinkerpop/blueprints/GraphFactory.class
com/tinkerpop/blueprints/GraphQuery.class

 

 

 

In your case, you are running a migration script from "3.1.0.0-78" directory and that is the reason you are getting NoClassDefFoundError.

 

 

python /usr/hdp/3.1.0.0-78/atlas/tools/migration-exporter/atlas_migration_export.py -d /atlas_metadata

 

 

 

Steps in the document needs to be performed only if you are upgrading your cluster from 2.6.x to 3.0+ version, because In HDP-3.0+, Apache Atlas uses the JanusGraph graph database to store metadata objects whereas in earlier versions, Atlas used the Titan graph database for metadata storage.

 

The document says, "Before upgrading HDP and Atlas, perform the following steps on the HDP-2.x cluster".

 

If you are performing this step during a major upgrade (from HDP-2.6.x to HDP3.0+ or 2.6.5 to HDP-7.x), kindly run atlas_migration_export.py script from 2.6.x path. For minor versions, this step is not required.