Skip to content
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.ClassNotFoundException: io.sentry.spring.SentrySpringServletContainerInitializer #2411

Closed
js361014 opened this issue Dec 2, 2022 · 2 comments · Fixed by #2413
Closed
Assignees

Comments

@js361014
Copy link
Contributor

js361014 commented Dec 2, 2022

Integration

sentry-spring-jakarta

Java Version

17

Version

6.9.1

Steps to Reproduce

1.Put in pom.xml

<dependency>
	<groupId>io.sentry</groupId>
	<artifactId>sentry-spring-jakarta</artifactId>
	<version>6.9.1</version>
</dependency>

2.Create SentryConfiguration class

import io.sentry.spring.jakarta.EnableSentry;
import org.springframework.context.annotation.Configuration;

@EnableSentry(dsn = "DSN_URL")
@Configuration
public class SentryConfiguration {
}

3.Add SentryConfiguration to applicationContext.xml

<bean class="SentryConfiguration"/>

Expected Result

Everything works.

Actual Result

Error: Caused by: java.lang.ClassNotFoundException: io.sentry.spring.SentrySpringServletContainerInitializer

@js361014
Copy link
Contributor Author

js361014 commented Dec 2, 2022

Possibly in https://github.com/getsentry/sentry-java/blob/2285d6f7c0f240594d2771287868af8a94df6dc4/sentry-spring-jakarta/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer
io.sentry.spring.SentrySpringServletContainerInitializer should be replaced with io.sentry.spring.jakarta.SentrySpringServletContainerInitializer

@adinauer
Copy link
Member

adinauer commented Dec 5, 2022

Thanks @js361014 for the analysis and fix. Just waiting for CI to finish, then I'll merge #2413

@adinauer adinauer self-assigned this Dec 5, 2022
adinauer pushed a commit that referenced this issue Dec 5, 2022
…tContainerInitializer` in `sentry-spring-jakarta` (#2413)

Co-authored-by: Alexander Dinauer <alexander.dinauer@sentry.io>
Fixes #2411
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants