Terminal initialization failed ... Found class jline.Terminal, but interface was expected

35 views
Skip to first unread message

Rohit Jain

unread,
Sep 1, 2017, 4:02:51 PM9/1/17
to JanusGraph users
Hi folks,

I keep running into this problem.  I don't know how I got around it the last time but it has cropped up again.  Any ideas?

bin/gremlin.sh

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected

Rohit

Robert Dale

unread,
Sep 1, 2017, 4:11:53 PM9/1/17
to Rohit Jain, JanusGraph users
What OS, terminal are you using?  Are there other versions of jline in the classpath?

You can try setting `-Djline.terminal=none`

e.g. `export JAVA_OPTIONS="-Djline.terminal=none" ; ./bin/gremlin.sh`

Robert Dale

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/5a4cc0f9-a09a-4930-99cd-284e5c9c2e75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rohit Jain

unread,
Sep 1, 2017, 4:27:39 PM9/1/17
to JanusGraph users, rohit.ja...@gmail.com
Robert,

You are just so fast!

We are on Linux centos I think.  I tried setting it to none as you suggested, but I still got the same error. Here are the versions of jline installed on the system.

$ find . -name jline*

./crunch/lib/jline-2.10.4.jar

./hadoop-httpfs/webapps/webhdfs/WEB-INF/lib/jline-2.11.jar

./llama/lib/jline-2.11.jar

./sentry/lib/jline-2.11.jar

./hadoop-kms/webapps/kms/WEB-INF/lib/jline-2.11.jar

./hadoop-0.20-mapreduce/lib/jline-2.11.jar

./whirr/lib/jline-2.11.jar

./impala/lib/jline-2.12.jar

./zookeeper/lib/jline-2.11.jar

./hadoop-yarn/lib/jline-2.11.jar

./oozie/oozie-sharelib-yarn/lib/hive2/jline-2.11.jar

./oozie/oozie-sharelib-yarn/lib/sqoop/jline-2.11.jar

./oozie/oozie-sharelib-yarn/lib/hcatalog/jline-2.11.jar

./oozie/oozie-sharelib-yarn/lib/pig/jline-2.11.jar

./oozie/oozie-sharelib-yarn/lib/hive/jline-2.11.jar

./oozie/oozie-sharelib-yarn/lib/spark/jline-2.10.5.jar

./oozie/oozie-sharelib-yarn/lib/spark/jline-2.11.jar

./oozie/lib/jline-2.11.jar

./oozie/libserver/jline-2.11.jar

./oozie/oozie-sharelib-mr1/lib/hive2/jline-2.11.jar

./oozie/oozie-sharelib-mr1/lib/sqoop/jline-2.11.jar

./oozie/oozie-sharelib-mr1/lib/hcatalog/jline-2.11.jar

./oozie/oozie-sharelib-mr1/lib/pig/jline-2.11.jar

./oozie/oozie-sharelib-mr1/lib/hive/jline-2.11.jar

./oozie/oozie-sharelib-mr1/lib/spark/jline-2.10.5.jar

./oozie/oozie-sharelib-mr1/lib/spark/jline-2.11.jar

./oozie/libtools/jline-2.11.jar

./hive/lib/jline-2.12.jar


Robert Dale

unread,
Sep 1, 2017, 4:37:12 PM9/1/17
to Rohit Jain, JanusGraph users
You clearly have too many versions of jline.  JanusGraph uses 2.11, TinkerPop uses 2.12. Either should work fine but use just one.

Robert Dale

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.

Rohit Jain

unread,
Sep 1, 2017, 4:39:16 PM9/1/17
to JanusGraph users, rohit.ja...@gmail.com
Robert,

I am not a Linux expert either :-(  Do you know how I can find out what version of jline in my CLASSPATH I am picking up?

Rohit

Robert Dale

unread,
Sep 1, 2017, 4:46:47 PM9/1/17
to Rohit Jain, JanusGraph users

SCRIPT_DEBUG=y ./bin/gremlin.sh



Robert Dale

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.

Rohit Jain

unread,
Sep 1, 2017, 5:07:14 PM9/1/17
to JanusGraph users, rohit.ja...@gmail.com
Based on that, it looks like it finds the following in my CLASSPATH:
 
... /opt/cloudera/parcels/CDH/lib/hive/lib/jline-2.12.jar .../disk1/rohit/janusgraph-0.1.1-hadoop2/lib/jline-2.11.jar ...

Rohit
Message has been deleted

Rohit Jain

unread,
Sep 2, 2017, 7:23:35 AM9/2/17
to JanusGraph users
Here is what one of our developers found:
It looks like there are some incompatibilities in the interface for the class jline.Terminal between jline 2.11 and jline 2.12.

If the jline 2.12, part of Cloudera CDH Hive, is loaded, Gremlin will fail with the following error:



[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected

If the jline 2.11 version is loaded, Gremlin does not have a problem.

To work around the issue at this moment, here is what was done:
We changed gremlin.sh around line 43, to add the janusgraph/lib at the beginning of the current class path. It is likely, that the only library needed to be in front was jline. But we added them all to the front, so they get preference over any of the current jars and classes.

#WORKAROUND....PUT LIB in front of classpath
#export CLASSPATH="${CLASSPATH:-}:$CP"
export CLASSPATH="$CP:${CLASSPATH:-}"

This indicates that perhaps Gremlin / Tinkerpop, as included with JanusGraph, may not be compatible with jline 2.12 after all.

Robert Dale

unread,
Sep 2, 2017, 8:07:40 AM9/2/17
to Rohit Jain, JanusGraph users
Titan/JanusGraph has been using 2.11 and TinkerPop has been using 2.12 for the last 2 years or so.  JanusGraph overrides TinkerPop's version. There is only one copy of jline in either TinkerPop or JanusGraph distributions.

In jline, the interface change was from 1.x to 2.x.  I would suspect that jline 1.x  is somewhrere in your classpath.  A quick search leads to some stackoverflow answers that point to the HADOOP classpath.

However, if you believe that this is a bug in either JanusGraph, TinkerPop, please provide the steps to reproduce with a clean distribution and without manipulating the classpath.  In the meantime, I have created an issue to update JanusGraph to the TinkerPop version - https://github.com/JanusGraph/janusgraph/pull/491




Robert Dale

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages