Open puja-jena opened 3 years ago
What GCP product are you deploying to? Can you provide steps for me to reproduce the error? I can try deploying the sample here to the GCP product you're using to see if I encounter the same issue.
If you deploy using the sample build.gradle
instead of your own build.gradle.kts
, does it work as expected?
I am deploying to Kubernetes Engine. Here is a simplified version of the code we are trying to deploy: https://github.com/puja-jena/testingGCPpubsublib. You can reproduce the error by running the Dockerfile I have included in the sample. There will be an error like this: Error: Could not find or load main class MainKt Caused by: java.lang.ClassNotFoundException: MainKt
. I have not tried it with a build.gradle
file, but I can attempt that and let you know what happens.
After trying with build.gradle
, I am getting the following error: Could not find com.google.cloud:google-cloud-pubsub:. Required by: project :
EDIT: Updated this with a more simplified example that should be much easier to debug.
I am trying to set up a pubsub POC with my current code (Kotlin) but we are not able to get the needed dependencies to run with it. I am following https://github.com/GoogleCloudPlatform/kotlin-samples/blob/master/pubsub/build.gradle as a guide. I am following the Gradle Kotlin DSL syntax for dependencies and I have added the dependencies to the build.gradle.kts, which now looks like this:
The app is a very basic hello world app:
I have the following in a Dockerfile that I'm using the build the app:
When running and building the app as a jar file, I'm getting the following error:
Error: Could not find or load main class MainKt Caused by: java.lang.ClassNotFoundException: MainKt
Can someone tell me whether the syntax I am using is incorrect?