0
votes

I'm using the gdata-java-client from Google to work with Google spreadsheets.

SpreadsheetService s = new SpreadsheetService("myAppName");

This works in Eclipse. As soon as I run it on App Engine (dev environment), I get NoClassDefError.

The following jars are in WEB-INF/lib

  • gdata-spreadsheet-meta-3.0.jar
  • gdata-spreadsheet-3.0.jar
  • jsr305.jar
  • google-collect-1.0-rc1.jar
  • gdata-client-1.0.jar

Instantiate other objects from those jars such as SpreadsheetEntry for example works. The solutions I've found for this problem lied all in missing jars. I think this isn't the problem here, since I could create other objects from those jars.

1
Which class is not found? - Andrei Volgin
@Andrei Volgin I'm not sure. SpreadsheetService or one of its superclasses. The constructor is not even called. Might be a problem with static initializers? - user2725152
Copy the error message here. It must tell you which class is not found. This error indicates a missing jar - we just need to find out which one. - Andrei Volgin
It's the GoogleService class. - user2725152
Thanks for your help! java.lang.NoClassDefFoundError: com/google/gdata/client/GoogleService at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at ...... Caused by: java.lang.ClassNotFoundException: com.google.gdata.client.GoogleService at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) - user2725152

1 Answers

0
votes

The reason for the problem was the Google Eclipse Plugin I used to manage the spreadsheet API. I got the hint from here.

After adding following jars to WEB-INF/lib and adding those to the classpath it finally works.

  • gdata-core-1.0.jar
  • gdata-client-1.0.jar
  • gdata-spreadsheet-3.0.jar
  • gdata-spreadsheet-meta-3.0.jar
  • guava-11.0.2.jar
  • jsr305.jar