-
-
Notifications
You must be signed in to change notification settings - Fork 442
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
AOT compilation broken for Spring Boot #4010
Comments
When starting the app without AOT with a DSN set I also get this:
Is the gradle plugin maybe not pulling in the right thing or something? |
Hey, thanks for opening this issue. Can you please give more details on how you're using Spring.
|
1., 2. & 3. I just use a normal Spring Boot MVC app, with the aot plugin just applied as a normal gradle plugin. For a demo you can just a new app from Spring Initializr using this configuration. Then apply the following diff: diff --git a/build.gradle.kts b/build.gradle.kts
index 4a5c49d..4fb2e58 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -2,6 +2,8 @@ plugins {
kotlin("jvm") version "1.9.25"
kotlin("plugin.spring") version "1.9.25"
id("org.springframework.boot") version "3.4.1"
+ id("org.springframework.boot.aot") version "3.4.1"
+ id("io.sentry.jvm.gradle") version "4.14.1"
id("io.spring.dependency-management") version "1.1.7"
}
diff --git a/src/main/kotlin/com/example/springdemo/SpringDemoApplication.kt b/src/main/kotlin/com/example/springdemo/SpringDemoApplication.kt
index 32b61dc..23fc2f9 100644
--- a/src/main/kotlin/com/example/springdemo/SpringDemoApplication.kt
+++ b/src/main/kotlin/com/example/springdemo/SpringDemoApplication.kt
@@ -1,11 +1,17 @@
package com.example.springdemo
+import io.sentry.spring.jakarta.EnableSentry
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
+import org.springframework.core.Ordered
@SpringBootApplication
+@EnableSentry(
+ exceptionResolverOrder = Ordered.LOWEST_PRECEDENCE
+)
class SpringDemoApplication
fun main(args: Array<String>) {
runApplication<SpringDemoApplication>(*args)
} And start it using (the example DNS alone is sufficient it doesn't seem to have to be valid to reproduce):
That should reproduce the error just fine and it may be small enough to be an integration test as well. |
@cromefire can you retest without the |
Thanks for bringing this up, we're about to change the onboarding docs and will replace this part for Spring Boot. It is only intended for Spring (not boot). Sorry for the troubles caused. I haven't gotten around to testing the Gradle plugin yet. |
The plugin itself seems to be working fine as it seems to be adding the correct dependency |
Quick update, there was a bug in onboarding docs where docs for Spring were shown for Spring Boot as well. This has been fixed in getsentry/sentry#82805 and should now show correct docs for v7. We'll update the onboarding docs for v8 soon. |
Integration
unknown (gradle plugin)
Java Version
21
Version
4.14.1
Steps to Reproduce
io.springframework.boot.aot
)Expected Result
It compiles fine.
Actual Result
It fails to compile with the following exception:
The text was updated successfully, but these errors were encountered: