Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrientDB 2.0.1 fails to start on Linux using OpenJDK 6 (IcedTea) #3501

Closed
DanielRuthardt opened this issue Jan 30, 2015 · 23 comments
Closed
Assignees
Milestone

Comments

@DanielRuthardt
Copy link
Contributor

This issue applies to the vanilla package, downloaded, extracted and started without touching anything.
There seems to be some kind of class loading issue.
OrientDB starts normally when switching to e.g. Oracle JDK 7.

2015-01-30 12:00:43:102 WARNING Cannot find default script language for javascript [OScriptManager]
2015-01-30 12:00:43:141 WARNING No enough physical memory available for DISKCACHE: 1,989MB (heap=455MB). Set lower Maximum Heap (-Xmx setting on JVM) and restart OrientDB. Now running with DISKCACHE=256MB [orientechnologies]
2015-01-30 12:00:43:145 INFO  Loading configuration from: /usr/local/orientdb/orientdb-community-2.0.1/config/orientdb-server-config.xml... [OServerConfigurationLoaderXml]
2015-01-30 12:00:43:377 INFO  OrientDB Server v2.0.1 (build UNKNOWN@r; 2015-01-28 18:33:00+0000) is starting up... [OServer]
2015-01-30 12:00:43:398 INFO  Databases directory: /usr/local/orientdb/orientdb-community-2.0.1/databases [OServer]
2015-01-30 12:00:43:429 INFO  Listening binary connections on 0.0.0.0:2424 (protocol v.28, socket=default) [OServerNetworkListener]
2015-01-30 12:00:43:430 INFO  Listening http connections on 0.0.0.0:2480 (protocol v.10, socket=default) [OServerNetworkListener]
2015-01-30 12:00:43:444 INFO  Installing dynamic plugin 'studio-2.0.zip'... [OServerPluginManager]Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal
    at com.orientechnologies.orient.core.record.impl.ODocument.setup(ODocument.java:2201)
    at com.orientechnologies.orient.core.record.impl.ODocument.<init>(ODocument.java:107)
    at com.orientechnologies.orient.server.plugin.OServerPluginManager.installDynamicPlugin(OServerPluginManager.java:323)
    at com.orientechnologies.orient.server.plugin.OServerPluginManager.updatePlugin(OServerPluginManager.java:194)
    at com.orientechnologies.orient.server.plugin.OServerPluginManager.updatePlugins(OServerPluginManager.java:283)
    at com.orientechnologies.orient.server.plugin.OServerPluginManager.startup(OServerPluginManager.java:85)
    at com.orientechnologies.orient.server.OServer.registerPlugins(OServer.java:831)
    at com.orientechnologies.orient.server.OServer.activate(OServer.java:265)
    at com.orientechnologies.orient.server.OServerMain.main(OServerMain.java:41)
@zanerock
Copy link

I'm having the same problem with OrientDB 2.0. Have tried icedtea7 and openjdk 7

@DanielRuthardt
Copy link
Contributor Author

So it seems to be an issue with IcedTea / OpenJDK.
I won't have time until the end of next week, but I am curious to see what happens when trying any of the other 1.6 JDKs like Diablo JDK, HP's or IBM's. Basically whatever JDK my Linux box allows me to install without too much work :-)

@tglman
Copy link
Member

tglman commented Jan 31, 2015

Hi all,
this error is happened also to me in some corner case, i already know what cause this, i've to investigate a bit more to get a working fix, but is all aobut move the ODatabaseRecordThreadLocal static inizialization somewhere else.

@zanerock
Copy link

Thanks. FYI, 2.0-RC1 was working for me with mostly the same setup. At least, both were using OpenJDK (1.7.0-u65, 64 bit). I say mostly the same because it was two different VM builds and the system packages weren't quite the same. (Which is all probably irrelevant, but there you go.)

In any case, the problem appeared for me between 2.0-RC1 and 2.0.

@evgeny-konovalov
Copy link

