WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Unable to get a Java message driven bean (MDB) to work on Liberty

    Posted Wed November 25, 2020 11:26 AM
    Hello,

    I have been trying to get a Java message driven bean to work on Liberty 20.0.0.7, but I think I may be missing something. I have followed all the configs as described in the link below.

    https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_dep_msg_mdbwmq.html

    I can see that the MDB is being registered by Liberty. When I put a message on the MQ queue, I immediately see log messages in Liberty which means that my listener has been configured to listen to messages on the queue. However, there is an error where Liberty is unable to inject the MDB bean for use.

    From the trace logs, I see that the Websphere Liberty Bean deployment archive (BDA) is null. Below is code from getEjbDescriptor()  method of the CDIEJBManagedObjectFactoryImpl class where I get a null.

    open-liberty-gm-20.0.0.7\dev\com.ibm.ws.cdi.weld\src\com\ibm\ws\cdi\impl\managedobject\CDIEJBManagedObjectFactoryImpl.java

    WebSphereBeanDeploymentArchive bda = super.getCurrentBeanDeploymentArchive();
    // above returns null. WebSphereBeanDeploymentArchive cannot be obtained for some reason

    Below is a snippet from the Liberty log

    [ERROR ] CNTR0019E: EJB threw an unexpected (non-declared) exception during invocation of method "onMessage". Exception data: java.lang.NullPointerException

    at com.ibm.ws.cdi.impl.managedobject.CDIEJBManagedObjectFactoryImpl.getEjbDescriptor(CDIEJBManagedObjectFactoryImpl.java:147)



    Any help would be greatly appreciated. Thanks..

    ------------------------------
    Vivek Vasu
    System Analyst
    IBM
    Bangalore
    (804) 066-1257
    ------------------------------


  • 2.  RE: Unable to get a Java message driven bean (MDB) to work on Liberty

    Posted Thu November 26, 2020 07:56 AM
    When did you restart the server the last time?
    Any conflicts in your classpath?
    Would you have a docker or kubernetes with the full story - programs, configurations, code?
    Did you check if it works with 20.0.0.6 ?
    Did you google for CDIEJBManagedObjectFactoryImpl  and check if the known Null Pointer Exceptions match your case.

    ------------------------------
    Matthias Jungbauer
    ------------------------------



  • 3.  RE: Unable to get a Java message driven bean (MDB) to work on Liberty

    Posted Tue December 15, 2020 02:13 AM
    Edited by Vivek Vasu Tue December 15, 2020 02:14 AM
    I was able to get a solution for this issue. See below thread for more details on how the issue was resolved

    Unable to get a message driven bean to work on Liberty version 20.0.0.7 · Issue #15152 · OpenLiberty/open-liberty
    GitHub remove preview
    Unable to get a message driven bean to work on Liberty version 20.0.0.7 · Issue #15152 · OpenLiberty/open-liberty
    Dismiss GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. Sign up Millions of developers and companies build, ship, and maintain their software on GitHub - the largest and most advanced development platform in the world.
    View this on GitHub >



    ------------------------------
    Vivek Vasu
    System Analyst
    IBM
    Bangalore
    ------------------------------