IBM Support

PI46639: Name given to a bean with @Named annotation is not the correct d efault if it begins with two or more capitals

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • According to the CDI specification, the default name for a
    managed bean is the unqualified class name of the bean
    class, after converting the first character to lower case.
    For example, if the bean class is named ProductList, the
    default bean name is productList.
    
    However, this does not happen if the class name has two or
    more capital letters at the beginning, instead it does not
    decapitalize the first letter. For example, if the class is
    named JSFBean the default bean name is JSFBean not jSFBean
    as excpected.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty Profile - Contexts and       *
    *                  Dependency Injection (CDI)                  *
    ****************************************************************
    * PROBLEM DESCRIPTION: Name given to a bean with @Named        *
    *                      annotation is not the correct default   *
    *                      if it begins with two or more capitals  *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    According to the CDI specification, the default name for a
    managed bean is the unqualified class name of the bean class,
    after converting the first character to lower case.
    For example, if the bean class is named ProductList, the default
    bean name is productList.
    
    The problem is that if the class name has two or more capital
    letters at the beginning, its default bean name remains the same
    as the class name, which is wrong. For example: if the class is
    named JSFBean the default bean name is JSFBean not jSFBean as
    expected.
    

Problem conclusion

  • The logic to set the default bean name has been rectified under
    the jira https://issues.jboss.org/browse/WELD-1941 and then the
    fix has been reconsumed.
    
    The fix for this APAR is currently targeted for inclusion in fix
    pack 8.5.5.7.  Please refer to the Recommended Updates page for
    delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

  • The workaround is to set the bean name explicitly by using
    @Name("beanName").
    

Comments

APAR Information

  • APAR number

    PI46639

  • Reported component name

    WAS LIBERTY COR

  • Reported component ID

    5725L2900

  • Reported release

    855

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2015-08-11

  • Closed date

    2015-08-12

  • Last modified date

    2015-08-12

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WAS LIBERTY COR

  • Fixed component ID

    5725L2900

Applicable component levels

  • R855 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
28 April 2022