-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.IllegalAccessError: failed to access class com.linecorp.armeria.server.AbstractContextPathServicesBuilder #21797
Comments
The same code works in Scala 2.12.13 package experiment
import com.linecorp.armeria.common.HttpResponse
import com.linecorp.armeria.server.Server
object Test {
def main(args: Array[String]): Unit = {
val server = Server.builder()
.contextPath("/v1")
.service("/", (ctx, req) => HttpResponse.of("Hello, world"))
.and()
.build()
.start()
println(s"server started = ${server}")
}
}
val scala3Version = "2.12.13"
lazy val root = project
.in(file("."))
.settings(
name := "test-armeria",
version := "0.1.0-SNAPSHOT",
scalaVersion := scala3Version,
libraryDependencies ++= Seq(
"com.linecorp.armeria" % "armeria" % "1.30.1",
)
)
|
This seems to have been fixed in nightly ( The following works: //> using scala 3.6.1-RC1-bin-20241016-2fc299b-NIGHTLY
//> using dep com.linecorp.armeria:armeria:1.30.1
package experiment
import com.linecorp.armeria.common.HttpResponse
import com.linecorp.armeria.server.Server
object Test {
def main(args: Array[String]): Unit = {
val server = Server.builder()
.contextPath("/v1")
.service("/", (ctx, req) => HttpResponse.of("Hello, world"))
.and()
.build()
.start()
println(s"server started = ${server}")
}
} |
@Gedochao I confirmed that 3.6.1-RC1-bin-20241016-2fc299b-NIGHTLY fixes the problem |
I would be grateful if this fixed can be backport to the next possible 3.5.x. Thanks in advance |
It's likely too late for it to be backported to 3.5.2, unless we'd have another RC. tagging @WojciechMazur just in case. |
Noted with thanks! |
3.5.2 final has already been shipped. It will be backported to 3.6.0 or 3.6.1 |
I needed to slightly modify the snippet to close the server so that it doesn't hang the bisecting tests. //> using dep com.linecorp.armeria:armeria:1.30.1
import com.linecorp.armeria.common.HttpResponse
import com.linecorp.armeria.server.Server
object Test {
def main(args: Array[String]): Unit = {
val server = Server.builder()
.contextPath("/v1")
.service("/", (ctx, req) => HttpResponse.of("Hello, world"))
.and()
.build()
println(s"starting server")
val started = server.start()
started.get()
println(s"server started")
server.stop()
println(s"server stopped")
}
} Bisected with scala-cli project/scripts/bisect.scala -- --should-fail --releases 3.5.1-RC1-bin-20240628-1efbb92-NIGHTLY... run /tmp/bisect/ArmeriaServer.scala The bisect points to #21362 |
Ah, I've just bisected it to the same commit, adding |
@WojciechMazur as far as I can see the issue was fixed on 10.08, which was before the cut-off of release-3.6.0, so this shouldn't need any backporting for 3.6.x. Or did I miss something? |
That's correct, I've just checked to ensure it's included, so no work needed for Next release |
Compiler version
Scala version 3.3.3 and 3.5.1
Minimized code
The code below runs in Java. But in Scala, it throws an IllegalAccessError exception.
build.sbt
Output
Expectation
The code should run without error.
The text was updated successfully, but these errors were encountered: