I get the following error on sbt startup, when two specific sbt plugins are added together to a project in its build definition. One of these sbt plugins is scalikejdbc and the other is my own, and clearly their mutual inclusion in a project's build definition results in this error upon sbt startup:
scala.reflect.internal.Types$TypeError: package macros contains object
and package with same name: blackbox
Clearly, it looks as if each plugin brings along a different version of scala.reflect.macros thus causing this error. I can poke inside the jars of the sbt plugins, and indeed one of them may seem to bring along a scala/reflect/macros/blackbox.class ―
$ jar -tvf scalikejdbc-core_2.10/jars/scalikejdbc-core_2.10-2.4.2.jar | grep black
0 Sat Jun 11 15:51:10 IDT 2016 scala/reflect/macros/blackbox/
405 Sat Jun 11 15:51:04 IDT 2016 scala/reflect/macros/blackbox/package$.class
419 Sat Jun 11 15:51:04 IDT 2016 scala/reflect/macros/blackbox/package.class
― however it's hard to positively conclude what gets loaded by sbt during this early startup phase, in order to figure which versions of this package are involved here and which dependencies bring them along.
Thanks for your suggestions about how to proceed with this investigation!
And just for completeness sake ― I include below the full error given by sbt below only ― but I sincerely doubt it adds any information so you can likely ignore it.
scala.reflect.internal.Types$TypeError: package macros contains object and package with same name: blackbox
one of them needs to be removed from classpath
at scala.tools.nsc.symtab.SymbolLoaders.enterPackage(SymbolLoaders.scala:66)
at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader$$anonfun$doComplete$4.apply(SymbolLoaders.scala:244)
at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader$$anonfun$doComplete$4.apply(SymbolLoaders.scala:243)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader.doComplete(SymbolLoaders.scala:243)
at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:194)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1231)
at scala.reflect.internal.pickling.UnPickler$Scan.scala$reflect$internal$pickling$UnPickler$Scan$$fromName$1(UnPickler.scala:207)
at scala.reflect.internal.pickling.UnPickler$Scan.readExtSymbol$1(UnPickler.scala:226)
at scala.reflect.internal.pickling.UnPickler$Scan.readSymbol(UnPickler.scala:250)
at scala.reflect.internal.pickling.UnPickler$Scan.readSymbolRef(UnPickler.scala:783)
at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:335)
at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:792)
at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:792)
at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:171)
at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:792)
at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:345)
at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:792)
at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readTypeRef$1.apply(UnPickler.scala:792)
at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:171)
at scala.reflect.internal.pickling.UnPickler$Scan.readTypeRef(UnPickler.scala:792)
at scala.reflect.internal.pickling.UnPickler$Scan.readAnnotationInfo(UnPickler.scala:466)
at scala.reflect.internal.pickling.UnPickler$Scan.readSymbolAnnotation(UnPickler.scala:491)
at scala.reflect.internal.pickling.UnPickler$Scan.run(UnPickler.scala:88)
at scala.reflect.internal.pickling.UnPickler.unpickle(UnPickler.scala:37)
at scala.tools.nsc.symtab.classfile.ClassfileParser.scala$tools$nsc$symtab$classfile$ClassfileParser$$parseAttribute$1(ClassfileParser.scala:908)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttributes(ClassfileParser.scala:1084)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parseClass(ClassfileParser.scala:580)
at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:88)
at scala.tools.nsc.symtab.SymbolLoaders$ClassfileLoader.doComplete(SymbolLoaders.scala:261)
at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:194)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1231)
at scala.reflect.internal.SymbolTable.openPackageModule(SymbolTable.scala:244)
at scala.reflect.internal.SymbolTable.openPackageModule(SymbolTable.scala:300)
at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader.doComplete(SymbolLoaders.scala:247)
at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:194)
at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.load(SymbolLoaders.scala:210)
at scala.reflect.internal.Symbols$Symbol.typeParams(Symbols.scala:1489)
at scala.reflect.internal.Types$class.scala$reflect$internal$Types$$isRawIfWithoutArgs(Types.scala:4394)
at scala.reflect.internal.Types$$anon$11.apply(Types.scala:4416)
at scala.reflect.internal.Symbols$TermSymbol.scala$reflect$internal$Symbols$TermSymbol$$cook$1(Symbols.scala:2581)
at scala.reflect.internal.Symbols$TermSymbol.doCookJavaRawInfo(Symbols.scala:2589)
at scala.reflect.internal.Symbols$Symbol.cookJavaRawInfo(Symbols.scala:1442)
at scala.tools.nsc.typechecker.Infer$Inferencer.checkAccessible(Infer.scala:384)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$makeAccessible(Typers.scala:605)
at scala.tools.nsc.typechecker.Typers$Typer.typedIdent$2(Typers.scala:5201)
at scala.tools.nsc.typechecker.Typers$Typer.typedIdentOrWildcard$1(Typers.scala:5218)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5561)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5727)
at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5735)
at scala.tools.nsc.typechecker.Namers$Namer.importSig(Namers.scala:1357)
at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1460)
at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1463)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:728)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:727)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:727)
at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$logAndValidate(Namers.scala:1496)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:727)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:726)
at scala.tools.nsc.typechecker.Namers$$anon$1.completeImpl(Namers.scala:1611)
at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1619)
at scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1609)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1231)
at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1374)
at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2912)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)
at scala.collection.immutable.List.loop$1(List.scala:170)
at scala.collection.immutable.List.mapConserve(List.scala:186)
at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3032)
at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5301)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5587)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5704)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:99)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:464)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:91)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:91)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:91)
at sbt.compiler.Eval$$anonfun$compile$1$1.apply$mcV$sp(Eval.scala:177)
at sbt.compiler.Eval$$anonfun$compile$1$1.apply(Eval.scala:177)
at sbt.compiler.Eval$$anonfun$compile$1$1.apply(Eval.scala:177)
at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:207)
at sbt.compiler.Eval.compile$1(Eval.scala:177)
at sbt.compiler.Eval.compileAndLoad(Eval.scala:182)
at sbt.compiler.Eval.evalCommon(Eval.scala:152)
at sbt.compiler.Eval.evalDefinitions(Eval.scala:122)
at sbt.EvaluateConfigurations$.evaluateDefinitions(EvaluateConfigurations.scala:271)
at sbt.EvaluateConfigurations$.evaluateSbtFile(EvaluateConfigurations.scala:109)
at sbt.Load$.sbt$Load$$loadSettingsFile$1(Load.scala:725)
at sbt.Load$$anonfun$sbt$Load$$memoLoadSettingsFile$1$1.apply(Load.scala:731)
at sbt.Load$$anonfun$sbt$Load$$memoLoadSettingsFile$1$1.apply(Load.scala:730)
at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
at scala.collection.AbstractMap.getOrElse(Map.scala:58)
at sbt.Load$.sbt$Load$$memoLoadSettingsFile$1(Load.scala:730)
at sbt.Load$$anonfun$loadFiles$1$2.apply(Load.scala:738)
at sbt.Load$$anonfun$loadFiles$1$2.apply(Load.scala:738)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at sbt.Load$.loadFiles$1(Load.scala:738)
at sbt.Load$.discoverProjects(Load.scala:749)
at sbt.Load$.discover$1(Load.scala:555)
at sbt.Load$.loadTransitive(Load.scala:584)
at sbt.Load$.loadProjects$1(Load.scala:452)
at sbt.Load$.loadUnit(Load.scala:456)
at sbt.Load$$anonfun$18$$anonfun$apply$11.apply(Load.scala:291)
at sbt.Load$$anonfun$18$$anonfun$apply$11.apply(Load.scala:291)
at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:91)
at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:90)
at sbt.BuildLoader.apply(BuildLoader.scala:140)
at sbt.Load$.loadAll(Load.scala:344)
at sbt.Load$.loadURI(Load.scala:299)
at sbt.Load$.load(Load.scala:295)
at sbt.Load$.load(Load.scala:286)
at sbt.Load$.apply(Load.scala:140)
at sbt.Load$.defaultLoad(Load.scala:36)
at sbt.BuiltinCommands$.liftedTree1$1(Main.scala:492)
at sbt.BuiltinCommands$.doLoadProject(Main.scala:492)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:484)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:484)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
at sbt.Command$.process(Command.scala:93)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
at sbt.State$$anon$1.process(State.scala:184)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.MainLoop$.next(MainLoop.scala:96)
at sbt.MainLoop$.run(MainLoop.scala:89)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:68)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:63)
at sbt.Using.apply(Using.scala:24)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:63)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:46)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:30)
at sbt.MainLoop$.runLogged(MainLoop.scala:22)
at sbt.StandardMain$.runManaged(Main.scala:54)
at sbt.xMain.run(Main.scala:29)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
at xsbt.boot.Launch$.run(Launch.scala:109)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:41)
at xsbt.boot.Boot$.main(Boot.scala:17)
at xsbt.boot.Boot.main(Boot.scala)
error: error while loading package, class file '/home/user/.sbt/boot/scala-2.10.6/org.scala-sbt/sbt/0.13.11/sbt-0.13.11.jar(sbt/package.class)' is broken
(class java.lang.RuntimeException/error reading Scala signature of package.class: package macros contains object and package with same name: blackbox
one of them needs to be removed from classpath)
sbt.compiler.EvalException: Type error in expression
Copying #jrudolph's comment here:
FWIW giving some advice to someone coming to this issue later on also having problems with plugin classpaths. Try adding scalacOptions ++= Seq("-verbose", "-Ylog-classpath") to project/plugins.sbt. This will print out detailed information when the scala compiler loads classes when compiling the build. This should give a hint from which the jar the conflicting classes came from.
Related
I am just starting out with ScalaTest and following http://www.scalatest.org/quick_start page
I followed the steps as outlined (by downloading the jar file linked above the code)
and the code fails
unittest vi ExampleSpec.scala
➜ unittest scalac -cp scalatest-app_2.13-3.0.8.jar ExampleSpec.scala
➜ unittest scala -cp scalatest-app_2.13-3.0.8.jar org.scalatest.run ExampleSpec
An exception or error caused a run to abort. This may have been caused by a problematic custom reporter.
java.lang.NoClassDefFoundError: scala/xml/NamespaceBinding
at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:1368)
at org.scalatest.tools.Runner$.$anonfun$runOptionallyWithPassFailReporter$24(Runner.scala:1033)
at org.scalatest.tools.Runner$.$anonfun$runOptionallyWithPassFailReporter$24$adapted(Runner.scala:1011)
at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:1509)
at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1011)
at org.scalatest.tools.Runner$.main(Runner.scala:827)
at org.scalatest.run$.main(run.scala:120)
at org.scalatest.run.main(run.scala)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at scala.reflect.internal.util.ScalaClassLoader.$anonfun$run$2(ScalaClassLoader.scala:105)
at scala.reflect.internal.util.ScalaClassLoader.asContext(ScalaClassLoader.scala:40)
at scala.reflect.internal.util.ScalaClassLoader.asContext$(ScalaClassLoader.scala:37)
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:130)
at scala.reflect.internal.util.ScalaClassLoader.run(ScalaClassLoader.scala:105)
at scala.reflect.internal.util.ScalaClassLoader.run$(ScalaClassLoader.scala:97)
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:130)
at scala.tools.nsc.CommonRunner.run(ObjectRunner.scala:29)
at scala.tools.nsc.CommonRunner.run$(ObjectRunner.scala:28)
at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:43)
at scala.tools.nsc.CommonRunner.runAndCatch(ObjectRunner.scala:35)
at scala.tools.nsc.CommonRunner.runAndCatch$(ObjectRunner.scala:34)
at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:70)
at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:91)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:103)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:108)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Caused by: java.lang.ClassNotFoundException: scala.xml.NamespaceBinding
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 29 more
My Scala Version is
➜ unittest scala -version
Scala code runner version 2.13.1 -- Copyright 2002-2019, LAMP/EPFL and Lightbend, Inc.
I thought the error is because scala-xml is a separate project than Scala, so I downloaded the jar file from https://mvnrepository.com/artifact/org.scala-lang/scala-xml/2.11.0-M4
Next, I tried the entire process again and it fails with different error
unittest scala -classpath "scalatest-app_2.13-3.0.8.jar:scala-xml-2.11.0-M4.jar" org.scalatest.run ExampleSpec
An exception or error caused a run to abort. This may have been caused by a problematic custom reporter.
java.lang.NoClassDefFoundError: scala/Serializable
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:515)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:423)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:417)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:416)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:1368)
at org.scalatest.tools.Runner$.$anonfun$runOptionallyWithPassFailReporter$24(Runner.scala:1033)
at org.scalatest.tools.Runner$.$anonfun$runOptionallyWithPassFailReporter$24$adapted(Runner.scala:1011)
at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:1509)
at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1011)
at org.scalatest.tools.Runner$.main(Runner.scala:827)
at org.scalatest.run$.main(run.scala:120)
at org.scalatest.run.main(run.scala)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at scala.reflect.internal.util.ScalaClassLoader.$anonfun$run$2(ScalaClassLoader.scala:105)
at scala.reflect.internal.util.ScalaClassLoader.asContext(ScalaClassLoader.scala:40)
at scala.reflect.internal.util.ScalaClassLoader.asContext$(ScalaClassLoader.scala:37)
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:130)
at scala.reflect.internal.util.ScalaClassLoader.run(ScalaClassLoader.scala:105)
at scala.reflect.internal.util.ScalaClassLoader.run$(ScalaClassLoader.scala:97)
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:130)
at scala.tools.nsc.CommonRunner.run(ObjectRunner.scala:29)
at scala.tools.nsc.CommonRunner.run$(ObjectRunner.scala:28)
at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:43)
at scala.tools.nsc.CommonRunner.runAndCatch(ObjectRunner.scala:35)
at scala.tools.nsc.CommonRunner.runAndCatch$(ObjectRunner.scala:34)
at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:70)
at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:91)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:103)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:108)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Caused by: java.lang.ClassNotFoundException: scala.Serializable
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 39 more
Could someone please help me understand what the issue is?
Thank you
UPDATE (SOLVED)
As per the comment from #J0HN and answer from #Mario, I was able to solve the issue
➜ unittest ll
total 17608
-rw-r--r-- 1 harit staff 504B Nov 21 17:15 ExampleSpec.scala
-rw-r--r--# 1 harit staff 555K Nov 22 10:35 scala-xml_2.13-1.2.0.jar
-rw-r--r--# 1 harit staff 7.9M Nov 21 16:59 scalatest-app_2.13-3.0.8.jar
➜ unittest scalac -classpath "scalatest-app_2.13-3.0.8.jar:scala-xml_2.13-1.2.0.jar" ExampleSpec.scala
➜ unittest scala -classpath "scalatest-app_2.13-3.0.8.jar:scala-xml_2.13-1.2.0.jar" org.scalatest.run ExampleSpec
Run starting. Expected test count is: 2
ExampleSpec:
A Stack
- should pop values in last-in-first-out order
- should throw NoSuchElementException if an empty stack is popped
Run completed in 506 milliseconds.
Total number of tests run: 2
Suites: completed 1, aborted 0
Tests: succeeded 2, failed 0, canceled 0, ignored 0, pending 0
All tests passed.
➜ unittest
I have downloaded scala-xml_2.13-1.2.0.jar from this page
Scala 2.13 decoupled scala-xml from the standard library:
The following modules are no longer included in the distribution:
scala-xml, scala-parser-combinators, scala-swing. They are
community-maintained and published to Maven Central.
As suggested by J0HN, download scala-xml_2.13 and try the following command
scala -cp scalatest-app_2.13-3.0.8.jar:scala-xml_2.13-1.2.0.jar org.scalatest.run ExampleSpec
sbt-version: 1.2.1
scala-version: 2.12.6
i can connect ensime with emacs but once run C-C C-B c (ensime-sbt-do-compile) then encounter the following error
[ERROR] Failed to construct terminal; falling back to unsupported
java.lang.IllegalArgumentException: Invalid terminal type:
at jline.TerminalFactory.create(TerminalFactory.java:103)
at jline.TerminalFactory.get(TerminalFactory.java:180)
at jline.TerminalFactory.get(TerminalFactory.java:186)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:244)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:236)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:228)
at sbt.internal.util.JLine$.$anonfun$createReader$1(LineReader.scala:137)
at sbt.internal.util.JLine$.$anonfun$usingTerminal$1(LineReader.scala:128)
at sbt.internal.util.JLine$.withTerminal(LineReader.scala:118)
at sbt.internal.util.JLine$.usingTerminal(LineReader.scala:126)
at sbt.internal.util.JLine$.createReader(LineReader.scala:136)
at sbt.internal.util.SimpleReader.<init>(LineReader.scala:213)
at sbt.internal.util.SimpleReader$.<init>(LineReader.scala:216)
at sbt.internal.util.SimpleReader$.<clinit>(LineReader.scala)
at sbt.Import.$init$(Import.scala:179)
at sbt.package$.<init>(package.scala:11)
at sbt.package$.<clinit>(package.scala)
at $0c1c090d12f59c194554$.$sbtdef(C:\Users\xxx\.sbt\1.0\plugins\build.sbt:1)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sbt.compiler.Eval$.getValue(Eval.scala:578)
at sbt.compiler.Eval.$anonfun$eval$1(Eval.scala:129)
at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateDslEntry$1(EvaluateConfigurations.scala:249)
at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateSbtFile$6(EvaluateConfigurations.scala:172)
at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.collection.TraversableLike.map(TraversableLike.scala:234)
at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
at scala.collection.immutable.List.map(List.scala:295)
at sbt.internal.EvaluateConfigurations$.$anonfun$evaluateSbtFile$4(EvaluateConfigurations.scala:172)
at sbt.internal.Load$.loadSettingsFile$1(Load.scala:1137)
at sbt.internal.Load$.$anonfun$discoverProjects$2(Load.scala:1144)
at scala.collection.MapLike.getOrElse(MapLike.scala:128)
at scala.collection.MapLike.getOrElse$(MapLike.scala:126)
at scala.collection.AbstractMap.getOrElse(Map.scala:59)
at sbt.internal.Load$.memoLoadSettingsFile$1(Load.scala:1143)
at sbt.internal.Load$.$anonfun$discoverProjects$4(Load.scala:1151)
at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
at scala.collection.immutable.List.foreach(List.scala:389)
at scala.collection.TraversableLike.map(TraversableLike.scala:234)
at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
at scala.collection.immutable.List.map(List.scala:295)
at sbt.internal.Load$.loadFiles$1(Load.scala:1151)
at sbt.internal.Load$.discoverProjects(Load.scala:1165)
at sbt.internal.Load$.discover$1(Load.scala:862)
at sbt.internal.Load$.loadTransitive(Load.scala:937)
at sbt.internal.Load$.loadProjects$1(Load.scala:726)
at sbt.internal.Load$.$anonfun$loadUnit$11(Load.scala:729)
at sbt.internal.Load$.timed(Load.scala:1395)
at sbt.internal.Load$.$anonfun$loadUnit$1(Load.scala:729)
at sbt.internal.Load$.timed(Load.scala:1395)
at sbt.internal.Load$.loadUnit(Load.scala:688)
at sbt.internal.Load$.$anonfun$builtinLoader$4(Load.scala:484)
at sbt.internal.BuildLoader$.$anonfun$componentLoader$5(BuildLoader.scala:176)
at sbt.internal.BuildLoader.apply(BuildLoader.scala:241)
at sbt.internal.Load$.loadURI$1(Load.scala:546)
at sbt.internal.Load$.loadAll(Load.scala:562)
at sbt.internal.Load$.loadURI(Load.scala:492)
at sbt.internal.Load$.load(Load.scala:471)
at sbt.internal.Load$.$anonfun$apply$1(Load.scala:251)
at sbt.internal.Load$.timed(Load.scala:1395)
at sbt.internal.Load$.apply(Load.scala:251)
at sbt.internal.GlobalPlugin$.build(GlobalPlugin.scala:59)
at sbt.internal.GlobalPlugin$.load(GlobalPlugin.scala:64)
at sbt.internal.Load$.loadGlobal(Load.scala:193)
at sbt.internal.Load$.defaultWithGlobal(Load.scala:150)
at sbt.internal.Load$.$anonfun$defaultLoad$1(Load.scala:64)
at sbt.internal.Load$.timed(Load.scala:1395)
at sbt.internal.Load$.defaultLoad(Load.scala:60)
at sbt.BuiltinCommands$.liftedTree1$1(Main.scala:829)
at sbt.BuiltinCommands$.doLoadProject(Main.scala:829)
at sbt.BuiltinCommands$.$anonfun$loadProjectImpl$2(Main.scala:800)
at sbt.Command$.$anonfun$applyEffect$4(Command.scala:142)
at sbt.Command$.$anonfun$applyEffect$2(Command.scala:137)
at sbt.Command$.process(Command.scala:181)
at sbt.MainLoop$.processCommand(MainLoop.scala:151)
at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:139)
at sbt.State$$anon$1.runCmd$1(State.scala:246)
at sbt.State$$anon$1.process(State.scala:250)
at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:139)
at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
at sbt.MainLoop$.next(MainLoop.scala:139)
at sbt.MainLoop$.run(MainLoop.scala:132)
at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:110)
at sbt.io.Using.apply(Using.scala:22)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:104)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:59)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:44)
at sbt.MainLoop$.runLogged(MainLoop.scala:35)
at sbt.StandardMain$.runManaged(Main.scala:138)
at sbt.xMain.run(Main.scala:89)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
at xsbt.boot.Launch$.run(Launch.scala:109)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:56)
at xsbt.boot.Boot$.main(Boot.scala:18)
at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException:
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at jline.TerminalFactory.create(TerminalFactory.java:100)
... 101 more
[info] Loading settings for project global-plugins from build.sbt,plugins.sbt ...
[info] Loading global plugins from C:\Users\xxx\.sbt\1.0\plugins
[info] Loading project definition from C:\Users\xxx\ScalaProjects\minedemo\hello\project
[info] Loading settings for project hello from build.sbt ...
[info] Set current project to hello-world (in build file:/C:/Users/xxx/ScalaProjects/minedemo/hello/)
[error] Not a valid command: none (similar: new)
[error] Not a valid project ID: none
[error] Expected ':'
[error] Not a valid key: none (similar: runner, name, console)
[error] none
[error] ^
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
i am not sure whether it's emacs config issue or sbt config issue , i am newer for scala and emacs, very appreciate for any help, it block me lots of time
found a solution from emacs-sbt-mode
https://github.com/ensime/emacs-sbt-mode/issues/120
(setq sbt:program-options '())
Works for me on:
OS: Windows 10 x64 edition
SBT: 1.2.8
JDK: 1.8.0_211
Emacs: 26.2.90 (build 2, x86_64-w64-mingw32) of 2019-06-14
sbt-mode: 2.0.0
scala-mode: 1.0.0
ensime: 2.0.2
I have a Java project which is building in SBT under JDK7. When I switch the JDK to JDK8 (SBT runs under JDK8 and targets JDK8 bytecode), I get an error which, whilst emitting from SBT's incremental compiler, seems to emananate from a call to Class.getDeclaredMethods on one of the already-compiled classes. Note, the source is 1.7-compatible source code in either case. I have made no changes to the source code
SBT version 0.13.5 and JDK 1.8.0_05
I reproduce the stack trace below. It's completely reproducible but is "odd" from a few angles. I mention these as they might help investigate the problem.
I have created a class which calls Class.forName on the "offending" class and calls getDeclaredMethods. This works - there is no obvious issue with the .class file
I presume due to some issue with SBT caching its internal analysis, certain sequences of commands work:
Example 1:
ptp-server> clean
ptp-server> compile //this will fail
Example 2:
ptp-server> clean
ptp-server> compile //This will fail
ptp-server> compile //This then works
Example 3:
ptp-server> clean
ptp-server> compile //This will fail
ptp-server> clean
ptp-server> compile //This then works
Here's the stack trace:
java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
gsa/jerusalem/naming/ptp/PTPServerEodPositionHelper.fillResponse(Lgsa/jerusalem/protocol/ptp/PTPResponse;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lgsa/jerusalem/protocol/ptp/PTPCommand;Ljava/lang/String;)V #73: aload
Reason:
Type top (current frame, locals[7]) is not assignable to reference type
Current Frame:
bci: #73
flags: { }
locals: { 'gsa/jerusalem/naming/ptp/PTPServerEodPositionHelper', 'gsa/jerusalem/protocol/ptp/PTPResponse', 'java/lang/String', 'java/lang/String', 'java/lang/String', 'gsa/jerusalem/protocol/ptp/PTPCommand', 'java/lang/String', top, '[Ljava/lang/String;', 'java/lang/String', 'gsa/shared/datetime/XDate' }
stack: { 'java/util/logging/Logger', 'java/lang/String', '[Ljava/lang/Object;', '[Ljava/lang/Object;', integer }
...
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2688)
at java.lang.Class.getDeclaredMethods(Class.java:1962)
at sbt.ClassToAPI$.structure(ClassToAPI.scala:72)
at sbt.ClassToAPI$.x$2$lzycompute$1(ClassToAPI.scala:61)
at sbt.ClassToAPI$.x$2$1(ClassToAPI.scala:61)
at sbt.ClassToAPI$.instance$lzycompute$1(ClassToAPI.scala:61)
at sbt.ClassToAPI$.sbt$ClassToAPI$$instance$1(ClassToAPI.scala:61)
at sbt.ClassToAPI$$anonfun$5.apply(ClassToAPI.scala:62)
at sbt.ClassToAPI$$anonfun$5.apply(ClassToAPI.scala:62)
at xsbti.SafeLazy$Impl._t$lzycompute(SafeLazy.scala:18)
at xsbti.SafeLazy$Impl._t(SafeLazy.scala:16)
at xsbti.SafeLazy$Impl.get(SafeLazy.scala:22)
at sbt.ClassToAPI$$anonfun$process$1.apply(ClassToAPI.scala:21)
at sbt.ClassToAPI$$anonfun$process$1.apply(ClassToAPI.scala:21)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:45)
at sbt.ClassToAPI$.process(ClassToAPI.scala:21)
at sbt.compiler.AggressiveCompile$$anonfun$3.sbt$compiler$AggressiveCompile$$anonfun$$readAPI$1(AggressiveCompile.scala:127)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileJava$1$2$$anonfun$apply$mcV$sp$2$$anonfun$apply$6.apply(AggressiveCompile.scala:135)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileJava$1$2$$anonfun$apply$mcV$sp$2$$anonfun$apply$6.apply(AggressiveCompile.scala:135)
at sbt.classfile.Analyze$$anonfun$apply$9.apply(Analyze.scala:42)
at sbt.classfile.Analyze$$anonfun$apply$9.apply(Analyze.scala:41)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:98)
at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:98)
at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:226)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:39)
at scala.collection.mutable.HashMap.foreach(HashMap.scala:98)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
at sbt.classfile.Analyze$.apply(Analyze.scala:41)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileJava$1$2$$anonfun$apply$mcV$sp$2.apply(AggressiveCompile.scala:135)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileJava$1$2$$anonfun$apply$mcV$sp$2.apply(AggressiveCompile.scala:133)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileJava$1$2.apply$mcV$sp(AggressiveCompile.scala:133)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileJava$1$2.apply(AggressiveCompile.scala:133)
at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileJava$1$2.apply(AggressiveCompile.scala:133)
at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:162)
at sbt.compiler.AggressiveCompile$$anonfun$3.compileJava$1(AggressiveCompile.scala:132)
at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:139)
at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:86)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:38)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:36)
at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:31)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:39)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:38)
at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:66)
at sbt.inc.Incremental$.compile(Incremental.scala:38)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:26)
at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:153)
at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:70)
at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:45)
at sbt.Compiler$.apply(Compiler.scala:74)
at sbt.Compiler$.apply(Compiler.scala:65)
at sbt.Defaults$.sbt$Defaults$$compileTaskImpl(Defaults.scala:773)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:765)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:765)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:744)
Maybe, your files are encoded by UTF-8 with BOM header. Drop BOM and then retry.
I'm trying to run the word count example from the Quick start page
import com.nicta.scoobi.Scoobi._
import Reduction._
object WordCount extends ScoobiApp {
def run() {
val lines = fromTextFile(args(0))
val counts = lines.mapFlatten(_.split(" "))
.map(word => (word, 1))
.groupByKey
.combine(Sum.int)
counts.toTextFile(args(1)).persist
}
}
It works fine when I use in memory mode, but when trying local mode (or cluster mode) I fail with the errors:
[WARN] LocalJobRunner - job_local_0001 <java.lang.RuntimeException: java.lang.ClassNotFoundException: Class scala.runtime.Nothing$ not found>java.lang.RuntimeException: java.lang.ClassNotFoundException: Class scala.runtime.Nothing$ not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1439)
at com.nicta.scoobi.impl.mapreducer.ChannelOutputFormat.com$nicta$scoobi$impl$mapreducer$ChannelOutputFormat$$mkTaskContext$1(ChannelOutputFormat.scala:63)
at com.nicta.scoobi.impl.mapreducer.ChannelOutputFormat$$anonfun$getContext$1.apply(ChannelOutputFormat.scala:75)
at com.nicta.scoobi.impl.mapreducer.ChannelOutputFormat$$anonfun$getContext$1.apply(ChannelOutputFormat.scala:75)
at scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:189)
at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:91)
at com.nicta.scoobi.impl.mapreducer.ChannelOutputFormat.getContext(ChannelOutputFormat.scala:75)
at com.nicta.scoobi.impl.mapreducer.ChannelOutputFormat.write(ChannelOutputFormat.scala:43)
at com.nicta.scoobi.impl.plan.mscr.MscrOutputChannel$$anon$5$$anonfun$write$1.apply(OutputChannel.scala:137)
at com.nicta.scoobi.impl.plan.mscr.MscrOutputChannel$$anon$5$$anonfun$write$1.apply(OutputChannel.scala:135)
at scala.collection.immutable.List.foreach(List.scala:318)
at com.nicta.scoobi.impl.plan.mscr.MscrOutputChannel$$anon$5.write(OutputChannel.scala:135)
at com.nicta.scoobi.impl.plan.mscr.GbkOutputChannel$$anonfun$reduce$1.apply$mcV$sp(OutputChannel.scala:201)
at com.nicta.scoobi.impl.plan.mscr.GbkOutputChannel$$anonfun$reduce$1.apply(OutputChannel.scala:201)
at com.nicta.scoobi.impl.plan.mscr.GbkOutputChannel$$anonfun$reduce$1.apply(OutputChannel.scala:201)
at scala.Option.getOrElse(Option.scala:120)
at com.nicta.scoobi.impl.plan.mscr.GbkOutputChannel.reduce(OutputChannel.scala:200)
at com.nicta.scoobi.impl.mapreducer.MscrReducer$$anonfun$reduce$1.apply(MscrReducer.scala:55)
at com.nicta.scoobi.impl.mapreducer.MscrReducer$$anonfun$reduce$1.apply(MscrReducer.scala:52)
at scala.Option.foreach(Option.scala:236)
at com.nicta.scoobi.impl.mapreducer.MscrReducer.reduce(MscrReducer.scala:52)
at com.nicta.scoobi.impl.mapreducer.MscrReducer.reduce(MscrReducer.scala:33)
at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:164)
at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:572)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:414)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:309)
Caused by: java.lang.ClassNotFoundException: Class scala.runtime.Nothing$ not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1350)
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1437)
... 25 more
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/3757970833182018747_-1642337927_156373685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.combiners-step1 of 1
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/1307074498433974065_910223079_156373685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.mappers-step1 of 1
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/-624792843022440048_-470268278_156372685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.metadata.TG23
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/-7527273518266336656_-470264434_156372685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.metadata.TK23
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/-7162952586058180219_-470259629_156372685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.metadata.TP23
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/-1228551315878554095_-470253863_156372685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.metadata.TV23
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/6598684265640022340_1943382592_156373685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/dist-objs/scoobi.reducers-step1 of 1
[INFO] TrackerDistributedCacheManager - Deleted path /tmp/scoobi-root/WordCount$-1124-035523--1298047809/step1 of 1/archive/1699308645513763631_1905624154_156371685/file/tmp/scoobi-root/WordCount$-1124-035523--1298047809/env/a88809af-334b-499e-bafc-1a2ebeffdfbd
[INFO] MapReduceJob - Map 100% Reduce 0%
[error] (run-main) com.nicta.scoobi.impl.exec.JobExecException: MapReduce job 'job_local_0001' failed! Please see http://localhost:8080/ for more info.
com.nicta.scoobi.impl.exec.JobExecException: MapReduce job 'job_local_0001' failed! Please see http://localhost:8080/ for more info.
at com.nicta.scoobi.impl.exec.MapReduceJob.report(MapReduceJob.scala:80)
at com.nicta.scoobi.impl.exec.HadoopMode$Execution$$anonfun$reportMscr$1.apply(HadoopMode.scala:157)
at com.nicta.scoobi.impl.exec.HadoopMode$Execution$$anonfun$reportMscr$1.apply(HadoopMode.scala:154)
at scala.Function2$$anonfun$tupled$1.apply(Function2.scala:54)
at scala.Function2$$anonfun$tupled$1.apply(Function2.scala:53)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at com.nicta.scoobi.impl.exec.HadoopMode$Execution.runMscrs(HadoopMode.scala:133)
at com.nicta.scoobi.impl.exec.HadoopMode$Execution.execute(HadoopMode.scala:115)
at com.nicta.scoobi.impl.exec.HadoopMode$$anonfun$executeLayer$1.apply(HadoopMode.scala:105)
at com.nicta.scoobi.impl.exec.HadoopMode$$anonfun$executeLayer$1.apply(HadoopMode.scala:104)
at org.kiama.attribution.AttributionCore$CachedAttribute.apply(AttributionCore.scala:61)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at com.nicta.scoobi.impl.exec.HadoopMode.com$nicta$scoobi$impl$exec$HadoopMode$$executeLayers$1(HadoopMode.scala:68)
at com.nicta.scoobi.impl.exec.HadoopMode$$anonfun$executeNode$1.apply(HadoopMode.scala:91)
at com.nicta.scoobi.impl.exec.HadoopMode$$anonfun$executeNode$1.apply(HadoopMode.scala:84)
at org.kiama.attribution.AttributionCore$CachedAttribute.apply(AttributionCore.scala:61)
at scalaz.syntax.IdOps$class.$bar$greater(IdOps.scala:15)
at scalaz.syntax.ToIdOps$$anon$1.$bar$greater(IdOps.scala:78)
at com.nicta.scoobi.impl.exec.HadoopMode.execute(HadoopMode.scala:52)
at com.nicta.scoobi.impl.exec.HadoopMode.execute(HadoopMode.scala:48)
at com.nicta.scoobi.impl.Persister.persist(Persister.scala:44)
at com.nicta.scoobi.impl.ScoobiConfigurationImpl.persist(ScoobiConfigurationImpl.scala:355)
at com.nicta.scoobi.application.Persist$class.persist(Persist.scala:33)
at p.WordCount$.persist(scoobi-test.scala:6)
at com.nicta.scoobi.application.Persist$PersistableList.persist(Persist.scala:151)
at p.WordCount$.run(scoobi-test.scala:14)
at com.nicta.scoobi.application.ScoobiApp$$anonfun$main$1.apply$mcV$sp(ScoobiApp.scala:80)
at com.nicta.scoobi.application.ScoobiApp$$anonfun$main$1.apply(ScoobiApp.scala:75)
at com.nicta.scoobi.application.ScoobiApp$$anonfun$main$1.apply(ScoobiApp.scala:75)
at com.nicta.scoobi.application.LocalHadoop$class.runOnLocal(LocalHadoop.scala:41)
at p.WordCount$.runOnLocal(scoobi-test.scala:6)
at com.nicta.scoobi.application.LocalHadoop$class.executeOnLocal(LocalHadoop.scala:35)
at p.WordCount$.executeOnLocal(scoobi-test.scala:6)
at com.nicta.scoobi.application.LocalHadoop$$anonfun$onLocal$1.apply(LocalHadoop.scala:29)
at com.nicta.scoobi.application.InMemoryHadoop$class.withTimer(InMemory.scala:71)
at p.WordCount$.withTimer(scoobi-test.scala:6)
at com.nicta.scoobi.application.InMemoryHadoop$class.showTime(InMemory.scala:79)
at p.WordCount$.showTime(scoobi-test.scala:6)
at com.nicta.scoobi.application.LocalHadoop$class.onLocal(LocalHadoop.scala:29)
at p.WordCount$.onLocal(scoobi-test.scala:6)
at com.nicta.scoobi.application.Hadoop$class.onHadoop(Hadoop.scala:60)
at p.WordCount$.onHadoop(scoobi-test.scala:6)
at com.nicta.scoobi.application.ScoobiApp$class.main(ScoobiApp.scala:75)
at p.WordCount$.main(scoobi-test.scala:6)
at p.WordCount.main(scoobi-test.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
[trace] Stack trace suppressed: run last compile:runMain for the full output.
[INFO] Task - Communication exception: java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at org.apache.hadoop.mapred.Task$TaskReporter.run(Task.java:648)
at java.lang.Thread.run(Thread.java:679)
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last compile:runMain for the full output.
[error] (compile:runMain) Nonzero exit code: 1
[error] Total time: 9 s, completed Nov 24, 2013 3:55:30 AM
running the very similar example from github (https://github.com/NICTA/scoobi/tree/SCOOBI-0.7.3/examples/wordCount) does work.
any ideas?
EDIT
I ran the sample according to the explanations in scoobi quick start
running the sample is done using sbt commands:
sbt compile
sbt "run-main mypackage.myapp.WordCount input-files output"
There is no reference regarding how or where to supply parameters such as the location of external jars.
Installed scala version and the one specified in build.sbt must be same. Once this is same, scala-library is auto included into classpath.
We've faced the same issue recently and solved it by adding fork := true to the sbt settings.
My scala project uses sbt-extra with sbt.version 0.11.2 and scala version 2.9.1. When I try compiling my project (./sbt compile) I get a strange java.util.NoSuchElementException: head of empty listwith the following stack trace :
at scala.collection.immutable.Nil$.head(List.scala:371)
at scala.collection.immutable.Nil$.head(List.scala:368)
at scala.tools.nsc.symtab.Types$class.map2Conserve(Types.scala:4980)
at scala.tools.nsc.symtab.SymbolTable.map2Conserve(SymbolTable.scala:13)
at scala.tools.nsc.symtab.Types$class.map2Conserve(Types.scala:4981)
at scala.tools.nsc.symtab.SymbolTable.map2Conserve(SymbolTable.scala:13)
at scala.tools.nsc.symtab.Types$TypeMap.mapOverArgs(Types.scala:3207)
at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:3114)
at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:3522)
at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:3389)
at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:3130)
at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:3522)
at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:546)
at scala.tools.nsc.symtab.Types$Type.memberInfo(Types.scala:560)
at xsbt.API.defDef(API.scala:182)
at xsbt.API.xsbt$API$$definition(API.scala:258)
at xsbt.API$$anonfun$xsbt$API$$processDefinitions$1.apply(API.scala:244)
at xsbt.API$$anonfun$xsbt$API$$processDefinitions$1.apply(API.scala:244)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:200)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:200)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:38)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:200)
at scala.collection.mutable.ArrayOps.flatMap(ArrayOps.scala:38)
at xsbt.API.xsbt$API$$processDefinitions(API.scala:244)
at xsbt.API$$anonfun$mkStructure$3.apply(API.scala:242)
at xsbt.API$$anonfun$mkStructure$3.apply(API.scala:242)
at xsbt.Message$$anon$1.apply(Message.scala:8)
at xsbti.SafeLazy$$anonfun$apply$1.apply(SafeLazy.scala:8)
at xsbti.SafeLazy$Impl._t(SafeLazy.scala:20)
at xsbti.SafeLazy$Impl.get(SafeLazy.scala:24)
at xsbt.API$$anonfun$xsbt$API$$forceStructures$1.apply(API.scala:94)
at xsbt.API$$anonfun$xsbt$API$$forceStructures$1.apply(API.scala:94)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at xsbt.API.xsbt$API$$forceStructures(API.scala:94)
at xsbt.API$ApiPhase.processScalaUnit(API.scala:46)
at xsbt.API$ApiPhase.processUnit(API.scala:37)
at xsbt.API$ApiPhase$$anonfun$run$1.apply(API.scala:33)
at xsbt.API$ApiPhase$$anonfun$run$1.apply(API.scala:33)
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:316)
at xsbt.API$ApiPhase.run(API.scala:33)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:953)
at scala.tools.nsc.Global$Run.compile(Global.scala:1038)
at xsbt.CompilerInterface.run(CompilerInterface.scala:87)
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:57)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:29)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:25)
at sbt.AggressiveCompile$$anonfun$5.compileScala$1(AggressiveCompile.scala:67)
at sbt.AggressiveCompile$$anonfun$5.apply(AggressiveCompile.scala:79)
at sbt.AggressiveCompile$$anonfun$5.apply(AggressiveCompile.scala:57)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:21)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:19)
at sbt.inc.Incremental$.cycle(Incremental.scala:33)
at sbt.inc.Incremental$.compile(Incremental.scala:20)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:17)
at sbt.AggressiveCompile.compile2(AggressiveCompile.scala:87)
at sbt.AggressiveCompile.compile1(AggressiveCompile.scala:41)
at sbt.AggressiveCompile.apply(AggressiveCompile.scala:28)
at sbt.Compiler$.apply(Compiler.scala:107)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:479)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:479)
at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:473)
at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:473)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:41)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$11.apply(Structure.scala:295)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$11.apply(Structure.scala:295)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$5.work(System.scala:67)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:221)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:221)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:227)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221)
at sbt.CompletionService$$anon$1$$anon$2.call(CompletionService.scala:26)
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:441)
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:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
It is not mentioning any line of my code and this is a Runtime exception so I guess something is going wrong with sbt compile task itself but I can't figure out what.
Thanks in advance,
EDIT
Same error with scala 2.9.2 and sbt 0.12.2. I tried cleaning but it did not work.
The error was probably a bug of the compiler that was fix in scala 2.10.
It may be SI-5044 or SI-5862.
I upgraded to scala 2.10.1 and it works fine.