Skip to content

Commit

Permalink
Use system properties to control datasource provider suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
barchetta committed Dec 19, 2024
1 parent eb393b5 commit f47f42f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ private JaxRsService(ResourceConfig resourceConfig,

static JaxRsService create(ResourceConfig resourceConfig, InjectionManager injectionManager) {

Config config = ConfigProvider.getConfig();

// Silence warnings from Jersey. See 9019. Allow overriding to pass tck
Boolean suppressDatasourceProvider = config.getOptionalValue(SUPPRESS_DATASOURCE_PROVIDER, Boolean.class).orElse(true);
boolean suppressDatasourceProvider = Boolean.parseBoolean(System.getProperty(SUPPRESS_DATASOURCE_PROVIDER, "true"));
if (!resourceConfig.hasProperty(CommonProperties.PROVIDER_DEFAULT_DISABLE) && suppressDatasourceProvider) {
resourceConfig.addProperties(Map.of(CommonProperties.PROVIDER_DEFAULT_DISABLE, "DATASOURCE"));
}
Expand All @@ -114,6 +112,7 @@ static JaxRsService create(ResourceConfig resourceConfig, InjectionManager injec
new WebServerBinder(),
ij);
Container container = new HelidonJerseyContainer(appHandler);
Config config = ConfigProvider.getConfig();

// This configuration via system properties is for the Jersey Client API. Any
// response in an exception will be mapped to an empty one to prevent data leaks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
<webServerHost>localhost</webServerHost>
<webServerPort>8080</webServerPort>
<jersey.config.client.ignoreExceptionResponse>false</jersey.config.client.ignoreExceptionResponse>
<jersey.config.server.suppressDataSourceProvider>false</jersey.config.server.suppressDataSourceProvider>
<jersey.config.allowSystemPropertiesProvider>true</jersey.config.allowSystemPropertiesProvider>
<org.jboss.weld.bootstrap.concurrentDeployment>false</org.jboss.weld.bootstrap.concurrentDeployment>
<org.jboss.weld.construction.relaxed>false</org.jboss.weld.construction.relaxed>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@
#

jersey.config.client.ignoreExceptionResponse=false
jersey.config.server.suppressDataSourceProvider=false

0 comments on commit f47f42f

Please sign in to comment.