dair-iitd / OpenIE-standalone

Other
565 stars 73 forks source link

Error running tests on creating stand-alone jar #42

Closed exelents closed 4 years ago

exelents commented 4 years ago

I'm trying "sbt -J-Xmx10000M clean compile assembly", but it seems, some tests going incorrectly. What can I do?

[info] - should instantiate and extract correctly *** FAILED ***
[info]   java.lang.IllegalArgumentException: Could not load relation_filter.txt
[info]   at edu.knowitall.srlie.SrlExtractor$$anonfun$1.apply(SrlExtractor.scala:23)
[info]   at edu.knowitall.srlie.SrlExtractor$$anonfun$1.apply(SrlExtractor.scala:23)
[info]   at scala.Option.getOrElse(Option.scala:120)
[info]   at edu.knowitall.srlie.SrlExtractor.<init>(SrlExtractor.scala:22)
[info]   at edu.knowitall.openie.OpenIE.<init>(OpenIE.scala:42)
[info]   at edu.knowitall.openie.OpenIESpecTest$$anonfun$1.apply$mcV$sp(OpenIESpecTest.scala:13)
[info]   at edu.knowitall.openie.OpenIESpecTest$$anonfun$1.apply(OpenIESpecTest.scala:12)
[info]   at edu.knowitall.openie.OpenIESpecTest$$anonfun$1.apply(OpenIESpecTest.scala:12)
[info]   at org.scalatest.Transformer$$anonfun$apply$1.apply(Transformer.scala:22)
[info]   at org.scalatest.Transformer$$anonfun$apply$1.apply(Transformer.scala:22)
[info]   ...
[info] Run completed in 20 seconds, 573 milliseconds.
[info] Total number of tests run: 1
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 0, failed 1, canceled 0, ignored 0, pending 0
[info] *** 1 TEST FAILED ***
[error] Failed tests:
[error]     edu.knowitall.openie.OpenIESpecTest
[info] Including: ListExtractor.jar
[error] (Test / test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 35 s, completed 15.02.2020 15:47:24
exelents commented 4 years ago

I have solved a problem. In file SrlExtractor.scala you assigned a package name: package edu.knowitall.srlie So function getResource tried to find resource file in this package resource path. File relation_filter.txt should be located in OpenIE-standalone/srlie/src/main/resources/edu/knowitall/srlie/. Now it located in the root of resources folder and after compilation - in root of the jar file. It can cause an error, described in this issue.