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 fails to load on AIX because javascript script engine is missing #5855

Closed
zerovian opened this issue Mar 18, 2016 · 3 comments
Closed
Assignees
Labels

Comments

@zerovian
Copy link

When orientdb loads it tries to load the javascript script engine in OScriptManager static block. If the 'javascript' script is not present, Orientdb generates a warning by calling OLogManager.warn(...). This is normally fine, except this happens during the static block initialization call in Orient class.

The OLogManager tries to access ODatabaseRecordThreadLocal which hasn't initialized yet so this creates a circular dependency on partially initialized static objects which then generates NullPointerException since Orient class hasn't finally initialized. Below is stack just before the NPE.

OLogManager should NEVER have a circular dependency on Orient class (via ODatabaseRecordThreadLocal) because it might not have been initialized yet.

All of this is because AIX doesn't ship with the 'javascript' script engine.

Thread [Plug-in of type: com.progress.isq.ipqos.plugin.FathomPlugIn](Class load: ODatabaseRecordThreadLocal)
owns: Class (com.progress.isq.ipqos.Probe) (id=1904)
owns: FathomPlugIn (id=1860)
J9VMInternals.prepare(Class) line: 535
J9VMInternals.initialize(Class) line: 174
OLogManager.log(Object, Level, String, Throwable, Object...) line: 98
OLogManager.warn(Object, String, Object...) line: 187
OScriptManager.() line: 87
Orient.() line: 72
Orient.() line: 63

@zerovian zerovian changed the title orientdb 2.1.12 fails to load on AIX fails javascript script engine is missing orientdb fails to load on AIX because javascript script engine is missing Mar 18, 2016
@zerovian
Copy link
Author

Found a workaround:

If I disable warnings in OLogManager before artificially loading Orient class, then it avoids the circular static initialization.

    OLogManager.instance().setWarnEnabled(false);
    Orient.instance();      
    OLogManager.instance().setWarnEnabled(true);

@zerovian
Copy link
Author

No
On May 25, 2016 7:24 AM, "jCalamari" notifications@github.com wrote:

Is there any other workaround than disabling warnings?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#5855 (comment)

@robfrank robfrank modified the milestones: 2.2.1, 2.2.x (next hotfix) Jun 8, 2016
ancho added a commit to ancho/jbake that referenced this issue Oct 1, 2017
ancho added a commit to ancho/jbake that referenced this issue Oct 2, 2017
@ancho
Copy link

ancho commented Oct 2, 2017

Same problem with zulu openjdk bundle. Using orientdb 2.2.28.

java -version                                                                                                                                                                                                
openjdk version "1.7.0_154"
OpenJDK Runtime Environment (Zulu 7.20.0.3-linux64) (build 1.7.0_154-b01)
OpenJDK 64-Bit Server VM (Zulu 7.20.0.3-linux64) (build 24.154-b01, mixed mode)
+--- com.orientechnologies:orientdb-graphdb:2.2.28
|    +--- com.orientechnologies:orientdb-server:2.2.28
|    |    +--- com.orientechnologies:orientdb-client:2.2.28
|    |    |    \--- com.orientechnologies:orientdb-core:2.2.28
|    |    |         +--- org.xerial.snappy:snappy-java:1.1.0.1
|    |    |         \--- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.1 -> 1.4.2
|    |    +--- com.orientechnologies:orientdb-tools:2.2.28
|    |    |    +--- com.orientechnologies:orientdb-client:2.2.28 (*)
|    |    |    +--- com.orientechnologies:orientdb-core:2.2.28 (*)
|    |    |    \--- com.fasterxml.jackson.core:jackson-databind:2.6.0
|    |    |         +--- com.fasterxml.jackson.core:jackson-annotations:2.6.0
|    |    |         \--- com.fasterxml.jackson.core:jackson-core:2.6.0
|    |    +--- javax.mail:mail:1.4.7
|    |    |    \--- javax.activation:activation:1.1
|    |    \--- com.sun.xml.bind:jaxb-impl:2.2.3
|    |         \--- javax.xml.bind:jaxb-api:2.2.2
|    |              +--- javax.xml.stream:stax-api:1.0-2
|    |              \--- javax.activation:activation:1.1
|    +--- com.orientechnologies:orientdb-tools:2.2.28 (*)
|    +--- com.orientechnologies:orientdb-core:2.2.28 (*)
|    +--- commons-collections:commons-collections:3.2.2
|    \--- com.tinkerpop.blueprints:blueprints-core:2.6.0
|         +--- org.codehaus.jettison:jettison:1.3.3
|         |    \--- stax:stax-api:1.0.1
|         +--- com.fasterxml.jackson.core:jackson-databind:2.2.3 -> 2.6.0 (*)
|         +--- com.carrotsearch:hppc:0.6.0
|         +--- commons-configuration:commons-configuration:1.6 -> 1.10 (*)
|         \--- commons-logging:commons-logging:1.1.1 -> 1.2

