Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

No Class Def Found Error while trying to upload the file on google cloud storage

ShantanuKumar_0-1726054635556.png

I am getting the Class Definition Not found error while trying to upload file on Google cloud storage.

I am using google-cloud-storage version 2.33.0 which is using google-http-client-jackson2 which has a package like "com/google/api/client/json/jackson2/JacksonFactory" and not "com/google/api/client/json/jackson/JacksonFactory". I don't understand why the latter is called

"com/google/api/client/json/jackson2/JacksonFactory"

Solved Solved
0 2 165
1 ACCEPTED SOLUTION

Hi @ShantanuKumar,

I appreciate your time in bringing up your questions to our community. I noticed that you recently filed a post for the same issue you encountered here. You may check my response in that post.

To answer your question about the two distinct Jackson libraries, the “.../jackson/JacksonFactory” and “.../jackson2/JacksonFactory” are different in such a way that both belong to different Jackson versions (such as Jackson v1.x and v2.x respectively). If somewhere in your code is still referencing JacksonFactory, it may be the case that it’s still tied to an older version of a Google API library.

Also, the JacksonFactory class in relation to Google Cloud Storage API client is deprecated as referenced here as Google Cloud recommends switching to GsonFactory. As mentioned in the other forum, it may be best to adapt to the latest instructions when installing the Cloud Storage API client.

I hope the above information is helpful.

View solution in original post

2 REPLIES 2

Can someone help me in fixing this issue

Hi @ShantanuKumar,

I appreciate your time in bringing up your questions to our community. I noticed that you recently filed a post for the same issue you encountered here. You may check my response in that post.

To answer your question about the two distinct Jackson libraries, the “.../jackson/JacksonFactory” and “.../jackson2/JacksonFactory” are different in such a way that both belong to different Jackson versions (such as Jackson v1.x and v2.x respectively). If somewhere in your code is still referencing JacksonFactory, it may be the case that it’s still tied to an older version of a Google API library.

Also, the JacksonFactory class in relation to Google Cloud Storage API client is deprecated as referenced here as Google Cloud recommends switching to GsonFactory. As mentioned in the other forum, it may be best to adapt to the latest instructions when installing the Cloud Storage API client.

I hope the above information is helpful.