Same problem with orientdb 2.0.2 and 2.0.5

openjdk version "1.7.0-internal"
OpenJDK Runtime Environment (build 1.7.0-internal-b56)
OpenJDK Server VM (build 24.0-b56, mixed mode)

@bra-fsn
Copy link

bra-fsn commented Mar 24, 2015

Same:

2015-03-24 10:24:01:671 WARNING Cannot find default script language for javascript [OScriptManager]
2015-03-24 10:24:01:726 INFO  OrientDB auto-config DISKCACHE=5,622MB (heap=494MB os=8,165MB disk=12,832MB) [orientechnologies]
2015-03-24 10:24:01:730 INFO  Loading configuration from: /usr/home/orientdb/orientdb-community-2.0.5/config/orientdb-server-config.xml... [OServerConfigurationLoaderXml]
2015-03-24 10:24:02:017 INFO  OrientDB Server v2.0.5 (build UNKNOWN@r; 2015-03-12 22:59:10+0000) is starting up... [OServer]
2015-03-24 10:24:02:036 INFO  Databases directory: /usr/home/orientdb/orientdb-community-2.0.5/databases [OServer]
2015-03-24 10:24:02:063 INFO  Listening binary connections on 0.0.0.0:2424 (protocol v.28, socket=default) [OServerNetworkListener]
2015-03-24 10:24:02:065 INFO  Listening http connections on 0.0.0.0:2480 (protocol v.10, socket=default) [OServerNetworkListener]
2015-03-24 10:24:02:078 INFO  Installing dynamic plugin 'studio-2.0.zip'... [OServerPluginManager]Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal
        at com.orientechnologies.orient.core.record.impl.ODocument.setup(ODocument.java:2199)
        at com.orientechnologies.orient.core.record.impl.ODocument.<init>(ODocument.java:107)
        at com.orientechnologies.orient.server.plugin.OServerPluginManager.installDynamicPlugin(OServerPluginManager.java:323)
        at com.orientechnologies.orient.server.plugin.OServerPluginManager.updatePlugin(OServerPluginManager.java:194)
        at com.orientechnologies.orient.server.plugin.OServerPluginManager.updatePlugins(OServerPluginManager.java:283)
        at com.orientechnologies.orient.server.plugin.OServerPluginManager.startup(OServerPluginManager.java:85)
        at com.orientechnologies.orient.server.OServer.registerPlugins(OServer.java:831)
        at com.orientechnologies.orient.server.OServer.activate(OServer.java:265)
        at com.orientechnologies.orient.server.OServerMain.main(OServerMain.java:41)
^C

here on FreeBSD with:

openjdk version "1.6.0_32"
OpenJDK Runtime Environment (build 1.6.0_32-b34)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)

and

openjdk version "1.7.0_76"
OpenJDK Runtime Environment (build 1.7.0_76-b13)
OpenJDK 64-Bit Server VM (build 24.76-b04, mixed mode)

while it starts with:

openjdk version "1.8.0_40"
OpenJDK Runtime Environment (build 1.8.0_40-b25)
OpenJDK 64-Bit Server VM (build 25.40-b25, mixed mode)

@lvca lvca added the bug label Mar 25, 2015
@lvca
Copy link
Member

lvca commented Mar 25, 2015

@tglman do you know why?

@DanielRuthardt
Copy link
Contributor Author

Unfortunately I wasn't able to test any other JDKs, as all the other (mostly 1.6.x) JDKs fail to install on the Linux box I wanted to test it on.

@kitaeff
Copy link

kitaeff commented Mar 29, 2015

