Topic
3 replies Latest Post - ‏2011-03-31T19:51:04Z by bergmark
denisF
denisF
12 Posts
ACCEPTED ANSWER

Pinned topic CDI don't see some beans based on their package name!

‏2011-03-30T02:40:35Z |
The name of the package makes CDI to detect or not beans...
In the attached ear file, the BeanManager in DenisSystemEventListener (A JSF SystemEventListener):
  • detects a bean named org.jboss.xseam.BasicBeanOK
  • do not detect a bean named org.jboss.seam.BasicBeanBad

Both have the same java source, the name of the package is different...

WOW!
Updated on 2011-03-31T19:51:04Z at 2011-03-31T19:51:04Z by bergmark
  • SystemAdmin
    SystemAdmin
    462 Posts
    ACCEPTED ANSWER

    Re: CDI don't see some beans based on their package name!

    ‏2011-03-30T12:44:36Z  in response to denisF
    Denis,

    Good catch and sorry about the hurdle in testing the beta. It appears that the core of the Application Servers class-scanning facilities knows to skip EE scanning of common user-bundled jars that don't generally speaking have EE annotations.

    http://www-01.ibm.com/support/docview.wss?uid=swg1PK87053

    org.jboss.seam is among the packages that aren't scanned by default. You can edit the referenced properties file locally (properties/amm.filter.properties) for relief while the CDI folks figure out what further can be done.

    --
    Eric Covener
    IBM HTTP Server and Apache Development
  • denisF
    denisF
    12 Posts
    ACCEPTED ANSWER

    Re: CDI don't see some beans based on their package name!

    ‏2011-03-30T15:40:58Z  in response to denisF
    WOW. IMHO this is MAJOR problem
    I think this "optimization" is not compatible with CDI as almost any POJO can be injected almost anywhere.
    I don't think that WAS can presume that some jar/packages will not contain a bean that will be injected somewhere except from IBM specific packages
    For CDI the inclusion/exclusion of jar could be based on the presence or not of the file "beans.xml" that activates or not CDI
    Also for the workaround described in PK87053, there is no way to "remove" a jar or package from the exclusion list of "properties/amm.filter.properties" as the 3 possible lists of jars/packages are unioned by WAS...
    So there is no way, except by manually editing a file that comes from the installation of WAS, to remove some package from the exclusion list...
    And to finish, please please at least remove org.jboss.seam of excluded packages from the list as seam 3 that I'm testing right now http://seamframework.org/Seam3 is build around CDI
    It took me 4 days to understand why seam 3 was not starting with WAS 8...
  • bergmark
    bergmark
    8 Posts
    ACCEPTED ANSWER

    Re: CDI don't see some beans based on their package name!

    ‏2011-03-31T19:51:04Z  in response to denisF
    An internal defect has been opened for re-evaluating the default entries in this file. Thank you for trying the WebSphere Application Server Beta!