Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE running worksheet #178

Open
skyluc opened this issue Feb 18, 2014 · 5 comments
Open

NPE running worksheet #178

skyluc opened this issue Feb 18, 2014 · 5 comments
Labels

Comments

@skyluc
Copy link
Member

skyluc commented Feb 18, 2014

(Reported in assembla #1002052)

This line produces an NPE:

2014-02-17 10:23:24,580 ERROR [org.eclipse.jface.text.reconciler.MonoReconciler] - System.err - Exception in thread "org.eclipse.jface.text.reconciler.MonoReconciler"
2014-02-17 10:23:24,580 ERROR [org.eclipse.jface.text.reconciler.MonoReconciler] - System.err - java.lang.NullPointerException
2014-02-17 10:23:24,581 ERROR [org.eclipse.jface.text.reconciler.MonoReconciler] - System.err - at org.scalaide.worksheet.ScriptCompilationUnit.scalaProject$lzycompute(ScriptCompilationUnit.scala:33)
2014-02-17 10:23:24,581 ERROR [org.eclipse.jface.text.reconciler.MonoReconciler] - System.err - at org.scalaide.worksheet.ScriptCompilationUnit.scalaProject(ScriptCompilationUnit.scala:33)
2014-02-17 10:23:24,581 ERROR [org.eclipse.jface.text.reconciler.MonoReconciler] - System.err - at org.scalaide.worksheet.ScriptCompilationUnit.reconcile(ScriptCompilationUnit.scala:71)
2014-02-17 10:23:24,581 ERROR [org.eclipse.jface.text.reconciler.MonoReconciler] - System.err - at org.scalaide.worksheet.reconciler.ScalaReconcilingStrategy.reconcile(ScalaReconcilingStrategy.scala:31)
2014-02-17 10:23:24,581 ERROR [org.eclipse.jface.text.reconciler.MonoReconciler] - System.err - at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77)
2014-02-17 10:23:24,581 ERROR [org.eclipse.jface.text.reconciler.MonoReconciler] - System.err - at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
2014-02-17 10:23:25,119 ERROR [ForkJoinPool-1-worker-13] - System.err - WorksheetManager <actor>: caught java.lang.NullPointerException
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - java.lang.NullPointerException
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at org.scalaide.worksheet.ScriptCompilationUnit.scalaProject$lzycompute(ScriptCompilationUnit.scala:33)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at org.scalaide.worksheet.ScriptCompilationUnit.scalaProject(ScriptCompilationUnit.scala:33)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at org.scalaide.worksheet.runtime.WorksheetsManager.org$scalaide$worksheet$runtime$WorksheetsManager$$obtainEvaluator(WorksheetsManager.scala:59)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at org.scalaide.worksheet.runtime.WorksheetsManager$$anonfun$act$1$$anonfun$apply$1.applyOrElse(WorksheetsManager.scala:31)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at scala.runtime.AbstractPartialFunction$mcVL$sp.apply$mcVL$sp(AbstractPartialFunction.scala:33)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at scala.runtime.AbstractPartialFunction$mcVL$sp.apply(AbstractPartialFunction.scala:33)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at scala.runtime.AbstractPartialFunction$mcVL$sp.apply(AbstractPartialFunction.scala:25)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at scala.actors.ReactorTask.run(ReactorTask.scala:31)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at scala.actors.ReactorTask.compute(ReactorTask.scala:63)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at scala.concurrent.forkjoin.RecursiveAction.exec(RecursiveAction.java:160)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
2014-02-17 10:23:25,120 ERROR [ForkJoinPool-1-worker-13] - System.err - at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
@skyluc skyluc added the bug label Feb 18, 2014
@skyluc
Copy link
Member Author

skyluc commented Feb 18, 2014

Looking at the code, it has a few ways it can throw a NoSuchElementException, but not so much NPE.

I tried with a non-workspace file, but found a different problem #179.

@mrksmb
Copy link

mrksmb commented Feb 18, 2014

Luc,

Thanks for looking into this. I could not find anything unusual with this worksheet or product. The worksheet is located in a simple Scala project.

The only difference I noticed is that .scala files have a J icon in front of them in the Kepler Eclipse that has the problem, while my older Helios Eclipse has an S icon in front of .scala files. Both worksheets have the proper Eclipse icon in front of them and open in the Scala Script editor properly. In the Kepler preferences the Scala source code type hangs directly under the Java type. I tried to change that, but could not find out how. Uninstalling all Scala IDE components and reinstalling them did not help.

Maybe this gives you a hint.

Thanks, Markus

@skyluc
Copy link
Member Author

skyluc commented Feb 18, 2014

Hmm. It sounds like Scala IDE is not correctly installed.

Can you check in the 'Setup Diagnostics' (`Scala > Run Setup Diagnostics' from the Scala perspective), the check box in the first block (JDT Weaving) is set and grayed out?
Also, which flavor of Eclipse and other plugins are you using? It is possible that it is caused by some bad interaction.

@mrksmb
Copy link

mrksmb commented Feb 18, 2014

That is really interesting. I had run the diagnostics a couple times before, but when I ran it now and tested the spreadsheet again right after, the inline comments got added properly, like in the Helios IDE.

I am using a regular Eclipse:

Eclipse Standard/SDK
Version: Kepler Service Release 1
Build id: 20130919-0819

with Scala, PHP, and Java development tools added.

So I guess for me the issue is fixed now and the NullPointerException does not occur in the log file anymore.

@skyluc
Copy link
Member Author

skyluc commented Feb 18, 2014

I tried to reproduce your environment to reproduce the problem, but no luck.

When you have some time, it would great if you could create a second install of Eclipse, install the worksheet, and see if it works out-of-the-box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants