Problem while trying to load .scala file with the new Eclipse plugin
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/119
Reporter martin-g
Hi,
I am trying to load a very simple Scala source file:
package org.homeunix.marto.scaling;
Environment:
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)
OS: Linux Debian lenny
Eclipse 3.3
Plugin: 2.6.1.B1
Let me know if you need more information.
Kind regards
Martin
Reporter martin-g
Hi,
I am trying to load a very simple Scala source file:
package org.homeunix.marto.scaling;
object Hello {
def main(args : Array[String]) : Unit = {
Console.println("Hello scala");
Console.println(Hello test 3);
}
def test(chislo: int) : long = {
return chislo * chislo;
}
}
and I see this in the Error log view:java.lang.AssertionError: assertion failed: REFERENCE to null class symbol.
at scala.Predef$.assert(Predef.scala:96)
at scala.tools.nsc.backend.icode.TypeKinds$REFERENCE.<init>(TypeKinds.scala:227)
at scala.tools.nsc.backend.icode.ICodes.init(ICodes.scala:67)
at scala.tools.nsc.Global$Run.<init>(Global.scala:456)
at scala.tools.editor.Tokenizers$FileImpl$class.loaded(Tokenizers.scala:216)
at scala.tools.eclipse.Driver$Project$File.loaded(Driver.scala:13)
at lampion.eclipse.SourceViewer.load(SourceViewer.scala:152)
at lampion.eclipse.Editor$$anon$0.load(Editor.scala:268)
at lampion.eclipse.SourceViewer.inputDocumentChanged(SourceViewer.scala:132)
at org.eclipse.jface.text.TextViewer.fireInputDocumentChanged(TextViewer.java:2685)
at org.eclipse.jface.text.TextViewer.setDocument(TextViewer.java:2734)
at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:518)
at org.eclipse.jface.text.source.projection.ProjectionViewer.setDocument(ProjectionViewer.java:370)
at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:473)
at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer(AbstractTextEditor.java:3786)
at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3332)
at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:53)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:378)
at lampion.eclipse.Editor.createPartControl(Editor.scala:144)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:426)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:592)
at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:263)
at org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor(WorkbenchPage.java:1202)
at org.eclipse.ui.internal.WorkbenchPage.updateActivePart(WorkbenchPage.java:1160)
at org.eclipse.ui.internal.WorkbenchPage.partAdded(WorkbenchPage.java:1569)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:210)
at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:774)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:673)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:634)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2719)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2633)
at org.eclipse.ui.internal.WorkbenchPage.access$12(WorkbenchPage.java:2625)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2577)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2572)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2556)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2547)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:644)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:603)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:285)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:138)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:194)
at scala.tools.eclipse.navigator.OpenActionProvider$MyOpenAction.run(OpenActionProvider.scala:70)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:175)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:268)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:244)
at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(OpenAndExpand.java:50)
at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:220)
at org.eclipse.ui.internal.navigator.CommonNavigatorManager$3.open(CommonNavigatorManager.java:181)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:818)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1079)
at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:353)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3319)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
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:504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
Scenario: I removed .project, .classpath and .manager from my old Scala project, created a new Scala project (with the new plugin) at the same location and now when I try to load some of my classes I am expiriencing this problem.Environment:
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)
OS: Linux Debian lenny
Eclipse 3.3
Plugin: 2.6.1.B1
Let me know if you need more information.
Kind regards
Martin
Leave a comment
on 2007-09-20 12:23 *
By tracImporter
Trac author: mcdirmid
Strange. Your plugin is not initializing correctly, this has nothing to do with your code. Any chance that you aren't setup right? Did you do a clean build first? Is "Builds Automatically" enabled? Also, what version of Eclipse are you using? Also, what does your .classpath file look like? It could be that your .classpath file refers to an outdated Scala library.
Strange. Your plugin is not initializing correctly, this has nothing to do with your code. Any chance that you aren't setup right? Did you do a clean build first? Is "Builds Automatically" enabled? Also, what version of Eclipse are you using? Also, what does your .classpath file look like? It could be that your .classpath file refers to an outdated Scala library.
on 2007-09-25 23:17 *
By tracImporter
Trac author: martin-g
I updated the plugin to 2.6.1.B3 and now at least I can load my
.scala files, but I could not execute any class with main() method
or classes which extend scala.Application. There is no Run As "Scala
Application" entry. Creating of a launch configuration doesn't work
either - it can't find any Main Class in my project.
Additionally I have a lot of these in the error logs:
!ENTRY org.eclipse.debug.core 4 5020 2007-09-25 19:13:02.637
!MESSAGE Launch configuration type id "ch.epfl.lamp.sdt.core.launching.scalaApplication" does not exist.
Possible causes:
Missing specification of a launch type (missing plug-in)
Incorrect launch configuration XML
Maybe this is the main cause of my problems ?!
My eclipse version is : 3.3.0. Build id: I20070621-1340.
I'm attaching my .project and .classpath files.
I updated the plugin to 2.6.1.B3 and now at least I can load my
.scala files, but I could not execute any class with main() method
or classes which extend scala.Application. There is no Run As "Scala
Application" entry. Creating of a launch configuration doesn't work
either - it can't find any Main Class in my project.
Additionally I have a lot of these in the error logs:
!ENTRY org.eclipse.debug.core 4 5020 2007-09-25 19:13:02.637
!MESSAGE Launch configuration type id "ch.epfl.lamp.sdt.core.launching.scalaApplication" does not exist.
Possible causes:
Missing specification of a launch type (missing plug-in)
Incorrect launch configuration XML
Maybe this is the main cause of my problems ?!
My eclipse version is : 3.3.0. Build id: I20070621-1340.
I'm attaching my .project and .classpath files.
on 2007-09-25 23:18 *
By tracImporter
on 2007-09-25 23:19 *
By tracImporter
Trac author: martin-g
Finally I made it work!
I removed $WORKSPACE/.metadata/plugins/* and
I typed the fully qualified name of my main class in Run As ->
Scala Application -> tab Main -> field "Main class". Previous
times I expected plugin to find it automatically - with the "Search"
button. Obviously this is not implemented yet.
I am closing this ticket. If I have another problem(s) I will create
a new one.
Thanks!
Finally I made it work!
I removed $WORKSPACE/.metadata/plugins/* and
I typed the fully qualified name of my main class in Run As ->
Scala Application -> tab Main -> field "Main class". Previous
times I expected plugin to find it automatically - with the "Search"
button. Obviously this is not implemented yet.
I am closing this ticket. If I have another problem(s) I will create
a new one.
Thanks!
on 2007-11-30 16:50 *
By tracImporter
Trac author: dubochet
Description changed.
Description changed.
on 2008-04-08 19:50 *
By tracImporter
Closed As: worksforme