You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 .
The text was updated successfully, but these errors were encountered:
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
@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.
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 .
The text was updated successfully, but these errors were encountered: