Incremental Build Fails - Cannot Find Implementation
还没有人认领这个 Issue。
评估
调研方向
先在 Play 应用中复现增量构建,然后结合 Global.scala:41 检查 InstanceLookup.scala:13 和 Wired.scala:10。比较报告的堆栈帧中的类加载器。完成的标准是:添加或删除一个 controller 类即可解决问题,而无需删除构建输出或强制执行完整重建。
由索引模型根据 Issue 内容生成。
描述
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]
}
- 主要语言
- Scala
- 星标
- 1.3k
- 派生
- 77
- 平均合并
- 9 分钟
- 30 天内合并 PR
- 4
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
softwaremill/macwire 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
softwaremill/macwire#412 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
softwaremill/macwire#391 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
softwaremill/macwire#301 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
softwaremill/macwire#281 · 5 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
softwaremill/macwire#278 · 3 条评论 ·
查看 softwaremill/macwire 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
ergoplatform/ergodocs#614 ·
-
area:ci enhancement requires-triage
难度 2/5 1-3 小时 新手友好度 84/100
apache/datafusion-comet#6078 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
-
[VL] madvise(WILLNEED) call fails in MmapFileStream because of wrong calculation of fetching length 未关闭bug triage
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 76/100
chipsalliance/rocket-chip#3831 ·