"cnf does not exist" building Scala projects

56 views
Skip to first unread message

Dan Gravell

unread,
Sep 21, 2016, 11:17:53 AM9/21/16
to bndtools-users
bndtools 3.2.0.

This is popping up a lot when I use Eclipse, but I've been ignoring it and hoping it goes away.

Now I come to a "leaf" project with few dependencies and I notice it happens whenever I try to clean the project.

The stack trace is:

Java Model Exception: Java Model Status [cnf does not exist]
at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:556)
at org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java:2378)
at org.eclipse.jdt.internal.core.JavaProject.getPerProjectInfo(JavaProject.java:1909)
at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1983)
at org.scalaide.core.internal.project.ScalaProject$.org$scalaide$core$internal$project$ScalaProject$$dependenciesForProject(ScalaProject.scala:124)
at org.scalaide.core.internal.project.ScalaProject$$anonfun$exportedDependenciesForProjects$1.apply(ScalaProject.scala:141)
at org.scalaide.core.internal.project.ScalaProject$$anonfun$exportedDependenciesForProjects$1.apply(ScalaProject.scala:141)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:316)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:972)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
at org.scalaide.core.internal.project.ScalaProject$.exportedDependenciesForProjects(ScalaProject.scala:141)
at org.scalaide.core.internal.project.ScalaProject.transitiveDependencies(ScalaProject.scala:204)
at org.scalaide.core.internal.project.SbtScopesBuildManager$$anonfun$org$scalaide$core$internal$project$SbtScopesBuildManager$$findProjectsInError$1.apply(SbtScopesBuildManager.scala:83)
at org.scalaide.core.internal.project.SbtScopesBuildManager$$anonfun$org$scalaide$core$internal$project$SbtScopesBuildManager$$findProjectsInError$1.apply(SbtScopesBuildManager.scala:82)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
at scala.collection.immutable.List.flatMap(List.scala:344)
at org.scalaide.core.internal.project.SbtScopesBuildManager.org$scalaide$core$internal$project$SbtScopesBuildManager$$findProjectsInError(SbtScopesBuildManager.scala:82)
at org.scalaide.core.internal.project.SbtScopesBuildManager$$anonfun$3.apply(SbtScopesBuildManager.scala:49)
at org.scalaide.core.internal.project.SbtScopesBuildManager$$anonfun$3.apply(SbtScopesBuildManager.scala:48)
at scala.collection.immutable.List.map(List.scala:273)
at org.scalaide.core.internal.project.SbtScopesBuildManager.build(SbtScopesBuildManager.scala:48)
at org.scalaide.core.internal.project.ScalaProject.build(ScalaProject.scala:603)
at org.scalaide.core.internal.builder.ScalaBuilder.build(ScalaBuilder.scala:109)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
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:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

I guess because I saw the word "cnf" I assumed it must be a bndtools issue - but maybe it's the Scala IDE.

And yes, cnf does exist!

Dan

Timothy Ward

unread,
Sep 21, 2016, 11:26:13 AM9/21/16
to bndtool...@googlegroups.com
Note that it’s not enough for cnf to exist in the workspace. It needs to be a peer folder of the project (on the physical disk). Bnd knows nothing about Eclipse, and only uses the file system to find cnf. Bndtools cannot lift this restriction. 

Regards,

Tim


--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Gravell

unread,
Sep 21, 2016, 11:29:44 AM9/21/16
to bndtools-users
Thanks Tim. The project folder is a sibling of cnf.

Dan Gravell

unread,
Sep 22, 2016, 5:23:07 AM9/22/16
to bndtools-users
Some success. Looks like the Scala IDE is trying to recognise cnf as a Java project.

I added the Java nature to cnf and now it works - compiles as expected.

I assume, without the Java builder also added, this will be ok. But maybe the Scala IDE is doing something wrong in assuming cnf is a Java project?

Dan

Neil Bartlett

unread,
Sep 22, 2016, 7:21:42 AM9/22/16
to bndtool...@googlegroups.com
It does indeed *look* like a problem with the Scala IDE. It shouldn’t assume that every project has the Java nature.

Neil

Dan Gravell

unread,
Sep 22, 2016, 8:35:17 AM9/22/16
to bndtools-users
I'll report it to them. I would've thought some sort of abstraction was used along the Build Path lines, but...

Neil Bartlett

unread,
Sep 22, 2016, 10:22:08 AM9/22/16
to bndtool...@googlegroups.com

Another thought occurs to me. Bndtools returns cnf in the list of dependencies from each project - we do this to get resource deltas from eclipse whenever cnf changes. Its possible that Scala IDE assumes that the dependencies of a java project must also be java.


To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.

Dan Gravell

unread,
Sep 22, 2016, 12:16:14 PM9/22/16
to bndtools-users
That sounds possible. I thought you could just add resource delta listeners in Eclipse instead? Although my last experience with the PDE was about a decade ago!

wai.keung....@gmail.com

unread,
Jan 9, 2017, 10:41:07 PM1/9/17
to bndtools-users
I am very new to bndtools and just started exploring scala.
This post helped me resolve the issue temporarily by manually editing the cnf .project file and adding the javanature.
Have there been any updates or insights on this?

By removing the sourcepath and the library path for the cnf project in eclipse, it aethestically looks pretty similar to not having the javanature active.
Just a minor annoyance while setting up.
Reply all
Reply to author
Forward
0 new messages