Here is the output from one failing test:

13:47:30.442 [DEBUG] [TestEventLogger]     Oct 02, 2017 1:47:30 PM com.orientechnologies.common.log.OLogManager log
13:47:30.444 [DEBUG] [TestEventLogger]     WARNING: Cannot find default script language for javascript
13:47:30.811 [DEBUG] [TestEventLogger] 
13:47:30.811 [DEBUG] [TestEventLogger] org.jbake.app.ContentStoreTest > shouldGetCountForPublishedDocuments FAILED
13:47:30.813 [DEBUG] [TestEventLogger]     java.lang.NoClassDefFoundError: Could not initialize class com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal
13:47:30.813 [DEBUG] [TestEventLogger]         at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.activateOnCurrentThread(ODatabaseDocumentTx.java:3150)
13:47:30.814 [DEBUG] [TestEventLogger]         at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.<init>(ODatabaseDocumentTx.java:162)
13:47:30.814 [DEBUG] [TestEventLogger]         at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.<init>(ODatabaseDocumentTx.java:153)
13:47:30.814 [DEBUG] [TestEventLogger]         at org.jbake.app.ContentStore.<init>(ContentStore.java:61)
13:47:30.814 [DEBUG] [TestEventLogger]         at org.jbake.app.DBUtil.createDataStore(DBUtil.java:15)
13:47:30.814 [DEBUG] [TestEventLogger]         at org.jbake.app.ContentStoreTest.setUp(ContentStoreTest.java:16)
13:47:30.814 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:47:30.814 [DEBUG] [TestEventLogger]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
13:47:30.814 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:47:30.814 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:606)
13:47:30.814 [DEBUG] [TestEventLogger]         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
13:47:30.814 [DEBUG] [TestEventLogger]         at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
13:47:30.814 [DEBUG] [TestEventLogger]         at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
13:47:30.814 [DEBUG] [TestEventLogger]         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
13:47:30.814 [DEBUG] [TestEventLogger]         at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
13:47:30.814 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
13:47:30.814 [DEBUG] [TestEventLogger]         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
13:47:30.814 [DEBUG] [TestEventLogger]         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:114)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
13:47:30.815 [DEBUG] [TestEventLogger]         at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
13:47:30.815 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:47:30.815 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:606)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
13:47:30.815 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
13:47:30.815 [DEBUG] [TestEventLogger]         at com.sun.proxy.$Proxy3.processTestClass(Unknown Source)
13:47:30.816 [DEBUG] [TestEventLogger]         at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
13:47:30.816 [DEBUG] [TestEventLogger]         at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
13:47:30.816 [DEBUG] [TestEventLogger]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:47:30.816 [DEBUG] [TestEventLogger]         at java.lang.reflect.Method.invoke(Method.java:606)
13:47:30.816 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
13:47:30.816 [DEBUG] [TestEventLogger]         at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
13:47:30.816 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:146)
13:47:30.816 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:128)
13:47:30.816 [DEBUG] [TestEventLogger]         at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
13:47:30.816 [DEBUG] [TestEventLogger]         at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
13:47:30.816 [DEBUG] [TestEventLogger]         at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
13:47:30.816 [DEBUG] [TestEventLogger]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
13:47:30.816 [DEBUG] [TestEventLogger]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
13:47:30.816 [DEBUG] [TestEventLogger]         at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
13:47:30.816 [DEBUG] [TestEventLogger]         at java.lang.Thread.run(Thread.java:748)

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

No branches or pull requests

5 participants