App Connect

 View Only
Expand all | Collapse all

External Jar showing NoClassDefFound Error in Java Compute Node

  • 1.  External Jar showing NoClassDefFound Error in Java Compute Node

    Posted Tue September 07, 2021 09:19 AM
    Hi Team,

    In my integration flow, Java compute node I am doing base64 encoding. To do that I am using
    commons-codec jar. I have downloaded the jar and adding in build path of the project.

    Its not showing any compilation error.But run time I am getting
    NoClassDefFoundError

    Code:
    import org.apache.commons.codec.binary.Base64;

    Base64.encodeBase64String(cipherText).replace("\r", "").replace("\n", "");

    Why I am getting this error ven adding the library in build path.

    Any help will be really appreciated!!!




    ------------------------------
    SELVAKUMAR ANANTHARAJ
    ------------------------------


  • 2.  RE: External Jar showing NoClassDefFound Error in Java Compute Node

    Posted Tue September 07, 2021 10:10 AM
    Hi SELVAKUMAR,

    I think, you need to keep the jar in the shared-classes folder so that broker/integration node can refer it in run time.

    Below are the path where the jars can be placed.

    For Windows: C:\ProgramData\IBM\MQSI\shared-classes

    For Linux: /var/mqsi/shared-classes

    Regards,
    Saha

    ------------------------------
    Prosanta Saha
    ------------------------------



  • 3.  RE: External Jar showing NoClassDefFound Error in Java Compute Node

    Posted Tue September 07, 2021 10:22 AM
    Edited by SELVAKUMAR ANANTHARAJ Tue September 07, 2021 10:22 AM
    Thanks Prosanta Saha!!!. After copying the jar files to shared-classes Its working fine.

    ------------------------------
    SELVAKUMAR ANANTHARAJ
    ------------------------------