sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Spring Boot "SentryServletContextInitializer" not found in v3

Open lehoffma opened this issue 6 years ago • 3 comments

Hello, When updating to the newest API version most of the changes were easy enough to find (using scope instead of context etc.), but I couldn't find what the replacement for the Spring Boot HTTP integration is. I'm talking about this piece of code:

@Bean
public ServletContextInitializer sentryServletContextInitializer() {
	return new io.sentry.spring.SentryServletContextInitializer();
}

This is also still part of the official examples and I couldn't find any other place that mentions this or a possible replacement.

Thank you!

lehoffma avatar Oct 01 '20 06:10 lehoffma

@lehoffma thanks for asking.

new docs are live https://docs.sentry.io/platforms/java/guides/spring-boot/ please have a look at it. cc @maciejwalkowiak

marandaneto avatar Oct 01 '20 07:10 marandaneto

@lehoffma with the newest SDK there is a dedicated Spring Boot Starter that auto-configures all the beans for you. The only thing you need to do is to set sentry.dsn property in application.properites. Let us know please if this solves your issues or if you find anything else missing. Thanks!

maciejwalkowiak avatar Oct 01 '20 07:10 maciejwalkowiak

Using the autoconfigured version solved my problem for me. Thanks for the quick and helpful responses!

lehoffma avatar Oct 01 '20 12:10 lehoffma