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

Support for Weld setting emptyBeansXmlModeAll in Glassfish 7 #25034

Closed
bvfalcon opened this issue Jul 9, 2024 · 5 comments
Closed

Support for Weld setting emptyBeansXmlModeAll in Glassfish 7 #25034

bvfalcon opened this issue Jul 9, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@bvfalcon
Copy link

bvfalcon commented Jul 9, 2024

Impossible to set Weld configuration setting emptyBeansXmlModeAll

Environment Details

  • Eclipse GlassFish 7.0.15 (commit: 6f2f4c2)
  • JDK version: 17.0.10
  • OS: Microsoft Windows 10

Problem Description

Glassfish 7 has Weld 5.1.2 as a CDI implementation. Weld has a feature which simplifies migration from CDI 3.0 (Glassfish 6) to CDI 4.0 (Glassfish 7). But this feature is inacceessible in Glassfish 7.

Steps to reproduce

Project with demonstartion of problem

Impact of Issue

Webapp project contains CDI-modules in separate jars (located in WEB-INF/lib). It is necessary to add bean-discovery-mode="all" into beans.xml for each module. Modules are developed by different providers and in some cases changes cannot be done. This Weld feature gives a possibility to make changes only in one webapp, not in each module. Absence of support this Weld feature blocks a migration into Glassfish 7.

PS.

  1. Weld has three possibility to set settings. Two of them are shown in demo project. Has Glassfish any integration setting to provide this feature for Weld? How Glassfish use Weld: as Weld SE, Weld Servlet or any other way?
  2. Problem reproduces also for Wildfly 31. It is very possible, this is not a Glassfish-specific issue. Issue for Weld project also created.
@dmatej dmatej added the bug Something isn't working label Jul 9, 2024
@arjantijms
Copy link
Contributor

Good point, we should indeed do this.

We mainly use the weld-osgi-bundle, and use Weld in deep integration mode, where large parts of the Weld code are replaced / augmented by GlassFish specific code. Most of that can be found here: https://github.com/eclipse-ee4j/glassfish/tree/master/appserver/web/weld-integration/src/main/java/org/glassfish/weld

@manovotn
Copy link

FTR, I added a comment to the Weld issue - EE integrators fully control the bootstrap of Weld so they need to have their own config option for this. WFLY already supports it.

@bvfalcon
Copy link
Author

bvfalcon commented Jul 11, 2024

With help of @manovotn we cleared situation. This is not a bug, but kind of disturbing twist in CDI development: in this aspect backwards compatibility was lost durung migration from cdi 3.0 to 4.0 (discussions here, here and here).

@manovotn
Copy link

To be exact, as I stated in the Weld issue, the reproducer has technically invalid beans.xml as according to the XSD file, the bean-discovery-mode attribute is required.
Fixing that will also fix the deployment issues @bvfalcon is having.

That being said, GF is still required to provide a switch for legacy behavior of actually empty beans.xml file.

@bvfalcon bvfalcon closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
@arjantijms
Copy link
Contributor

That being said, GF is still required to provide a switch for legacy behavior of actually empty beans.xml file.

Yes, i remember we had this on the TODO somewhere back then, but it was missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants