java.lang.NoClassDefFoundError: Could not initialize class com.google.gdata.client.contacts.ContactsService

Good day.

I've developed from serveral time a Tomcat's java servlet called after the the Google Authentication that must to creare a new entry on Google Contact. I have a my application on Google Console that allow it. In a past time this function running without problem. I've tried it now and an error occurs when I try to instance the ContactsService class. The code is ContactsService service = new ContactsService("ImmobiWeb"); The exception occurs is java.lang.NoClassDefFoundError: Could not initialize class com.google.gdata.client.contacts.ContactsService

ImmobiWeb is the name of my Google application in Google Console. The version of Google Contact Java API is gdata-contacts-3.0 and in this jar file the class is present.

How can I resolve my problem?

Best regards and good work.

Stefano Errani

2 answers

  • answered 2019-03-13 17:59 chinoy

    You can refer this article about the gdata client. In this case you need download the gdata-client library (jar) and place inside WEB-INF/classes directory in your war file

  • answered 2019-03-14 08:35 allkenang

    Did you check if 'gdata-contacts-3.0.jar' is in the WEB-INF folder of your web application?