-
Notifications
You must be signed in to change notification settings - Fork 136
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
Enable and disable implicit scanning per JAR. #20483
Comments
@glassfishrobot Commented |
@glassfishrobot Commented We are probably a little light in our implementation of this as we only allow entire apps to be enabled/disabled for implicit scanning. |
@glassfishrobot Commented |
@glassfishrobot Commented This doesn't work as far as I can tell. Maybe fixing the WELD integration so that this works is the solution? |
@glassfishrobot Commented CDI 1.1 Spec, Section 12.1 |
@glassfishrobot Commented Additionally, there is a new deployment property that will disable support for implicit bean archives at the application level. (asadmin deploy --property implicitCdiEnabled=false ) |
@glassfishrobot Commented |
@glassfishrobot Commented bean-discovery-mode="none" does work for me but this issue is for disabling implicit scanning per JAR. To disable scanning per JAR I tried the following beans.xml and it didn't work for me. I continue to get WELD errors.
Should this beans.xml work with Glassfish 4.1? Can someone provide an example of a beans.xml file that excludes per JAR that does work? Thanks. |
@glassfishrobot Commented |
@glassfishrobot Commented I have jars that contain unimplemented interfaces, and therefore when they're scanned for CDI, they cause an error and I can't deploy my app. I tried explicitly using an exclude rule in my beans.xml but it seems to take no effect. My options are:
Both of these options are bad since they require me to explicitly annotate everything that's being injected right now, which is quite a lot of stuff... |
@glassfishrobot Commented
Note that for option 2 you must do this for each individual jar. The beans.xml in WEB-INF only applies to the classes in WEB-INF/classes. |
@glassfishrobot Commented |
|
beans.xml cannot be added to a third-party JAR. Disabling implicit CDI is one option but but it works at the application level.
This will not work when different third-party JARs make different assumptions about implicit beans. So it would be helpful if GlassFish (or Weld) offered a way to enable or disable implicit scanning per JAR.
The text was updated successfully, but these errors were encountered: