DoumentAI - unable to deploy using background function

I have maven project, on upload in bucket it trigger the background function. Which uses the file to process file using Document AI. Deployment is successful, but when I upload the file. It triggers below error.

Failed to execute LabelScan.process.Example java.lang.NoClassDefFoundError: com/google/cloud/documentai/v1/DocumentProcessorServiceSettings at LabelScan.process.Example.accept(Example.java:39) at LabelScan.process.Example.accept(Example.java:24) at

pom.xml include :

com.google.cloud.functions functions-framework-api 1.0.1 jar com.google.cloud google-cloud-document-ai 2.7.4 org.apache.maven.plugins maven-compiler-plugin 3.8.1 .google/

You can try checking if you have the correct version of the API client library installed and if it matches with the version of the API that you are trying to use. If this does not work, you can try checking if there are any other dependencies that your project requires which may be missing.