I am trying to upload a file to GCS using java client libraries it complies fine i am been hit by java.lang.NoClassDefFoundError: com/google/api/services/storage/model/Bucket$Autoclass error while error ?? Can someone help me in knowing this
The class you mentioned seems to exist and is covered in JavaDoc. This lends some notion to the idea that you might be missing some JARs in your compilation/execution. I think to make progress, we are going to have to look in detail at your environment. Can you describe how you are building in your application? Are you using Maven or something similar to import dependent JARs? If yes, please provide as much detail as possible on how you are building your app.
I think part of the puzzle is when I hear you say you have downloaded JARs … did you manually download JARs? Here is my thinking …
I hear that you want to use Google Cloud Storage APIs … great. That means that you need the Google Cloud Storage JARs in your classpath and build environment. So … where then do we get those JARs? I think the anticipation is that you use a dependency manager such as Maven … if we then look here:
we see the Google Cloud Storage dependencies. If we pick the latest (2.17.x) and drill into that, we see that it has a ton of dependencies by itself. Included in that is:
Which is what (I believe) provides the missing class (JAR). However … just adding THAT JAR is likely going to fail too … because there are way more dependencies than just that one JAR. Are you using Maven or similar tool to download the complete dependency chain? If not, then I believe that is the problem.
Did anyone find the solution for this bug?
I have tried in AppEngine to deploy an app with the latest bom library and the problem is changed to this message:
IllegalStateException: You are currently running with version 2.2.0 of google-api-client. You need at least version 1.15 of google-api-client to run version 1.25.0 of the Cloud Storage JSON API library.