- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Eclipse Plugin Error: Build compiler (scalac) crashed
Thu, 2009-03-12, 19:30
Hi all,
I am looking into Scala to do model transformations in EMF and how it
compares to OAW's Xtend. When doing my very first steps in that
direction I got a "Build compiler (scalac) crashed" message in the
Eclipse Error Log.
Here is my Scala code:
import simple._
object FirstApp {
def main(args : Array[String]) : Unit = {
val f=SimpleFactory.eINSTANCE
f.createSimple()
}
}
The used EMF model is probably the second simplest possible: single
package called "simple", single Class, called "Simple". Single field
called "name" of type String. I generated the Java code with the
standard settings. Here is the contents of the .ecore file:
<?xml version="1.0" encoding="UTF-8"?>
The problem seems to be the access of the static field eINSTANCE. The
field does also not show up on code completion.
What am I doing wrong or is there a problem with Scala + EMF?
Here is the stack trace of the error message:
java.lang.Error: Unknown type:
at scala.tools.nsc.Global.abort(Global.scala:153)
at scala.tools.nsc.backend.icode.TypeKinds$class.toTypeKind(TypeKinds.scala:453)
at scala.tools.nsc.backend.icode.ICodes.toTypeKind(ICodes.scala:21)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:410)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genStat(GenICode.scala:183)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:146)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:145)
at scala.List.foreach(List.scala:834)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genStat(GenICode.scala:145)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:938)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:114)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
at scala.List.foreach(List.scala:834)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:71)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:136)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:90)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
at scala.List.foreach(List.scala:834)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:71)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:81)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
at scala.List.foreach(List.scala:834)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:71)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:81)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:67)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:63)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:267)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:246)
at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:246)
at scala.Iterator$class.foreach(Iterator.scala:414)
at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:266)
at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:246)
at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:56)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:574)
at scala.tools.nsc.Global$Run.compile(Global.scala:667)
at scala.tools.eclipse.BuildCompiler.build(BuildCompiler.scala:114)
at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.build(ScalaPlugin.scala:405)
at scala.tools.eclipse.Driver$Project.build(Driver.scala:16)
at lampion.eclipse.Builder.build(Builder.scala:87)
at scala.tools.eclipse.Builder.build(Builder.scala:32)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
When just hovering the mouse over the .eINSTANCE field in the code
above, an empty hover pops up and the following error message is logged
in the Eclipse error log:
Message: No message
Stack Trace:
java.lang.AssertionError: assertion failed: value createSimple
at scala.Predef$.assert(Predef.scala:92)
at scala.tools.nsc.symtab.Symbols$Symbol.fullNameString(Symbols.scala:1237)
at scala.tools.nsc.symtab.Symbols$Symbol.fullNameString(Symbols.scala:1247)
at scala.tools.editor.TypersPresentations$ProjectImpl$FileImpl$TokenImpl$$anonfun$hover$3$$anonfun$apply$5.apply(TypersPresentations.scala:398)
at scala.tools.editor.TypersPresentations$ProjectImpl$FileImpl$TokenImpl$$anonfun$hover$3$$anonfun$apply$5.apply(TypersPresentations.scala:393)
at lampion.eclipse.UIPlugin$ProjectImpl$$anon$7.run(UIPlugin.scala:421)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3378)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3036)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Best regards,
Alex
PS: Using Scaltrans is not a option for me, as other parts of my MDA
tool chain depend on the original EMF code.
Hi Alexander,
Please report crashes to Scala's trac bug tracker -
http://lampsvn.epfl.ch/trac/scala . Ideally, verify outside Eclipse
first, so that it gets to the right people quicker, but it's ok if you
don't have time for that extra step.
Ricky.
2009/3/12 Alexander Fried :
> Hi all,
>
> I am looking into Scala to do model transformations in EMF and how it
> compares to OAW's Xtend. When doing my very first steps in that
> direction I got a "Build compiler (scalac) crashed" message in the
> Eclipse Error Log.
> Here is my Scala code:
>
> import simple._
>
> object FirstApp {
>
> def main(args : Array[String]) : Unit = {
>
> val f=SimpleFactory.eINSTANCE
>
> f.createSimple()
>
> }
>
> }
>
>
> The used EMF model is probably the second simplest possible: single
> package called "simple", single Class, called "Simple". Single field
> called "name" of type String. I generated the Java code with the
> standard settings. Here is the contents of the .ecore file:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
>
> xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="simple"
>
> nsURI="simple" nsPrefix="simple">
>
>
>
>
>
>
>
>
>
>
> The problem seems to be the access of the static field eINSTANCE. The
> field does also not show up on code completion.
>
> What am I doing wrong or is there a problem with Scala + EMF?
>
>
> Here is the stack trace of the error message:
>
> java.lang.Error: Unknown type:
>
> at scala.tools.nsc.Global.abort(Global.scala:153)
>
> at scala.tools.nsc.backend.icode.TypeKinds$class.toTypeKind(TypeKinds.scala:453)
>
> at scala.tools.nsc.backend.icode.ICodes.toTypeKind(ICodes.scala:21)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:410)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genStat(GenICode.scala:183)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:146)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:145)
>
> at scala.List.foreach(List.scala:834)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genStat(GenICode.scala:145)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:938)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:114)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
>
> at scala.List.foreach(List.scala:834)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:71)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:136)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:90)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
>
> at scala.List.foreach(List.scala:834)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:71)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:81)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
>
> at scala.List.foreach(List.scala:834)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:71)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:81)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:67)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:63)
>
> at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:267)
>
> at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:246)
>
> at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:246)
>
> at scala.Iterator$class.foreach(Iterator.scala:414)
>
> at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:266)
>
> at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:246)
>
> at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:56)
>
> at scala.tools.nsc.Global$Run.compileSources(Global.scala:574)
>
> at scala.tools.nsc.Global$Run.compile(Global.scala:667)
>
> at scala.tools.eclipse.BuildCompiler.build(BuildCompiler.scala:114)
>
> at scala.tools.eclipse.ScalaPlugin$ProjectImpl$class.build(ScalaPlugin.scala:405)
>
> at scala.tools.eclipse.Driver$Project.build(Driver.scala:16)
>
> at lampion.eclipse.Builder.build(Builder.scala:87)
>
> at scala.tools.eclipse.Builder.build(Builder.scala:32)
>
> at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
>
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>
> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
>
> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
>
> at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
>
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>
> at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
>
> at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309)
>
> at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341)
>
> at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
>
> at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
>
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
>
> When just hovering the mouse over the .eINSTANCE field in the code
> above, an empty hover pops up and the following error message is logged
> in the Eclipse error log:
> Message: No message
> Stack Trace:
>
> java.lang.AssertionError: assertion failed: value createSimple
>
> at scala.Predef$.assert(Predef.scala:92)
>
> at scala.tools.nsc.symtab.Symbols$Symbol.fullNameString(Symbols.scala:1237)
>
> at scala.tools.nsc.symtab.Symbols$Symbol.fullNameString(Symbols.scala:1247)
>
> at scala.tools.editor.TypersPresentations$ProjectImpl$FileImpl$TokenImpl$$anonfun$hover$3$$anonfun$apply$5.apply(TypersPresentations.scala:398)
>
> at scala.tools.editor.TypersPresentations$ProjectImpl$FileImpl$TokenImpl$$anonfun$hover$3$$anonfun$apply$5.apply(TypersPresentations.scala:393)
>
> at lampion.eclipse.UIPlugin$ProjectImpl$$anon$7.run(UIPlugin.scala:421)
>
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
>
> at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
>
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3378)
>
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3036)
>
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
>
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
>
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
>
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
>
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
>
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
>
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
>
> at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
>
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
>
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
>
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
>
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
>
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
>
> 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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
>
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
>
> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
>
>
> Best regards,
> Alex
>
> PS: Using Scaltrans is not a option for me, as other parts of my MDA
> tool chain depend on the original EMF code.
>
>
>
>