gpt4 book ai didi

java - 编译 Play 框架测试时出现错误 "scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found"

转载 作者:行者123 更新时间:2023-12-02 08:23:46 25 4
gpt4 key购买 nike

对系统上的每个 Play 项目执行“Play 干净测试”时,我收到此错误:

[info] Compiling 9 Scala sources and 302 Java sources to $HOME/Workspace/sis/target/scala-2.10/test-classes...[error] error while loading , error in opening zip filescala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found.    at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:16)    at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:17)    at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:48)    at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:40)    at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:61)    at scala.reflect.internal.Mirrors$RootsBase.getPackage(Mirrors.scala:172)    at scala.reflect.internal.Mirrors$RootsBase.getRequiredPackage(Mirrors.scala:175)    at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackage$lzycompute(Definitions.scala:181)    at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackage(Definitions.scala:181)    at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackageClass$lzycompute(Definitions.scala:182)    at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackageClass(Definitions.scala:182)    at scala.reflect.internal.Definitions$DefinitionsClass.AnnotationDefaultAttr$lzycompute(Definitions.scala:997)    at scala.reflect.internal.Definitions$DefinitionsClass.AnnotationDefaultAttr(Definitions.scala:996)    at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreClasses$lzycompute(Definitions.scala:1126)    at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreClasses(Definitions.scala:1125)    at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode$lzycompute(Definitions.scala:1169)    at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode(Definitions.scala:1169)    at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1234)    at scala.tools.nsc.Global$Run.(Global.scala:1281)    at xsbt.CachedCompiler0.run(CompilerInterface.scala:87)    at xsbt.CachedCompiler0.run(CompilerInterface.scala:72)    at xsbt.CompilerInterface.run(CompilerInterface.scala:27)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:73)    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:35)    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:29)    at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:71)    at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:71)    at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:71)    at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:101)    at sbt.compiler.AggressiveCompile$$anonfun$4.compileScala$1(AggressiveCompile.scala:70)    at sbt.compiler.AggressiveCompile$$anonfun$4.apply(AggressiveCompile.scala:88)    at sbt.compiler.AggressiveCompile$$anonfun$4.apply(AggressiveCompile.scala:60)    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:24)    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:22)    at sbt.inc.Incremental$.cycle(Incremental.scala:45)    at sbt.inc.Incremental$.compile(Incremental.scala:29)    at sbt.inc.IncrementalCompile$.apply(Compile.scala:20)    at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:96)    at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:44)    at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:31)    at sbt.Compiler$.apply(Compiler.scala:79)    at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:572)    at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:572)    at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:578)    at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:578)    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)    at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)    at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:41)    at sbt.std.Transform$$anon$5.work(System.scala:71)    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)    at sbt.Execute.work(Execute.scala:238)    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)    at java.util.concurrent.FutureTask.run(FutureTask.java:138)    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)    at java.util.concurrent.FutureTask.run(FutureTask.java:138)    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)    at java.lang.Thread.run(Thread.java:695)[error] (test:compile) scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found.[error] Total time: 39 s, completed Apr 1, 2014 4:08:27 PMplay clean test  103.37s user 3.60s system 224% cpu 47.737 total

最近在用 homebrew 更新一些软件包后突然开始出现这种情况,尽管我不确定这就是原因,因为我卸载了 homewbrew 并使用他们网站上的 play zip 软件包却遇到了同样的问题。

我尝试过的其他事情:

  • 清除 home 中的 .sbt、.ivy、.m2 目录
  • 卸载/重新安装 scala/play/java、使用 play 框架 clean 命令、清理存储库等。

最佳答案

TL;DR 我们所依赖的 powermock.jar 文件不是 jar 文件。

我能够在一个新的游戏项目中运行“游戏测试”,但我的系统中没有任何更成熟的项目。所以我决定删除文件,直到通过测试。我首先删除了所有 scala 测试(我们混合了 Java 和 Scala)并得到了这个信息更丰富的错误:

[error] error: error reading /usr/local/Cellar/play/2.1.1/libexec/repository/cache/org.powermock/powermock-mockito-release-full/jars/powermock-mockito-release-full-1.5.jar; cannot read zip file

我查看了 jar 文件:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
html, body, #partner, iframe {
height:100%;
width:100%;
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
body {
overflow:hidden;
}
</style>
<meta content="NOW" name="expires">
<meta content="index, follow, all" name="GOOGLEBOT">
<meta content="index, follow, all" name="robots">
<!-- Following Meta-Tag fixes scaling-issues on mobile devices -->
<meta content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" name="viewport">
</head>
<body>
<div id="partner"></div>
<script type="text/javascript">
document.write(
'<script type="text/javascript" language="JavaScript"'
+ 'src="//sedoparking.com/frmpark/'
+ window.location.host + '/'
+ 'tierraexpired'
+ '/park.js">'
+ '<\/script>'
);
</script>
</body>
</html>

我们依赖于 powermock 1.5:

"org.powermock" % "powermock-mockito-release-full" % "1.5" % "test"

快速浏览一下 powermock 网站,发现 powermock 1.5 似乎已被弃用,并且可能已被撤回。但我们实际上是从 Artifactory 提供这个特定的文件,并且出于某种原因它开始提供 HTML。

不知道为什么它没有失败签名验证或给我们一个稍微更具信息性的错误。

关于java - 编译 Play 框架测试时出现错误 "scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22796049/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com