Closed koppor closed 1 year ago
Sorry for the very late reply. I've checked the CDI 4.0 specification https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html#se_bootstrap and it looks like you should now use different APIs to access CDI in J2SE:
SeContainerInitializer containerInit = SeContainerInitializer.newInstance();
SeContainer container = containerInit.initialize();
// retrieve a bean and do work with it
MyBean myBean = container.select(MyBean.class).get();
myBean.doWork();
// when done
container.close();
I'll note that and will update the article in the future. On the other hand, maybe a faster response can be obtained from https://github.com/jakartaee/cdi/issues
Closing as TBD: update CDI with J2SE articles
(I come from http://www.mastertheboss.com/jboss-frameworks/resteasy/getting-started-with-jakarta-restful-services/, thank you for the great article!)
Typically, one injects the ObjectMapper using following class:
Now that
ContextResolver
will be deprecated, how to add anObjectMapper
?