java.lang.NoSuchMethodError: scala.tools.nsc.typechecker.Namers$Namer.enterExistingSym

686 views
Skip to first unread message

Carsten Schnober

unread,
Mar 16, 2015, 6:02:46 AM3/16/15
to scala-i...@googlegroups.com
Hi,
I am trying to import a Scala project into Eclipse/Scala IDE from https://github.com/scalanlp/breeze. I clone the repository and run `sbt eclipse` on Ubuntu 14.04, using sbt version 0.13.7. There are actually 5 sub-projects, so the output is:

[info] Successfully created Eclipse project files for project(s):
[info] breeze-viz
[info] breeze
[info] breeze-macros
[info] breeze-natives
[info] breeze-benchmark

Looks all good. So I import the projects in Eclipse. However, when the workspace is built for the project `breeze-macros`, there is the following errors:

  • Error in Scala compiler: scala.tools.nsc.typechecker.Namers$Namer.enterExistingSym(Lscala/reflect/internal/Symbols$Symbol;)Lscala/tools/nsc/typechecker/Contexts$Context;
  • SBT builder crashed while compiling. The error message is 'scala.tools.nsc.typechecker.Namers$Namer.enterExistingSym(Lscala/reflect/internal/Symbols$Symbol;)Lscala/tools/nsc/typechecker/Contexts$Context;'. Check Error Log for details.
The Eclipse log file reports the following:

!ENTRY org.scala-ide.sdt.core 4 0 2015-03-16 09:54:38.759
!MESSAGE Error in Scala compiler
!STACK 0
java.lang.NoSuchMethodError: scala.tools.nsc.typechecker.Namers$Namer.enterExistingSym(Lscala/reflect/internal/Symbols$Symbol;)Lscala/tools/nsc/typechecker/Contexts$Context;
    at org.scalamacros.paradise.typechecker.Namers$Namer$class.enterSym(Namers.scala:41)
    at org.scalamacros.paradise.typechecker.Namers$$anon$3.enterSym(Namers.scala:13)
    at org.scalamacros.paradise.typechecker.AnalyzerPlugins$MacroPlugin$.pluginsEnterSym(AnalyzerPlugins.scala:35)
    at scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$13.custom(AnalyzerPlugins.scala:429)
    at scala.tools.nsc.typechecker.AnalyzerPlugins$$anonfun$2.apply(AnalyzerPlugins.scala:371)
    at scala.tools.nsc.typechecker.AnalyzerPlugins$$anonfun$2.apply(AnalyzerPlugins.scala:371)
    at scala.collection.immutable.List.map(List.scala:273)
    at scala.tools.nsc.typechecker.AnalyzerPlugins$class.invoke(AnalyzerPlugins.scala:371)
    at scala.tools.nsc.typechecker.AnalyzerPlugins$class.pluginsEnterSym(AnalyzerPlugins.scala:423)
    at scala.tools.nsc.Global$$anon$1.pluginsEnterSym(Global.scala:463)
    at scala.tools.nsc.typechecker.Namers$Namer.enterSym(Namers.scala:274)
    at scala.tools.nsc.typechecker.Typers$Typer.enterSym(Typers.scala:1855)
    at scala.tools.nsc.typechecker.Typers$Typer.enterSyms(Typers.scala:1850)
    at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1891)
    at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1762)
    at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5309)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
    at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5452)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3046)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3150)
    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$62.apply(Typers.scala:3150)
    at scala.collection.immutable.List.loop$1(List.scala:173)
    at scala.collection.immutable.List.mapConserve(List.scala:189)
    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3150)
    at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5012)
    at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5312)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5396)
    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5423)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5370)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5374)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5448)
    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:102)
    at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:441)
    at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:432)
    at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:441)
    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:94)
    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:93)
    at scala.collection.Iterator$class.foreach(Iterator.scala:750)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
    at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1500)
    at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1487)
    at scala.tools.nsc.Global$Run.compileSources(Global.scala:1482)
    at scala.tools.nsc.Global$Run.compile(Global.scala:1580)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
    at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:97)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:97)
    at sbt.compiler.AggressiveCompile$$anonfun$3$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:97)
    at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:162)
    at sbt.compiler.AggressiveCompile$$anonfun$3.compileScala$1(AggressiveCompile.scala:96)
    at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:139)
    at sbt.compiler.AggressiveCompile$$anonfun$3.apply(AggressiveCompile.scala:86)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:38)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:36)
    at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:31)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:39)
    at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:38)
    at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:66)
    at sbt.inc.Incremental$.compile(Incremental.scala:38)
    at sbt.inc.IncrementalCompile$.apply(Compile.scala:26)
    at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:153)
    at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:70)
    at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:45)
    at org.scalaide.core.internal.builder.zinc.EclipseSbtBuildManager.aggressiveCompile(EclipseSbtBuildManager.scala:214)
    at org.scalaide.core.internal.builder.zinc.EclipseSbtBuildManager.runCompiler(EclipseSbtBuildManager.scala:148)
    at org.scalaide.core.internal.builder.zinc.EclipseSbtBuildManager.update(EclipseSbtBuildManager.scala:134)
    at org.scalaide.core.internal.builder.zinc.EclipseSbtBuildManager.build(EclipseSbtBuildManager.scala:95)
    at org.scalaide.core.internal.project.ScalaProject.build(ScalaProject.scala:579)
    at org.scalaide.core.internal.builder.ScalaBuilder.build(ScalaBuilder.scala:127)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

