Hi! @ApplicationScoped in EARs is not well specified. Most containers seem to treat it as 1 per EAR. Means you will share the contextual instance across webapps IF the class is in a shared classloader. Means in the EARs /lib folder.
LieGrue, strub On Wednesday, 14 May 2014, 13:16, Lars-Fredrik Smedberg <[email protected]> wrote: Hi! > > >Are there any nice articles / guides on how to package EJBs, classes placed in >WARs and have it work together with CDI? > > >For EJBs we have the choice of packaging them as seperate EJB-jars or to place >them in the WAR (as a jar in WEB-INF/lib or as classes in WEB-INF/classes). > > >If we e.g. have a CDI managed @ApplicationScoped bean in a CDI archive >(jar-file) and package that jar-file in two separate WARs. Will they then >share application context or not? > > >Can anyone explain the mechanism here and maybe if I have a choice of a shared >application context or not and if so the different packaging options I have? > > > > >Regards >Lars-Fredrik > > >-- >Med vänlig hälsning / Best regards > >Lars-Fredrik Smedberg > >STATEMENT OF CONFIDENTIALITY: >The information contained in this electronic message and any >attachments to this message are intended for the exclusive use of the >address(es) and may contain confidential or privileged information. If >you are not the intended recipient, please notify Lars-Fredrik Smedberg >immediately at [email protected], and destroy all copies of this >message and any attachments. > >
