Skip to content

Commit

Permalink
add priority to empty message jackson meesage body provider
Browse files Browse the repository at this point in the history
Change-Id: Ic94c4a049224219867b36b9976b6d997a3928b95
  • Loading branch information
Francisco Sanchez committed Jul 14, 2015
1 parent a4a1e54 commit 79b19b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/com/bq/oss/lib/ws/cli/ServiceRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@
*
*/
public abstract class ServiceRunner<T> {


private static final Logger LOG = LoggerFactory.getLogger(ServiceRunner.class);
private static final int HIGH_PRIORITY = 1;
private final ServiceRunnerApplication application = new ServiceRunnerApplication();

public final void run(String[] arguments) throws Exception {
Expand Down Expand Up @@ -85,8 +84,8 @@ protected ApplicationContext loadSpringContext() {

private void configureDefaultProviders(Environment environment) {
environment.jersey().register(new GsonMessageReaderWriterProvider());
environment.jersey().register(
new EmptyEntitiesAllowedJacksonMessageBodyProvider(environment.getObjectMapper(), environment.getValidator()));
// EmptyEntitiesAllowedJacksonMessageBodyProvider Override JacksonMessageBodyProvider to allow null entities
environment.jersey().getResourceConfig().register(new EmptyEntitiesAllowedJacksonMessageBodyProvider(environment.getObjectMapper(), environment.getValidator()), HIGH_PRIORITY);
}

private void configureDropWizard(Configuration configuration, ApplicationContext applicationContext) {
Expand Down

0 comments on commit 79b19b5

Please sign in to comment.