Incremental Build Fails - Cannot Find Implementation

Đang mở
#93 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
scala
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện quá trình build gia tăng trong ứng dụng Play, sau đó kiểm tra InstanceLookup.scala:13 và Wired.scala:10 cùng với Global.scala:41. So sánh các class loader tại các stack frame được báo cáo. Được xem là hoàn tất khi việc thêm hoặc xóa một lớp controller giải quyết được vấn đề mà không cần xóa đầu ra build hoặc buộc phải build lại toàn bộ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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]
}
Ngôn ngữ chính
Scala
Star
1.3k
Fork
77
Merge trung bình
9 phút
Pull request đã merge (30 ngày)
4

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của softwaremill/macwire

Tất cả issue của softwaremill/macwire

Issue tương tự

Thêm issue về Scala

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.