Version 2.0.5 worked on Oracle's JDK without any problem, but startup on OpenJDK failed with the same exception. We analyzed database sources and found cyclic dependency in startup process:

  1. Orient class has static field OScriptManager scriptManager which is set to new instance in field initializer.
  2. OScriptManager constructor checks supported script engines. If engine for JavaScript is not found it calls OLogManager to warn about it.
  3. OLogManager calls ODatabaseRecordThreadLocal to get name of current working db (if any)
  4. ODatabaseRecordThreadLocal static initializer accesses Orient static field instance which value is not yet exposed to other classes because of initialization in progress. Static initializer fails with NullPointerException.
  5. JVM is unable to load class with failing intializer and throws NoClassDefFoundError hiding source NPE.

Oracle's JDK has required script engine and database starts up without problem, OpenJDK does not (except builds in some distributions). For our project we worked around by making (temporarily) own custom OrientDB build with warning commented out.

@tglman
Copy link
Member

tglman commented Mar 30, 2015

hi, i add a check for avoid that nullpointer, if this check fail it can happen some small amount of memory retention, but should be fine in general, and anyway is better than not be able to start the server.

I'm closing it, is fixed in 2.1, reopen it if you need backport to 2.0.x

@tglman tglman closed this as completed Mar 30, 2015
@lvca
Copy link
Member

lvca commented Mar 30, 2015

Hey guys, can you confirm this has been fixed?

@lvca lvca modified the milestones: 2.1, 2.0.6 Mar 30, 2015
@lvca
Copy link
Member

lvca commented Mar 30, 2015

@tglman could you backport also to 2.0.6 please?

@DanielRuthardt
Copy link
Contributor Author

This issue still exists for OrientDB 2.1.0 and the following JDKs:
Oracle JDK 1.8.0_51
Icedtea JDK 1.7.0_79

So using a newer JDK doesn't seem to help this time.

@DanielRuthardt
Copy link
Contributor Author

What might be a difference (unable to check, the previous setup doesn't exist anymore) this time, is that the server is up and running and can be accessed using the console, just the plugins won't start, so the web interface can't be used.

@smolinari
Copy link
Contributor

In a try to workaround this issue,

#4840

I installed ODB using the downloadable package from the OrientDB website. However, I am also running into this exact problem too. I can't run the application as a service and when I start in a console, it works and I can call up the ODB console, but I can't access the database anyway else.

I am running with

OpenJDK Runtime Environment (IcedTea6 1.13.8) (6b36-1.13.8-1~deb7u1)

I am going to try and upgrade OpenJDK to see what happens.

Scott

@pokluda
Copy link

pokluda commented Mar 9, 2016

fork = true
in ant might help (https://ant.apache.org/manual/Tasks/java.html).

@smolinari
Copy link
Contributor

@pokluda ODB has moved to Maven.

Scott

@robbiesmith
Copy link

I have seen this (or something closely related) on Windows, with OrientDB version 2.1.14 and JVM 1.8.0_77 (Oracle).

For details see http://stackoverflow.com/questions/36345804/noclassdeffounderror-when-starting-orientdb

@turbogeek
Copy link

Having similar issue. I am attempting to run via a Groovy script. When I run a client script in its won instance via a run in both Eclipse and Netbeans, no issues. But when I run from a Java application running Groovy (i.e. an application supporting embedded groovy scripts), I get the error. I am using orientdb-community-2.1.11.

@jCalamari
Copy link

jCalamari commented May 17, 2016

I was able to trace down this issue. In my case, OScriptManager:85 was looking up javascript enginee (which seems to be default) and it could not find it. In OScriptManager:87 logs a warning which at some point calls ODatabaseRecordThreadLocal:31:

final Orient inst = Orient.instance();
however inst is null here and now things start to get messy.. I simply disabled warning level: OLogManager.instance().setWarnEnabled(false) and application started up.

@lvca
Copy link
Member

lvca commented May 17, 2016

@jCalamari why OrientDB instance is null in your case? How your app is started?

@jCalamari
Copy link

@lvca I was very surprised it was null. I am running gremlin-orient 3.1.1-incubating.1 (orient 2.12.2) as service in docker container.

@jCalamari
Copy link

Pretty much the same is described here:
#5855

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests