Hi guys,

in cdi-integration I don't get how the deployment can work cause the thread
local bus is not set

Here what i did to ensure i use a single bus (and prevented the cxf one to

public class JAXRSCdiResourceExtensionWorkaround extends
JAXRSCdiResourceExtension {
    public void load(@Observes final AfterDeploymentValidation event,
final BeanManager beanManager) {
        final Bus bus =
Bus.class, null));
        BusFactory.setThreadDefaultBus(bus); // cause app class will
rely on that and would create multiple bus and then deployment would
be broken
        try {
            super.load(event, beanManager);
        } finally {

Issue was caused by JAXRSCdiResourceExtension#createFactoryInstance which
calls ResourceUtils.createApplication which uses the thread bus which is
not set by the extension leading to 2 buses.

Did I miss something?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory

Reply via email to