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

Fix PBS startup warning: Illegal reflective access by afterburner #1533

Merged
merged 3 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<commons.compress.version>1.21</commons.compress.version>
<httpclient.version>4.5.13</httpclient.version>
<ipaddress.version>5.3.1</ipaddress.version>
<jackson.version>2.10.0</jackson.version>
<jackson.version>2.12.5</jackson.version>
<json.schema.validator.version>0.1.7</json.schema.validator.version>
<jsonpatch.version>1.13</jsonpatch.version>
<mysql.version>8.0.16</mysql.version>
Expand Down Expand Up @@ -203,7 +203,7 @@
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-afterburner</artifactId>
<artifactId>jackson-module-blackbird</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.module.afterburner.AfterburnerModule;
import com.fasterxml.jackson.module.blackbird.BlackbirdModule;
import io.vertx.core.json.jackson.DatabindCodec;

public final class ObjectMapperProvider {
Expand All @@ -20,7 +20,7 @@ public final class ObjectMapperProvider {
.enable(JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN)
.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE)
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.registerModule(new AfterburnerModule())
.registerModule(new BlackbirdModule())
.registerModule(new ZonedDateTimeModule())
.registerModule(new MissingJsonNodeModule())
.registerModule(new ZonedDateTimeModule())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2365,9 +2365,10 @@ public void shouldPopulateBidResponseExtension() {
assertThat(responseExt.getErrors()).hasSize(2).containsOnly(
entry("bidder1", asList(
ExtBidderError.of(2, "bad_input"),
ExtBidderError.of(3, "Failed to decode: Cannot deserialize instance of `com.iab."
+ "openrtb.response.Response` out of START_ARRAY token\n at [Source: (String)\"[]\"; "
+ "line: 1, column: 1]"))),
ExtBidderError.of(3, "Failed to decode: Cannot deserialize value"
+ " of type `com.iab.openrtb.response.Response` from Array value "
+ "(token `JsonToken.START_ARRAY`)\n"
+ " at [Source: (String)\"[]\"; line: 1, column: 1]"))),
entry("cache", singletonList(ExtBidderError.of(999, "cacheError"))));

assertThat(responseExt.getResponsetimemillis()).hasSize(2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public void shouldReturnFailedFutureIfEidsPermissionsContainsWrongDataType() {
assertThat(result.cause()).isInstanceOf(InvalidRequestException.class);
assertThat(((InvalidRequestException) result.cause()).getMessages()).hasSize(1)
.allSatisfy(message ->
assertThat(message).startsWith("Error decoding bidRequest: Cannot deserialize instance"));
assertThat(message).startsWith("Error decoding bidRequest: Cannot deserialize value"));
}

@Test
Expand Down Expand Up @@ -445,7 +445,7 @@ public void shouldReturnFailedFutureIfEidsPermissionsBiddersContainsWrongDataTyp
assertThat(result.cause()).isInstanceOf(InvalidRequestException.class);
assertThat(((InvalidRequestException) result.cause()).getMessages()).hasSize(1)
.allSatisfy(message ->
assertThat(message).startsWith("Error decoding bidRequest: Cannot deserialize instance"));
assertThat(message).startsWith("Error decoding bidRequest: Cannot construct instance"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
}

@Test
Expand Down Expand Up @@ -294,7 +294,7 @@ public void makeBidsShouldReturnIfImpExtCouldNotBeParsed() throws JsonProcessing
// then
// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
}