I've come across similar reports of which I am not entirely sure whether they are rooted at the same issue here:
I just realised that the sbt Eclipse plugin is version 0.13.6 while the sbt version I built the project with on command line is 0.13.7. I am not sure whether there is any connection though and there is no updated version of the Eclipse plugin available. Being not quite familiar with the Scala IDE internals, I cannot really say whether this points to a relevant direction though.

Thanks for any help!
Carsten

iulian dragos

unread,
Mar 16, 2015, 3:07:00 PM3/16/15
to scala-i...@googlegroups.com
On Mon, Mar 16, 2015 at 3:01 AM, Carsten Schnober <schn...@ukp.informatik.tu-darmstadt.de> wrote:
Hi,
I am trying to import a Scala project into Eclipse/Scala IDE from https://github.com/scalanlp/breeze. I clone the repository and run `sbt eclipse` on Ubuntu 14.04, using sbt version 0.13.7. There are actually 5 sub-projects, so the output is:

[info] Successfully created Eclipse project files for project(s):
[info] breeze-viz
[info] breeze
[info] breeze-macros
[info] breeze-natives
[info] breeze-benchmark

Looks all good. So I import the projects in Eclipse. However, when the workspace is built for the project `breeze-macros`, there is the following errors:

  • Error in Scala compiler: scala.tools.nsc.typechecker.Namers$Namer.enterExistingSym(Lscala/reflect/internal/Symbols$Symbol;)Lscala/tools/nsc/typechecker/Contexts$Context;
  • SBT builder crashed while compiling. The error message is 'scala.tools.nsc.typechecker.Namers$Namer.enterExistingSym(Lscala/reflect/internal/Symbols$Symbol;)Lscala/tools/nsc/typechecker/Contexts$Context;'. Check Error Log for details.
The Eclipse log file reports the following:

!ENTRY org.scala-ide.sdt.core 4 0 2015-03-16 09:54:38.759
!MESSAGE Error in Scala compiler
!STACK 0
java.lang.NoSuchMethodError: scala.tools.nsc.typechecker.Namers$Namer.enterExistingSym(Lscala/reflect/internal/Symbols$Symbol;)Lscala/tools/nsc/typechecker/Contexts$Context;
    at org.scalamacros.paradise.typechecker.Namers$Namer$class.enterSym(Namers.scala:41)
    at org.scalamacros.paradise.typechecker.Namers$$anon$3.enterSym(Namers.scala:13)
    at org.scalamacros.paradise.typechecker.AnalyzerPlugins$MacroPlugin$.pluginsEnterSym(AnalyzerPlugins.scala:35)

It's using macro-paradise, which is a compiler plugin. You need a perfect match between the compiler plugin and build compiler, so make sure they do match. Is this a 2.10 project, by the way?

You can add an existing Scala installation, assuming the macro paradise is for a different version of 2.10 than the one shipped with the IDE (Preferences/Scala/Scala Installations).

iulian
 

--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/dc018e04-8cc6-43b8-8279-191c17f4e8f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

Carsten Schnober

