IDMS Business API java.lang.ClassNotFoundException: ca.idms.jdbc.IdmsDataSource in VSCode
search cancel

IDMS Business API java.lang.ClassNotFoundException: ca.idms.jdbc.IdmsDataSource in VSCode

book

Article ID: 434531

calendar_today

Updated On:

Products

IDMS IDMS - Database

Issue/Introduction

When starting the Business API server for local testing from Visual Studio Code (VSCode), the application fails to start with the following error in the api.logERROR Error loading data sources: java.lang.ClassNotFoundException: ca.idms.jdbc.IdmsDataSource

Environment

  • IDE: Visual Studio Code (VSCode)
  • Build Tool: Gradle (specifically versions 7.5.1 and earlier)
  • Java Version: Java 19, 21, or later
  • Database: IDMS

Cause

The error is caused by a version incompatibility between the Gradle build system and the installed Java version. Gradle 7.5.1 does not support Java 19 and later. When running on Java 21, the build fails to correctly initialize the class cache and load the IDMS JDBC driver classes, resulting in the ClassNotFoundException.

Resolution

To resolve this error, upgrade the Gradle version and refresh the project environment:

  1. Verify JAR Location: Ensure that the idmsjdbc.jar file is present in the /lib directory of your project. If the file is missing or corrupted, download a fresh copy from the Broadcom Support Portal. 
  2. Upgrade Gradle: Update your project to use Gradle 8.0.2 or higher, which provides full support for Java 21.
  3. Clean and Rebuild: Execute the following commands in the VSCode terminal:
    • ./gradlew clean
    • ./gradlew build
  4. Restart Server: Run the server using ./gradlew bootRun.
  5. Environment Check: Ensure the Coding Pack for Java is installed in VSCode to maintain proper project indexing.