lum-ai / odinson

Odinson is a powerful and highly optimized open-source framework for rule-based information extraction. Odinson couples a simple, yet powerful pattern language that can operate over multiple representations of text, with a runtime system that operates in near real time.
https://lum.ai/odinson/docs/
Apache License 2.0
65 stars 23 forks source link

Getting error in running the walkthrough example #365

Closed amirj closed 2 years ago

amirj commented 2 years ago

I compiled the project successfully, create a text file in pets/text/text_1.txt and set the following path in extra/src/main/resources/application.conf: odinson.dataDir = "data/pets"

Getting the following error by running sbt "extra/runMain ai.lum.odinson.extra.AnnotateText":

$ sbt "extra/runMain ai.lum.odinson.extra.AnnotateText"
[info] welcome to sbt 1.6.0-RC1 (Homebrew Java 17.0.1)
[info] loading settings for project odinson-build from plugins.sbt ...
[info] loading project definition from /Users/amir/codes/odinson/project
[info] loading settings for project core from build.sbt ...
[info] loading settings for project extra from build.sbt ...
[info] loading settings for project odinson from build.sbt,version.sbt ...
[info] set current project to odinson (in build file:/Users/amir/codes/odinson/)
[warn] there's a key that's not used by any other settings/tasks:
[warn]  
[warn] * ThisBuild / publishMavenStyle
[warn]   +- /Users/amir/codes/odinson/build.sbt:101
[warn]  
[warn] note: a setting might still be used by a command; to exclude a key from this `lintUnused` check
[warn] either append it to `Global / excludeLintKeys` or call .withRank(KeyRanks.Invisible) on the key
[info] compiling 1 Scala source to /Users/amir/codes/odinson/core/target/scala-2.12/classes ...
[info] running (fork) ai.lum.odinson.extra.AnnotateText 
[info] 00:15:44,963 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
[info] 00:15:44,964 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
[info] 00:15:44,964 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/Users/amir/codes/odinson/target/bg-jobs/sbt_25681715/target/27a539a2/3dacd604/odinson-core_2.12-0.6.1-SNAPSHOT.jar!/logback.xml]
[info] 00:15:44,970 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@3e6ef8ad - URL [jar:file:/Users/amir/codes/odinson/target/bg-jobs/sbt_25681715/target/27a539a2/3dacd604/odinson-core_2.12-0.6.1-SNAPSHOT.jar!/logback.xml] is not of type file
[info] 00:15:45,033 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
[info] 00:15:45,033 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
[info] 00:15:45,040 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
[info] 00:15:45,075 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This appender no longer admits a layout as a sub-component, set an encoder instead.
[info] 00:15:45,075 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
[info] 00:15:45,075 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
[info] 00:15:45,076 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [ai.lum.odinson] to DEBUG
[info] 00:15:45,076 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [ai.lum.odinson] to false
[info] 00:15:45,076 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ai.lum.odinson]
[info] 00:15:45,076 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
[info] 00:15:45,076 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
[info] 00:15:45,076 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
[info] 00:15:45,077 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@346d61be - Registering current configuration as safe fallback point
[error] [dynet] Loading DyNet from /var/folders/v8/2rty_t2j183cnqb_5jb2sv5h0000gn/T/libdynet_swig-12164325284604239160.jnilib...
[error] [dynet] random seed: 2522620396
[error] [dynet] allocating memory: 512MB
[error] [dynet] memory allocation done.
[error] Exception in thread "main" java.lang.ExceptionInInitializerError
[error]     at org.clulab.processors.clu.GivenConstEmbeddingsAttachment$.mkConstEmbeddings(CluProcessor.scala:829)
[error]     at org.clulab.processors.clu.GivenConstEmbeddingsAttachment.before(CluProcessor.scala:809)
[error]     at org.clulab.utils.BeforeAndAfter.perform(BeforeAndAfter.scala:8)
[error]     at org.clulab.utils.BeforeAndAfter.perform$(BeforeAndAfter.scala:7)
[error]     at org.clulab.processors.clu.GivenConstEmbeddingsAttachment.perform(CluProcessor.scala:807)
[error]     at org.clulab.processors.clu.CluProcessor.annotate(CluProcessor.scala:164)
[error]     at org.clulab.processors.Processor.annotate(Processor.scala:65)
[error]     at org.clulab.processors.Processor.annotate$(Processor.scala:62)
[error]     at org.clulab.processors.clu.CluProcessor.annotate(CluProcessor.scala:26)
[error]     at ai.lum.odinson.extra.AnnotateText$.delayedEndpoint$ai$lum$odinson$extra$AnnotateText$1(AnnotateText.scala:57)
[error]     at ai.lum.odinson.extra.AnnotateText$delayedInit$body.apply(AnnotateText.scala:17)
[error]     at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error]     at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error]     at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error]     at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error]     at scala.collection.immutable.List.foreach(List.scala:392)
[error]     at scala.App.main(App.scala:80)
[error]     at scala.App.main$(App.scala:78)
[error]     at ai.lum.odinson.extra.AnnotateText$.main(AnnotateText.scala:17)
[error]     at ai.lum.odinson.extra.AnnotateText.main(AnnotateText.scala)
[error] Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make public void sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream.close() throws java.io.IOException accessible: module java.base does not "opens sun.net.www.protocol.jar" to unnamed module @30cb5b99
[error]     at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
[error]     at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
[error]     at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
[error]     at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
[error]     at scala.reflect.package$.ensureAccessible(package.scala:65)
[error]     at scala.runtime.ScalaRunTime$.ensureAccessible(ScalaRunTime.scala:144)
[error]     at org.clulab.utils.Closer$.reflMethod$Method2(Closer.scala:28)
[error]     at org.clulab.utils.Closer$.$anonfun$autoClose$1(Closer.scala:28)
[error]     at scala.Option.flatMap(Option.scala:271)
[error]     at org.clulab.utils.Closer$.autoClose(Closer.scala:26)
[error]     at org.clulab.utils.Closer$AutoCloser.autoClose(Closer.scala:60)
[error]     at org.clulab.embeddings.WordEmbeddingMapPool$.loadEmbedding(WordEmbeddingMapPool.scala:72)
[error]     at org.clulab.embeddings.WordEmbeddingMapPool$.$anonfun$getOrElseCreate$2(WordEmbeddingMapPool.scala:44)
[error]     at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
[error]     at scala.util.Success.$anonfun$map$1(Try.scala:255)
[error]     at scala.util.Success.map(Try.scala:213)
[error]     at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
[error]     at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
[error]     at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
[error]     at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error]     at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
[error]     at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
[error]     at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
[error]     at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
[error]     at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
[error]     at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
[error] Nonzero exit code returned from runner: 1
[error] (extra / Compile / runMain) Nonzero exit code returned from runner: 1
[error] Total time: 19 s, completed 17 Jan 2022, 00:15:47

Do I need to install any third-party packages or if I missed something above?

Thanks.

kwalcock commented 2 years ago

This looks slightly familiar, but I can't try it out until tomorrow. Someone has noticed your message, though.

kwalcock commented 2 years ago

I'm not getting the same (or any) error. However, I'm also using Java 1.8 and not 17 and the difference is quite a stretch. https://gh.lum.ai/odinson/installation.html mentions that testing is done on 1.8. I see some reflection methods in the stack and it's a library dependency that is causing the problem. I suspect that an object is being deserialized that is not compatible with the newer version of Java. So far, I have not seen anyone use Java 17 successfully and that may be why the error looks familiar.

myedibleenso commented 2 years ago

I know 11 works as well, but I haven't tried with newer versions. @kwalcock , we might want to add that to our CI process (see https://github.com/actions/setup-java#testing-against-different-java-versions).

myedibleenso commented 2 years ago

I can confirm that extra doesn't work with Java 17: https://github.com/lum-ai/odinson/runs/4876015292?check_suite_focus=true

amirj commented 2 years ago

Downgrade to sbt 1.6.0-RC1 (Homebrew Java 1.8.0_312) solved the problem. Thanks a lot.