unread,
Mar 17, 2015, 5:31:12 AM3/17/15
to scala-i...@googlegroups.com
Hi Iulian,


Am 16.03.2015 um 20:06 schrieb iulian dragos:

Hi Iulian,
Thanks for the pointer, this has been the cause indeed.

> It's using macro-paradise, which is a compiler plugin. You need a
> perfect match between the compiler plugin and build compiler, so make
> sure they do match. Is this a 2.10 project, by the way?

> You can add an existing Scala installation, assuming the macro paradise
> is for a different version of 2.10 than the one shipped with the IDE
> (Preferences/Scala/Scala Installations).
>

It is a SBT project which specificied Scala 2.11.4 and 2.10.x for
cross-compiling. SBT Eclipse uses Scala 2.11.6 though.
So what I did is to change the Scala version in build.sbt and ran sbt
compile so that Ivy retrieved the appropriate Paradise version (2.11.6
instead of 2.11.4). Subsequently, I adapted the path to the compiler
plugin in Eclipse to point the newly downloaded version.

This does not seem very intuitive and as a Scala IDE newbie I wonder
whether there would have been a more elegant solution. Anyway, thank you
very much!

Carsten


--
Carsten Schnober
Doctoral Researcher
Ubiquitous Knowledge Processing (UKP) Lab
FB 20 / Computer Science Department
Technische Universität Darmstadt
Hochschulstr. 10, D-64289 Darmstadt, Germany
phone [+49] (0)6151 16-6227, fax -5455, room S2/02/B111
schn...@ukp.informatik.tu-darmstadt.de
www.ukp.tu-darmstadt.de

Web Research at TU Darmstadt (WeRC): www.werc.tu-darmstadt.de
GRK 1994: Adaptive Preparation of Information from Heterogeneous Sources
(AIPHES): www.aiphes.tu-darmstadt.de
PhD program: Knowledge Discovery in Scientific Literature (KDSL)
www.kdsl.tu-darmstadt.de

iulian dragos

unread,
Mar 17, 2015, 12:41:54 PM3/17/15
to scala-i...@googlegroups.com
On Tue, Mar 17, 2015 at 2:30 AM, Carsten Schnober <schn...@ukp.informatik.tu-darmstadt.de> wrote:
Hi Iulian,


Am 16.03.2015 um 20:06 schrieb iulian dragos:

Hi Iulian,
Thanks for the pointer, this has been the cause indeed.

> It's using macro-paradise, which is a compiler plugin. You need a
> perfect match between the compiler plugin and build compiler, so make
> sure they do match. Is this a 2.10 project, by the way?

> You can add an existing Scala installation, assuming the macro paradise
> is for a different version of 2.10 than the one shipped with the IDE
> (Preferences/Scala/Scala Installations).
>

It is a SBT project which specificied Scala 2.11.4 and 2.10.x for
cross-compiling. SBT Eclipse uses Scala 2.11.6 though.
So what I did is to change the Scala version in build.sbt and ran sbt
compile so that Ivy retrieved the appropriate Paradise version (2.11.6
instead of 2.11.4). Subsequently, I adapted the path to the compiler
plugin in Eclipse to point the newly downloaded version.

This does not seem very intuitive and as a Scala IDE newbie I wonder
whether there would have been a more elegant solution. Anyway, thank you
very much!

You're absolutely right, we should fix that. Unfortunately the Scala compiler isn't very robust when it comes to incompatible plugins, but we could use some corss-version-based heuristics (we already validate classpath entries in this way, but compiler plugins are not part of the classpath).

iulian

 

Carsten


--
Carsten Schnober
Doctoral Researcher
Ubiquitous Knowledge Processing (UKP) Lab
FB 20 / Computer Science Department
Technische Universität Darmstadt
Hochschulstr. 10, D-64289 Darmstadt, Germany
phone [+49] (0)6151 16-6227, fax -5455, room S2/02/B111
schn...@ukp.informatik.tu-darmstadt.de
www.ukp.tu-darmstadt.de

Web Research at TU Darmstadt (WeRC): www.werc.tu-darmstadt.de
GRK 1994: Adaptive Preparation of Information from Heterogeneous Sources
(AIPHES): www.aiphes.tu-darmstadt.de
PhD program: Knowledge Discovery in Scientific Literature (KDSL)
www.kdsl.tu-darmstadt.de
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages