Invalid dependency on IScalaPlugin.class

114 views
Skip to first unread message

Felix Mayer

unread,
Feb 4, 2015, 4:03:15 PM2/4/15
to scala-i...@googlegroups.com
I am working on an Eclipse plugin that depends on the Eclipse Scala IDE. Since a few days, I get the error message below for my Eclipse project. So I got the latest Scala IDE from the update site, and the issue is still there. Is this a real problem?

missing or invalid dependency detected while loading class file 'IScalaPlugin.class'. Could not access term nsc in package scala.tools, because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.) A full rebuild may help if 'IScalaPlugin.class' was compiled against an incompatible version of scala.tools.

Simon Schäfer

unread,
Feb 5, 2015, 4:48:23 PM2/5/15
to scala-i...@googlegroups.com

On 02/04/2015 10:03 PM, Felix Mayer wrote:
I am working on an Eclipse plugin that depends on the Eclipse Scala IDE. Since a few days, I get the error message below for my Eclipse project. So I got the latest Scala IDE from the update site, and the issue is still there. Is this a real problem?

missing or invalid dependency detected while loading class file 'IScalaPlugin.class'. Could not access term nsc in package scala.tools, because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.) A full rebuild may help if 'IScalaPlugin.class' was compiled against an incompatible version of scala.tools.
Eclipse plugins live in an OSGi environment, I guess you get this error because you forgot to allow your plugin to access scala.tools.nsc. Do you have the bundle of the compiler in the list of the required plugins (or in the list of the imported packages)?
--
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/f5a0b251-452d-4e06-a849-3c01abbfed92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Felix Mayer

unread,
Feb 5, 2015, 6:28:54 PM2/5/15
to scala-i...@googlegroups.com
Thanks, adding a dependency for the bundle org.scala-lang.scala-compiler did fix the issue.

However, I think this problem should not occur because my code only has a transitive dependency on scala.tools.nsc.settings.ScalaVersion. So I checked the manifest of bundle org.scala-ide.sdt.core (where IScalaPlugin resides) and it neither requires bundle org.scala-lang.scala-compiler nor a package that starts with scala.tools.nsc. Don't you think it should do one or the other?

Simon Schäfer

unread,
Feb 5, 2015, 7:27:10 PM2/5/15
to scala-i...@googlegroups.com

On 02/06/2015 12:28 AM, Felix Mayer wrote:
Thanks, adding a dependency for the bundle org.scala-lang.scala-compiler did fix the issue.

However, I think this problem should not occur because my code only has a transitive dependency on scala.tools.nsc.settings.ScalaVersion. So I checked the manifest of bundle org.scala-ide.sdt.core (where IScalaPlugin resides) and it neither requires bundle org.scala-lang.scala-compiler nor a package that starts with scala.tools.nsc. Don't you think it should do one or the other?
You looked wrong, scala-ide very well relies on the compiler. Here is the entry of manifest: https://github.com/scala-ide/scala-ide/blob/afce7b5ebbd0c8433a78393819bd59c83b36d57d/org.scala-ide.sdt.core/resources/META-INF/MANIFEST-2_11.MF#L44

The Scala loader is by the way more restrictive than the Java loader, which means that it requires (all?) dependencies at startup of the application, whereas the Java loader can load them only when you actually access a class of the dependency at runtime.


On Thursday, February 5, 2015 at 4:48:23 PM UTC-5, Simon Schäfer wrote:

On 02/04/2015 10:03 PM, Felix Mayer wrote:
I am working on an Eclipse plugin that depends on the Eclipse Scala IDE. Since a few days, I get the error message below for my Eclipse project. So I got the latest Scala IDE from the update site, and the issue is still there. Is this a real problem?

missing or invalid dependency detected while loading class file 'IScalaPlugin.class'. Could not access term nsc in package scala.tools, because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.) A full rebuild may help if 'IScalaPlugin.class' was compiled against an incompatible version of scala.tools.
Eclipse plugins live in an OSGi environment, I guess you get this error because you forgot to allow your plugin to access scala.tools.nsc. Do you have the bundle of the compiler in the list of the required plugins (or in the list of the imported packages)?
--
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/f5a0b251-452d-4e06-a849-3c01abbfed92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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.
Reply all
Reply to author
Forward
0 new messages