ballerina-lang
ballerina-lang copied to clipboard
[Bug]: `NoClassDefFoundError` when running a Ballerina application with runtime platform dependencies in a docker container
trafficstars
Description
Some Ballerina connectors have platform dependencies which required to be passed at runtime. Ballerina IBM CTG connector is one such connector and when running an application with the aforementioned connector, we get a NoClassDefFoundError for a platform dependency.
error: java.lang.NoClassDefFoundError {"message":"com/ibm/ctg/client/GatewayRequest","cause":error("java.lang.ClassNotFoundException",message="com.ibm.ctg.client.GatewayRequest")}
at ballerinax.ibm.ctg.0.Client:externInit(client.bal:38)
ballerinax.ibm.ctg.0.Client:init(client.bal:31)
ayeshalmeida.ibm_ctg_simple.0:main(main.bal:11)
Steps to Reproduce
- Currently the IBM CTG connector is not released to the central. You could publish it to the local-central by executing the following command from the connector repository root [1]
./gradlew clean build -PpublishToLocalCentral=true
- Build the attached project [2] with
--cloud=dockerargs.
bal build --cloud=docker
- Run the docker container and check the logs.
docker run -d ibm-ctg-simple:latest
[1] - https://github.com/ballerina-platform/module-ballerinax-ibm.ctg [2] - ibm-ctg-simple.zip
Affected Version(s)
- Ballerina 2201.10.0
OS, DB, other environment details and versions
No response
Related area
-> Runtime
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response