-
-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix java.lang.ClassNotFoundException: org.springframework.web.servlet…
….HandlerMapping in Spring Boot Servlet mode without WebMVC (#3336) * Fix missing HandlerMapping class * changelog * rename config * provide default transaction name provider for servlet mode that returns URL
- Loading branch information
Showing
9 changed files
with
123 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
.../src/main/java/io/sentry/spring/jakarta/tracing/SpringServletTransactionNameProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.sentry.spring.jakarta.tracing; | ||
|
||
import io.sentry.protocol.TransactionNameSource; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import org.jetbrains.annotations.ApiStatus; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** Fallback TransactionNameProvider when Spring is used in servlet mode (without MVC). */ | ||
@ApiStatus.Internal | ||
public final class SpringServletTransactionNameProvider implements TransactionNameProvider { | ||
@Override | ||
public @Nullable String provideTransactionName(final @NotNull HttpServletRequest request) { | ||
return request.getMethod() + " " + request.getRequestURI(); | ||
} | ||
|
||
@Override | ||
@ApiStatus.Internal | ||
public @NotNull TransactionNameSource provideTransactionSource() { | ||
return TransactionNameSource.URL; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...y-spring/src/main/java/io/sentry/spring/tracing/SpringServletTransactionNameProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.sentry.spring.tracing; | ||
|
||
import io.sentry.protocol.TransactionNameSource; | ||
import javax.servlet.http.HttpServletRequest; | ||
import org.jetbrains.annotations.ApiStatus; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** Fallback TransactionNameProvider when Spring is used in servlet mode (without MVC). */ | ||
@ApiStatus.Internal | ||
public final class SpringServletTransactionNameProvider implements TransactionNameProvider { | ||
@Override | ||
public @Nullable String provideTransactionName(final @NotNull HttpServletRequest request) { | ||
return request.getMethod() + " " + request.getRequestURI(); | ||
} | ||
|
||
@Override | ||
@ApiStatus.Internal | ||
public @NotNull TransactionNameSource provideTransactionSource() { | ||
return TransactionNameSource.URL; | ||
} | ||
} |