Skip to content

Commit

Permalink
feat: register jackson2 resteasy provider at startup #5038 (#5039)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuriy Movchan <Yuriy.Movchan@gmail.com>
  • Loading branch information
yuremm and yurem authored May 19, 2023
1 parent 819f78a commit 81fed0f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@
import jakarta.inject.Inject;
import jakarta.inject.Named;
import jakarta.servlet.ServletContext;

import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.spi.ResteasyProviderFactory;
import org.jboss.weld.util.reflection.ParameterizedTypeImpl;
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider;
import org.slf4j.Logger;

import java.lang.annotation.Annotation;
Expand Down Expand Up @@ -199,6 +203,11 @@ public void createApplicationComponents() {
public void applicationInitialized(@Observes @Initialized(ApplicationScoped.class) Object init) {
log.debug("Initializing application services");

// ResteasyProviderFactory.setRegisterBuiltinByDefault(true)
ResteasyProviderFactory instance = ResteasyProviderFactory.getInstance();
RegisterBuiltin.register(instance);
instance.registerProvider(ResteasyJackson2Provider.class);

configurationFactory.create();

PersistenceEntryManager localPersistenceEntryManager = persistenceEntryManagerInstance.get();
Expand Down

0 comments on commit 81fed0f

Please sign in to comment.