Issue Details (XML | Word | Printable)

Key: GLASSFISH-20483
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: phil.zampino
Reporter: jjsnyder83
Votes: 0
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
glassfish

Enable and disable implicit scanning per JAR.

Created: 07/May/13 03:11 PM   Updated: 12/Aug/13 08:44 PM   Resolved: 12/Jun/13 04:45 PM
Component/s: cdi
Affects Version/s: None
Fix Version/s: 4.0.1

Time Tracking:
Not Specified

Tags:
Participants: aaronjwhiteside, jjsnyder83 and phil.zampino


 Description  « Hide

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.



jjsnyder83 added a comment - 07/May/13 03:43 PM

According to 12.1 of CDI spec:
"For compatibility with Contexts and Dependency 1.0, products must contain an option to cause an archive to be ignored by the container when no beans.xml is present."

We are probably a little light in our implementation of this as we only allow entire apps to be enabled/disabled for implicit scanning.


aaronjwhiteside added a comment - 28/May/13 02:56 PM

Related to GLASSFISH-20579. It would be good if this was part of the final 4.0.0 release. Perhaps something in glassfish-web.xml?


aaronjwhiteside added a comment - 28/May/13 07:42 PM

http://docs.jboss.org/weld/reference/latest/en-US/html/configure.html

This doesn't work as far as I can tell.

Maybe fixing the WELD integration so that this works is the solution?


aaronjwhiteside added a comment - 29/May/13 04:28 PM

I can add a beans.xml as per the CDI 1.1 spec, but that does not appear to work either.

CDI 1.1 Spec, Section 12.1
bean-discovery-mode="none" should disable an archives contents from being considered by CDI.


phil.zampino added a comment - 10/Jun/13 01:52 PM

The cited beans.xml addition should work. If it is being applied correctly, and Glassfish is not honoring it, then that's a bug. Can you provide an application to reproduce this behavior?

Additionally, there is a new deployment property that will disable support for implicit bean archives at the application level. (asadmin deploy --property implicitCdiEnabled=false <archive file>)