Incremental Build Fails - Cannot Find Implementation
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start by reproducing the incremental rebuild in the Play application, then inspect InstanceLookup.scala:13 and Wired.scala:10 alongside Global.scala:41. Compare the class loaders at the reported stack frames. Done means adding or removing a controller class resolves without deleting the build output or forcing a complete rebuild.
Written by the indexing model from the issue text.
Description
MacWire Version: 2.11-2.2.0
Play! Version: 2.11-2.3.10
The incremental compilation fails when adding/removing a class file with:
java.lang.RuntimeException: Cannot find implementations of class class controllers.FooBarGong!
at com.softwaremill.macwire.InstanceLookup$class.lookupSingleOrThrow(InstanceLookup.scala:13) ~[util_2.11-2.2.0.jar:2.2.0]
at com.softwaremill.macwire.Wired.lookupSingleOrThrow(Wired.scala:10) ~[util_2.11-2.2.0.jar:2.2.0]
at Global$.getControllerInstance(Global.scala:41) ~[na:na]
...
Resolution succeeds provided I delete the build output folder do a complete project rebuild.
Upon further investigation, I have learned of an inconsistent classloader state between stack frames as indicated by calling the following from the subject stack frame:
((ClassLoader)this.getClass().getClassLoader()).loadClass("controllers.FooBarGong")
Lookup succeeds from stack frame Global$.getControllerInstance(Global.scala:41) ~[na:na] (class loader ReloadableClassLoader(v1)) but fails to find the class from the deeper stack frame com.softwaremill.macwire.Wired.lookupSingleOrThrow(Wired.scala:10) (class loader PlayDependencyClassLoader)
The call site is fairly simple:
package modules
import play.api.Play
import play.api.libs.ws.WS
import controllers._
import com.softwaremill.macwire._
import services._
object ApplicationModule extends ControllerModule with ServiceModule
trait ControllerModule extends ServiceModule {
import Play.current
lazy val fooBarGongController = wire[FooBarGong]
}
- Dominant language
- Scala
- Stars
- 1.3k
- Forks
- 77
- Avg merge
- 9m
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from softwaremill/macwire
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
softwaremill/macwire#412 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
softwaremill/macwire#391 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
softwaremill/macwire#301 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
softwaremill/macwire#281 · 5 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
softwaremill/macwire#278 · 3 comments ·
All issues in softwaremill/macwire
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ergoplatform/ergodocs#614 ·
-
area:ci enhancement requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/datafusion-comet#6078 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
[VL] madvise(WILLNEED) call fails in MmapFileStream because of wrong calculation of fetching length Openbug triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
chipsalliance/rocket-chip#3831 ·