actually using 2.0.0.201105252341true-7dd4324
When editing source code the following exception is repeatedly thrown:
When editing source code the following exception is repeatedly thrown:
eclipse.buildId=M20110210-1200
java.version=1.6.0_22
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86
Error
Fri May 27 01:50:17 IDT 2011
Error during askOption
java.lang.NoClassDefFoundError: scala/reflect/internal/Trees
at scala.tools.refactoring.implementations.MarkOccurrences.<init>(MarkOccurrences.scala:10)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1$$anon$1.<init>(ScalaOccurrencesFinder.scala:19)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1.apply(ScalaOccurrencesFinder.scala:19)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1.apply(ScalaOccurrencesFinder.scala:18)
at scala.tools.eclipse.ScalaPresentationCompiler.askOption(ScalaPresentationCompiler.scala:97)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1.apply(ScalaOccurrencesFinder.scala:18)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1.apply(ScalaOccurrencesFinder.scala:17)
at scala.tools.eclipse.ScalaPresentationCompiler.withSourceFile(ScalaPresentationCompiler.scala:65)
at scala.tools.eclipse.ScalaProject$$anonfun$withSourceFile$1.apply(ScalaProject.scala:450)
at scala.tools.eclipse.ScalaProject$$anonfun$withSourceFile$1.apply(ScalaProject.scala:449)
at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:443)
at scala.tools.eclipse.ScalaProject$$anonfun$withPresentationCompiler$1.apply(ScalaProject.scala:442)
at scala.tools.eclipse.util.Cached$class.apply(Cached.scala:52)
at scala.tools.eclipse.ScalaProject$$anon$1.apply(ScalaProject.scala:43)
at scala.tools.eclipse.ScalaProject.withPresentationCompiler(ScalaProject.scala:442)
at scala.tools.eclipse.ScalaProject.withSourceFile(ScalaProject.scala:451)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$class.withSourceFile(ScalaCompilationUnit.scala:46)
at scala.tools.eclipse.javaelements.ScalaSourceFile.withSourceFile(ScalaSourceFile.scala:39)
at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder.findOccurrences(ScalaOccurrencesFinder.scala:39)
at scala.tools.eclipse.ScalaSourceFileEditor.getAnnotations(ScalaSourceFileEditor.scala:137)
at scala.tools.eclipse.ScalaSourceFileEditor.scala$tools$eclipse$ScalaSourceFileEditor$$performOccurrencesUpdate(ScalaSourceFileEditor.scala:118)
at scala.tools.eclipse.ScalaSourceFileEditor$$anon$2.run(ScalaSourceFileEditor.scala:156)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.ClassNotFoundException: scala.reflect.internal.Trees
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 23 more
Leave a comment
on 2011-06-19 12:52 *
By Iulian Dragos
Summary changed from Error while editing source code - Error during askOption to java.lang.NoClassDefFoundError: scala/reflect/internal/Trees in trunk
Mirko, this is to due to the move of some classes in 2.10 from scala.tools.nsc.symtab to scala.reflect.internal. You need to add an Import-Package to your MANIFEST.MF in scala-refactoring (not sure if you need to make it optional, so that it works with 2.9/2.8 as well?).
on 2011-06-20 07:35 *
By Mirko Stocker
Ok, I'll do that. Thanks!
on 2011-06-20 18:35 *
By Mirko Stocker
What I don't quite understand, why does my build and tests run with the latest 2.10?
on 2011-06-20 18:38 *
By Iulian Dragos
Are you running them inside an OSGI container?
on 2011-06-20 18:40 *
By Mirko Stocker
Ah, no I don't..
on 2011-06-20 18:44 *
By Iulian Dragos
Then that's why... the OSGI bundle resolution will not delegate scala.reflect.internal to the compiler bundle unless the package is specifically imported in your MANIFEST.MF (the scala compiler does not consider MANIFEST.MF files for visibility, though there have been requests for that).
Now I understand it, thanks. I've added an optional import and it seems to fix the problem.
on 2016-02-07 19:58 *
By umesh.java
Hi Mirko Stocker , I am the new scala user and facing the same issue. Could you please help that how you added and optional import?
on 2016-02-07 21:01 *
By Simon Schäfer
@umesh.java please ask questions on the mailing list: https://groups.google.com/forum/#!forum/scala-ide-user
No file chosen
You have an empty file field. Please select or remove it.
Name | Size |
---|