private static BidRequest givenBidRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void makeHttpRequestsShouldReturnErrorWhenImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {
// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors()).allMatch(error -> error.getType() == BidderError.Type.bad_input
&& error.getMessage().startsWith("Cannot deserialize instance"));
&& error.getMessage().startsWith("Cannot deserialize value"));
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void makeHttpRequestsShouldReturnErrorIfFirstImpExtCannotBeParsed() {

final List<BidderError> errors = result.getErrors();
assertThat(errors).hasSize(1);
assertThat(errors.get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(errors.get(0).getMessage()).startsWith("Cannot deserialize value");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {
.allSatisfy(error -> {
assertThat(error.getType()).isEqualTo(BidderError.Type.bad_input);
assertThat(error.getMessage()).startsWith("ignoring imp id=impId, error while "
+ "decoding impExt, err: Cannot deserialize instance");
+ "decoding impExt, err: Cannot deserialize value");
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public void makeBidsShouldReturnEmptyBidderWithErrorWhenResponseCantBeParsed() {
.containsExactly(BidderError.badServerResponse(
"Failed to decode: Unexpected end-of-input: expected close marker for Object (start marker at"
+ " [Source: (String)\"{\"; line: 1, column: 1])\n at [Source: (String)\"{\"; line: 1, "
+ "column: 3]"));
+ "column: 2]"));
}

private static HttpCall<BidRequest> givenHttpCall(String body) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void makeHttpRequestsShouldReturnErrorWhenImpExtCouldNotBeParsed() {
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors()).allSatisfy(error -> {
assertThat(error.getType()).isEqualTo(BidderError.Type.bad_input);
assertThat(error.getMessage()).startsWith("Cannot deserialize instance");
assertThat(error.getMessage()).startsWith("Cannot deserialize value");
});
assertThat(result.getValue()).isEmpty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCanNotBeParsed() {
assertThat(result.getErrors()).hasSize(1)
.allSatisfy(error -> {
assertThat(error.getType()).isEqualTo(BidderError.Type.bad_input);
assertThat(error.getMessage()).startsWith("Cannot deserialize instance");
assertThat(error.getMessage()).startsWith("Cannot deserialize value");
});
assertThat(result.getValue()).isEmpty();
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/prebid/server/bidder/amx/AmxBidderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {
// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors()).allMatch(error -> error.getType() == BidderError.Type.bad_input
&& error.getMessage().startsWith("Cannot deserialize instance"));
&& error.getMessage().startsWith("Cannot deserialize value"));
}

@Test
Expand Down Expand Up @@ -235,7 +235,7 @@ public void makeBidsShouldSkipBidAndAddErrorIfFailedToParseBidExt() throws JsonP
.satisfies(error -> {
assertThat(error).extracting(BidderError::getType).containsExactly(BidderError.Type.bad_input);
assertThat(error).extracting(BidderError::getMessage)
.element(0).asString().startsWith("Cannot deserialize instance");
.element(0).asString().startsWith("Cannot deserialize value");
});
assertThat(result.getValue()).isEmpty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).hasSize(1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void makeHttpRequestsShouldReturnErrorWhenImpExtCouldNotBeParsed() {
assertThat(result.getValue()).isEmpty();
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith(
"ignoring imp id=123, error while decoding extImpBeachfront, err: Cannot deserialize instance");
"ignoring imp id=123, error while decoding extImpBeachfront, err: Cannot deserialize value");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void makeHttpRequestsShouldReturnErrorWhenImpExtCouldNotBeParsed() {
// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage())
.startsWith("Cannot deserialize instance");
.startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ public void makeBidsShouldReturnEmptyBidderWithErrorWhenResponseCantBeParsed() {
.containsExactly(BidderError.badServerResponse(
"Failed to decode: Unexpected end-of-input: expected close marker for Object (start marker at"
+ " [Source: (String)\"{\"; line: 1, column: 1])\n at [Source: (String)\"{\"; line: 1, "
+ "column: 3]"));
+ "column: 2]"));
}

private static HttpCall<BidRequest> givenHttpCall(String body) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void makeHttpRequestsShouldReturnErrorsOfNotValidImps() {
assertThat(result.getErrors())
.allSatisfy(error -> {
assertThat(error.getType()).isEqualTo(BidderError.Type.bad_input);
assertThat(error.getMessage()).startsWith("Cannot deserialize instance of");
assertThat(error.getMessage()).startsWith("Cannot deserialize value of");
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(2);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void makeHttpRequestsShouldReturnErrorWhenImpExtCouldNotBeParsed() {
// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage())
.startsWith("Cannot deserialize instance");
.startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {
// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage())
.startsWith("Ignoring imp id=123, error while decoding extImpBidder, err: Cannot deserialize instance");
.startsWith("Ignoring imp id=123, error while decoding extImpBidder, err: Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void makeHttpRequestsShouldReturnErrorWhenImpExtCannotBeParsed() {
// then
assertThat(result.getValue()).isEmpty();
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance of");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value of");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void makeHttpRequestsShouldReturnErrorsIfImpExtCouldNotBeParsed() {
})
.anySatisfy(error -> {
assertThat(error.getType()).isEqualTo(BidderError.Type.bad_input);
assertThat(error.getMessage()).startsWith("Cannot deserialize instance");
assertThat(error.getMessage()).startsWith("Cannot deserialize value");
});
assertThat(result.getValue()).isEmpty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {
assertThat(result.getErrors()).hasSize(1)
.allSatisfy(error -> {
assertThat(error.getType()).isEqualTo(BidderError.Type.bad_input);
assertThat(error.getMessage()).startsWith("Cannot deserialize instance");
assertThat(error.getMessage()).startsWith("Cannot deserialize value");
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(2);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(2);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void makeHttpRequestsShouldReturnErrorWhenImpExtCouldNotBeParsed() {

// then
assertThat(result.getErrors()).hasSize(1);
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize instance");
assertThat(result.getErrors().get(0).getMessage()).startsWith("Cannot deserialize value");
assertThat(result.getValue()).isEmpty();
}

Expand Down
Loading