Skip to content

Commit 661a781

Browse files
authored
Merge 0311245 into fba10b8
2 parents fba10b8 + 0311245 commit 661a781

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
- Using MaxBreadcrumb with value 0 no longer crashes. ([#3836](https://github.com/getsentry/sentry-java/pull/3836))
1313
- Accept manifest integer values when requiring floating values ([#3823](https://github.com/getsentry/sentry-java/pull/3823))
14+
- Fix standalone tomcat jndi issue ([#3873](https://github.com/getsentry/sentry-java/pull/3873))
15+
- Using Sentry Spring Boot on a standalone tomcat caused the following error:
16+
- Failed to bind properties under 'sentry.parsed-dsn' to io.sentry.Dsn
1417

1518
## 7.16.0
1619

sentry/src/main/java/io/sentry/Baggage.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static Baggage fromEvent(
134134
final Baggage baggage = new Baggage(options.getLogger());
135135
final SpanContext trace = event.getContexts().getTrace();
136136
baggage.setTraceId(trace != null ? trace.getTraceId().toString() : null);
137-
baggage.setPublicKey(options.getParsedDsn().getPublicKey());
137+
baggage.setPublicKey(options.retrieveParsedDsn().getPublicKey());
138138
baggage.setRelease(event.getRelease());
139139
baggage.setEnvironment(event.getEnvironment());
140140
final User user = event.getUser();
@@ -405,7 +405,7 @@ public void setValuesFromTransaction(
405405
final @NotNull SentryOptions sentryOptions,
406406
final @Nullable TracesSamplingDecision samplingDecision) {
407407
setTraceId(transaction.getSpanContext().getTraceId().toString());
408-
setPublicKey(sentryOptions.getParsedDsn().getPublicKey());
408+
setPublicKey(sentryOptions.retrieveParsedDsn().getPublicKey());
409409
setRelease(sentryOptions.getRelease());
410410
setEnvironment(sentryOptions.getEnvironment());
411411
setUserSegment(user != null ? getSegment(user) : null);
@@ -427,7 +427,7 @@ public void setValuesFromScope(
427427
final @Nullable User user = scope.getUser();
428428
final @NotNull SentryId replayId = scope.getReplayId();
429429
setTraceId(propagationContext.getTraceId().toString());
430-
setPublicKey(options.getParsedDsn().getPublicKey());
430+
setPublicKey(options.retrieveParsedDsn().getPublicKey());
431431
setRelease(options.getRelease());
432432
setEnvironment(options.getEnvironment());
433433
if (!SentryId.EMPTY_ID.equals(replayId)) {

sentry/src/main/java/io/sentry/DsnUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static boolean urlContainsDsnHost(@Nullable SentryOptions options, @Nulla
2323
return false;
2424
}
2525

26-
final @NotNull Dsn dsn = options.getParsedDsn();
26+
final @NotNull Dsn dsn = options.retrieveParsedDsn();
2727
final @NotNull URI sentryUri = dsn.getSentryUri();
2828
final @Nullable String dsnHost = sentryUri.getHost();
2929

sentry/src/main/java/io/sentry/RequestDetailsResolver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public RequestDetailsResolver(final @NotNull SentryOptions options) {
2121

2222
@NotNull
2323
RequestDetails resolve() {
24-
final Dsn dsn = options.getParsedDsn();
24+
final Dsn dsn = options.retrieveParsedDsn();
2525
final URI sentryUri = dsn.getSentryUri();
2626
final String envelopeUrl = sentryUri.resolve(sentryUri.getPath() + "/envelope/").toString();
2727

sentry/src/main/java/io/sentry/Sentry.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ private static boolean initConfigurations(final @NotNull SentryOptions options)
398398
}
399399

400400
// This creates the DSN object and performs some checks
401-
options.getParsedDsn();
401+
options.retrieveParsedDsn();
402402

403403
ILogger logger = options.getLogger();
404404

sentry/src/main/java/io/sentry/SentryOptions.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -541,13 +541,15 @@ public void addIntegration(@NotNull Integration integration) {
541541
}
542542

543543
/**
544-
* Evaluates and parses the DSN. May throw an exception if the DSN is invalid.
544+
* Evaluates and parses the DSN. May throw an exception if the DSN is invalid. Renamed from
545+
* `getParsedDsn` as this would cause an error when deploying as WAR to Tomcat due to `JNDI`
546+
* property binding.
545547
*
546548
* @return the parsed DSN or throws if dsn is invalid
547549
*/
548550
@ApiStatus.Internal
549551
@NotNull
550-
Dsn getParsedDsn() throws IllegalArgumentException {
552+
Dsn retrieveParsedDsn() throws IllegalArgumentException {
551553
return parsedDsn.getValue();
552554
}
553555

@@ -2457,7 +2459,7 @@ public void setEnableScreenTracking(final boolean enableScreenTracking) {
24572459
*/
24582460
void loadLazyFields() {
24592461
getSerializer();
2460-
getParsedDsn();
2462+
retrieveParsedDsn();
24612463
getEnvelopeReader();
24622464
getDateProvider();
24632465
}

0 commit comments

Comments
 (0)