Re: Question about connecting to HBase


HadoopMarc <m.c.d...@...>
 

Hi Jerry,

What does your load() function/method look like?

Did you include the janusgraph-hbase dependency in your Intellij project?

Cheers,     Marc

Op vrijdag 21 april 2017 14:12:51 UTC+2 schreef Jerry:

Hi ,
Sorry for the repost!
I am new to the JanusGraph and  setup a JanusGraph database  on my cluster .The storage is HBase with Zookeeper as coordinator.

I try to run the GraphOfTheGodsFactory example from IntelliJ Idea. I configure the janusgraph-hbase.properties  as following:

storage.hostname=10.1.1.2,10.1.1.3,10.1.1.4
storage.port=2181

The IP addresses are zookeeper servers.
I run the following codes:

JanusGraph g = JanusGraphFactory.open("/janusgraph/conf/janusgraph-hbase.properties");
load(g);
I get the following error message:

 java.lang.ClassNotFoundException: org.apache.hadoop.hbase.MasterNotRunningException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

but I can connect to the Hbase in gremlin shell with the same conf file.
I know the error message is about the ClassNotFoundException but it seems the JanusGraphFactory cannot connect to Hbase and then reports the MasterNotRunningException after checking the source code 

public final static <T> T instantiate(String clazzname, Object[] constructorArgs, Class[] classes) {
Preconditions.checkArgument(constructorArgs!=null && classes!=null);
Preconditions.checkArgument(constructorArgs.length==classes.length);
try {
Class clazz = Class.forName(clazzname);
Constructor constructor = clazz.getConstructor(classes);
T instance = (T) constructor.newInstance(constructorArgs);
return instance;
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Could not find implementation class: " + clazzname, e);
} catch (NoSuchMethodException e) {
throw new IllegalArgumentException("Implementation class does not have required constructor: " + clazzname, e);
} catch (InstantiationException e) {
throw new IllegalArgumentException("Could not instantiate implementation: " + clazzname, e);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Could not instantiate implementation: " + clazzname, e);
} catch (InvocationTargetException e) {
throw new IllegalArgumentException("Could not instantiate implementation: " + clazzname, e);
} catch (ClassCastException e) {
throw new IllegalArgumentException("Could not instantiate implementation: " + clazzname, e);
}
}

I wonder if you have any suggestion on solving this problem? 
Thanks in advance!

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.