Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible workaround for deploying multiple Vaadin 8.x WARs in a single EAR on Wildfly #282

Open
peholmst opened this issue Mar 5, 2019 · 1 comment
Labels
question v8 Issues or PRs for Vaadin 8 version of the add-on

Comments

@peholmst
Copy link
Member

peholmst commented Mar 5, 2019

An issue that has poped up now and then is that it is not possible to deploy multiple Vaadin 8 WARs (including CDI) inside a single EAR. I have investigated this using Wildfly 16 and I think I may have found a workaround.

The problem seems to be that some of the @CDIUI beans end up with a scope annotation that has been loaded by the wrong class loader. This in turn seems to be caused by the fact that Weld caches the scope classes that it has retrieved from the stereotype annotations. Since @CDIUI contains the @UIScope annotation, it will be cached once and then reused everywhere - including in UIs that come from a different WAR (and thus from a different class loader).

The workaround seems to be to simply add the @UIScope annotation directly to the UI classes (next to the @CDIUI annotation). By doing this, Weld follows a different path to look up the scope and seems to find the right scope from the right class loader.

There may be more issues than this one hiding below the surface but here is at least a start if you need to deploy multiple WARs inside a single EAR.

This at least seems to solve the problem described in #97 .

@peholmst peholmst changed the title Possible workaround for #97 (multiple Vaadin 8.x WARs in a single EAR on Wildfly) Possible workaround for deploying multiple Vaadin 8.x WARs in a single EAR on Wildfly Mar 5, 2019
@pleku pleku pinned this issue Mar 5, 2019
@pleku pleku added question v8 Issues or PRs for Vaadin 8 version of the add-on labels Mar 5, 2019
@mrts
Copy link

mrts commented Mar 8, 2019

@peholmst Thank you, I confirm that this fixes the problem in the test application that I created. Let's see if we run into problems in a larger real life application - but I think this can be closed now.

@mshabarov mshabarov unpinned this issue Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question v8 Issues or PRs for Vaadin 8 version of the add-on
Projects
None yet
Development

No branches or pull requests

3 participants