users@jersey.java.net

[Jersey] Re: Jersey & CDI & Weld == No active contexts for scope type javax.enterprise.context.RequestScoped

From: Thomas Meyer <thomas_at_m3y3r.de>
Date: Tue, 29 Mar 2016 18:31:14 +0200

Am 23.03.2016 9:28 nachm. schrieb Thomas Meyer <thomas@m3y3r.de>:
>
> Hi,
>
> I did install all necessary libraries into Tomcat's lib/ directory, so
> they are available for all deployed webapps.
>
> Versions are:
> Tomcat 8.0.32
> Jersey 2.22.2 (servlet and ext-cdi1x)
> Weld 2.3.3.Final

Okay the trick seem to be to use ext-cdi1x-servlet and not ext-cdi1x and put those artifacts and their dependencies into Tomcat's lib directory. With this setup it's possible to deploy two wepapps with CDI support.

>
> and I did deploy two webapps into the webapps directory, both are using
> JAX-RS.
> Tomcat is running with unpackWars=false.
>
> When only one webapp is deployed everything seems to work correctly.
> But when I install both apps into the webapp directoy I get a similar
> stacktrace like https://java.net/jira/browse/JERSEY-2930
>
> I.e. "org.jboss.weld.context.ContextNotActiveException: WELD-001303: No
> active contexts for scope type javax.enterprise.context.RequestScoped"
>
> So is this bug or feature? what do you think about it
>
> with kind regards
> thomas
>