The Scala worksheet doesn't evaluate results consistently.
Mostly it does not evaluate results. But sometimes it does.
Mostly it does not evaluate results. But sometimes it does.
object stuff {
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet
def factorial(n:Int): Int = {
def loop(acc: Int, n: Int):Int =
if (n==0) acc
else loop(acc * n, n -1)
loop(1, n)
} //> factorial: (n: Int)Int
7 + 2
factorial(5) //> res0: Int = 120
factorial(7)
println("Hello!")
val x = List(1, 2, 3)
val y = for (e <- x) yield e * 2
println(y)
}
Leave a comment
I cannot reproduce the problem. The given code works perfectly well on a fresh install of Scala IDE 3.0.2-210 on Linux for me.
Do you see anything interesting in the logs? In
Do you see anything interesting in the logs? In
Window > Show View > Error Log
, and Scala > Open the Log
.
on 2014-03-27 14:40 *
By Iulian Dragos
Is this a full session, or two separate sessions pasted in one go? In other words, does it stop producing output in the middle of a session?
If it's stopping producing any output, it could be a duplicate of: issue 129. Good news, it should be fixed in the next release (due in a matter of days, if not hours.
If it's stopping producing any output, it could be a duplicate of: issue 129. Good news, it should be fixed in the next release (due in a matter of days, if not hours.
I looked at Issue 129 and although it has the same symptoms, the errors are different. And this problem is with a very recent version of the IDE.
This was done on a very recent, totally fresh install on Scala IDE:
Build id: 3.0.2-vfinal-20131028-1923-Typesafe
on Ubuntu 13.10:
Linux 3.11.0-18-generic #32-Ubuntu SMP Tue Feb 18 21:11:14 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
This was in the Scala log:
2014-03-26 11:08:32,208 ERROR [Worker-1] - System.err - SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2014-03-26 11:08:32,211 ERROR [Worker-1] - System.err - SLF4J: Defaulting to no-operation (NOP) logger implementation
2014-03-26 11:08:32,212 ERROR [Worker-1] - System.err - SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
This was in the Eclipse log:
java.lang.IllegalArgumentException:
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:47)
at org.eclipse.ui.internal.ide.undo.ProjectDescription.<init>(ProjectDescription.java:46)
at org.eclipse.ui.internal.ide.undo.ContainerDescription.fromContainer(ContainerDescription.java:110)
at org.eclipse.ui.internal.ide.undo.ContainerDescription.fromContainer(ContainerDescription.java:65)
at org.eclipse.ui.ide.undo.CreateFileOperation.<init>(CreateFileOperation.java:71)
at org.eclipse.ui.dialogs.WizardNewFileCreationPage$4.run(WizardNewFileCreationPage.java:437)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
java.lang.NullPointerException
at org.eclipse.ui.dialogs.WizardNewFileCreationPage.createNewFile(WizardNewFileCreationPage.java:378)
at org.scalaide.worksheet.wizards.NewWorksheetWizard.performFinish(NewWorksheetWizard.scala:26)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:628)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3363)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:826)
at org.eclipse.jface.window.Window.open(Window.java:802)
at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:135)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3363)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
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:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
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:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
eclipse.buildId=3.0.2-vfinal-20131028-1923-Typesafe
java.version=1.7.0_51
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64
Just now opening a new worksheet resulted in the dialog box message:
"Worksheet process has terminated unexpectedly (exit value 143)
At the time of the termination, the following text was available in the output streams:"
[No text in either stream in the message]
This was done on a very recent, totally fresh install on Scala IDE:
Build id: 3.0.2-vfinal-20131028-1923-Typesafe
on Ubuntu 13.10:
Linux 3.11.0-18-generic #32-Ubuntu SMP Tue Feb 18 21:11:14 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
This was in the Scala log:
2014-03-26 11:08:32,208 ERROR [Worker-1] - System.err - SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2014-03-26 11:08:32,211 ERROR [Worker-1] - System.err - SLF4J: Defaulting to no-operation (NOP) logger implementation
2014-03-26 11:08:32,212 ERROR [Worker-1] - System.err - SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
This was in the Eclipse log:
java.lang.IllegalArgumentException:
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:47)
at org.eclipse.ui.internal.ide.undo.ProjectDescription.<init>(ProjectDescription.java:46)
at org.eclipse.ui.internal.ide.undo.ContainerDescription.fromContainer(ContainerDescription.java:110)
at org.eclipse.ui.internal.ide.undo.ContainerDescription.fromContainer(ContainerDescription.java:65)
at org.eclipse.ui.ide.undo.CreateFileOperation.<init>(CreateFileOperation.java:71)
at org.eclipse.ui.dialogs.WizardNewFileCreationPage$4.run(WizardNewFileCreationPage.java:437)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
java.lang.NullPointerException
at org.eclipse.ui.dialogs.WizardNewFileCreationPage.createNewFile(WizardNewFileCreationPage.java:378)
at org.scalaide.worksheet.wizards.NewWorksheetWizard.performFinish(NewWorksheetWizard.scala:26)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:628)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3363)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:826)
at org.eclipse.jface.window.Window.open(Window.java:802)
at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:135)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3742)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3363)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
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:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
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:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
eclipse.buildId=3.0.2-vfinal-20131028-1923-Typesafe
java.version=1.7.0_51
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64
Just now opening a new worksheet resulted in the dialog box message:
"Worksheet process has terminated unexpectedly (exit value 143)
At the time of the termination, the following text was available in the output streams:"
[No text in either stream in the message]
No file chosen
You have an empty file field. Please select or remove it.
Name | Size |
---|