Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
This is a solved problem worth sharing with the community and a potential opportunity for evolving DSS.
I had a database driver for jre11 under my DATA_DIR/lib/jdbc/ directory. I was able to successfully deploy an API Service to Kubernetes cluster (thus based on the api-deployer base image), but when querying an enrichment endpoint (which needed to connect to the database) the request failed with an error like this:
java.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I tried many things that didn't solve it:
Though I did all of these steps described above, when I built my deployment I could still see in the logs the old jar being included (!!!!). Even after rebuilding all the Docker images and redeploying the API Service several times.
What SOLVED the problem:
There was a temporary/cached directory under `DATA_DIR/tmp/api_deployer/name-of-my-deployment/dockerbuildcontext/lib-jdbc/`
I deleted the root folder `DATA_DIR/tmp/api_deployer/name-of-my-deployment` and redeployed my API Service and the jre11 jar file was no more there, FINALLY 🙂
My Conclusion
Maybe if a jar file is upgrade under lib/jdbc, the cached/tmp files won't be a problem because the latest version of the jar will prevail in runtime. However, if you are trying to downgrade a jar file (maybe due to an error like `UnsupportedClassVersionError` ) you will need to delete that.
Also, maybe these tmp files should be discarded automatically, when the base images are rebuilt. Somehow, this cached data seems to be useful in some aspects but prone to errors like this.
Hey @daniel_adornes thank you for sharing your observation, solution, and suggestion. We appreciate your desire to share your knowledge with the rest of us!
If you think it warrants it, I would suggest proposing the potential opportunity to evolve DSS you identify as a Product Idea. Thanks again!
Hey @daniel_adornes thank you for sharing your observation, solution, and suggestion. We appreciate your desire to share your knowledge with the rest of us!
If you think it warrants it, I would suggest proposing the potential opportunity to evolve DSS you identify as a Product Idea. Thanks again!
Hey @CoreyS ! You're welcome! I didn't know about this "Product Ideas" page.. This is great! I'll post my case there.
Thank you
Daniel
Hey @CoreyS ! I just created the Product Idea there: https://community.dataiku.com/t5/Product-Ideas/Error-when-downgrading-JDBC-driver-for-API-Services/i...
Thank you for the suggestion!
Cheers,
Daniel