Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

NoClassDefFoundError: com/google/common/collect/Maps #180

Closed
GoogleCodeExporter opened this issue Apr 6, 2015 · 27 comments
Closed

NoClassDefFoundError: com/google/common/collect/Maps #180

GoogleCodeExporter opened this issue Apr 6, 2015 · 27 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. When Im trying to create this:

myService = new SpreadsheetService( "Teste" );

I got a error:

Error:
Exception in thread "main" java.lang.NoClassDefFoundError:
com/google/common/collect/Maps
        at
com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:118)
        at
com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:100)
        at com.google.gdata.client.Service.<clinit>(Service.java:532)
        at RotorTecnology.GoogleGenericDB.autentic(GoogleGenericDB.java:48)
        at RotorTecnology.GoogleGenericDB.main(GoogleGenericDB.java:315)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        ... 5 more

Original issue reported on code.google.com by lcarle...@gmail.com on 1 Sep 2009 at 1:59

@GoogleCodeExporter
Copy link
Author

I believe you are missing google-collections jar.  See
http://code.google.com/p/gdata-java-client/wiki/Dependencies for list of 
dependencies
for this library.

Original comment by vbarat...@gmail.com on 1 Sep 2009 at 2:24

  • Changed state: RequestedFeedback

@GoogleCodeExporter
Copy link
Author

Original comment by yanivin...@gmail.com on 28 Apr 2010 at 4:44

  • Changed state: Invalid

@GoogleCodeExporter
Copy link
Author

Yes, It has solved the problem !!

Original comment by Ranjit.D...@gmail.com on 5 Oct 2010 at 12:07

@GoogleCodeExporter
Copy link
Author

i am also getting same error,but i am able to download google-collections jar 
file
when i go to http://code.google.com/p/gdata-java-client/wiki/Dependencies 
it shows google-collections pdf not google-collections.jar


i am attaching the error message
please help me out...

Original comment by sabeer....@gmail.com on 28 Oct 2010 at 9:16

Attachments:

@GoogleCodeExporter
Copy link
Author

i am also getting same error,but i am able to download google-collections jar 
file
when i go to http://code.google.com/p/gdata-java-client/wiki/Dependencies 
it shows google-collections pdf not google-collections.jar


i am attaching the error message
please help me out...

Original comment by sabeer....@gmail.com on 28 Oct 2010 at 9:23

Attachments:

@GoogleCodeExporter
Copy link
Author

as you can read on this site the project has evolved into guava:
http://code.google.com/p/guava-libraries/downloads/list

Original comment by joh...@yahoo.de on 10 Nov 2010 at 3:27

@GoogleCodeExporter
Copy link
Author

I solved this problem by download the jar file guava-r07.jar. 
http://code.google.com/p/guava-libraries/downloads/detail?name=guava-r07.zip
Try it.

Original comment by linyi...@yahoo.com.tw on 1 Dec 2010 at 10:44

@GoogleCodeExporter
Copy link
Author

guava-r07.jar worked as a solution to me too! thanks.

Original comment by mms...@gmail.com on 25 Feb 2011 at 1:25

@GoogleCodeExporter
Copy link
Author

Thanks it also worked for me.

Original comment by mashr...@gmail.com on 2 Mar 2011 at 8:55

@GoogleCodeExporter
Copy link
Author

guava-r07.jar also worked for me.

Original comment by 74.san...@gmail.com on 13 Jul 2011 at 8:34

@GoogleCodeExporter
Copy link
Author

I m getting the same error & plz tell me the steps to install guava-r07 .jar in 
eclipse sdk5.3.2.
Please help me  fast............................

Original comment by chaitali...@gmail.com on 28 Sep 2011 at 12:01

@GoogleCodeExporter
Copy link
Author

Good,Thanks!

Original comment by sishu...@gmail.com on 21 Oct 2011 at 10:02

@GoogleCodeExporter
Copy link
Author

Helped Me.. Thanks but now during Oauth process i am getting 
com.google.gdata.client.authn.oauth.OAuthException: Error getting HTTP 
response.. Can anyone help me?

Original comment by yukti.ty...@dbydx.com on 21 Feb 2012 at 7:21

1 similar comment
@GoogleCodeExporter
Copy link
Author

Helped Me.. Thanks but now during Oauth process i am getting 
com.google.gdata.client.authn.oauth.OAuthException: Error getting HTTP 
response.. Can anyone help me?

Original comment by yukti.ty...@dbydx.com on 21 Feb 2012 at 7:21

@GoogleCodeExporter
Copy link
Author

Exception in thread "main" java.lang.NoSuchMethodError: 
com.google.common.collect.ImmutableSet.copyOf([Ljava/lang/Object;)Lcom/google/co
mmon/collect/ImmutableSet;

I am getting this error in my code and code is attached below

Original comment by afs.abhi...@gmail.com on 15 Jun 2012 at 4:13

Attachments:

@GoogleCodeExporter
Copy link
Author

Please use guava-11.0.2.jar in lib for the above error

Original comment by mailrake...@gmail.com on 20 Jul 2012 at 12:03

@GoogleCodeExporter
Copy link
Author

I've been fighting with a lot of dependency issues with gdata - I don't think 
guava-11.0.2.jar is the fix - I added that. Is it possible that developing with 
app engine means appengine-sdk jars are compiled with older versions of 
com.google.common.collect?  Since the guide says to compile with an rc1 of 
collections, i'd be nice to get an updated guide that takes into account app 
engine projects. Really stuck here.

java.lang.NoSuchMethodError: 
com.google.common.collect.ImmutableSet.copyOf([Ljava/lang/Object;)Lcom/google/co
mmon/collect/ImmutableSet;

Original comment by bsautner@gmail.com on 26 Jul 2012 at 4:17

@GoogleCodeExporter
Copy link
Author

I'm in this boat too.

Appengine has a bunch of core guava classes repackaged in the appengine jars, 
which are loading those classes before my updated classes.

Even if we can get our development servers working right, will the production 
environment have loaded the repackaged classes before our libs get checked?

Original comment by Ja...@wetheinter.net on 7 Aug 2012 at 8:41

@GoogleCodeExporter
Copy link
Author

Looking into the repackaged classes, and the method signature appears to be 
valid in both my copy of guava, and the repackaged copy (found in 
appengine-api-labs.jar).

I did, however find a workaround:

Include guava source on your classpath, as it will override whatever copy 
appengine is using.  I had to take com.google.common.collect and 
com.google.common.base (guice decided to complain as soon as I took 
ImmutableSet but not a bunch of others).

Recommended use of workaround is to link source in eclipse to a copy of guava 
source
git clone https://code.google.com/p/guava-libraries/

I used source inclusion patterns **/base/** and **/collect/** to pull in the 
necessary classes to defeat this bug.

Can someone in google submit a request for appengine to repackage updated jars?

Original comment by Ja...@wetheinter.net on 7 Aug 2012 at 9:17

@GoogleCodeExporter
Copy link
Author

guava-r07-gwt.jar worked for me. guava-r07.jar threw a Dalvik error.

Original comment by jni...@mcruiseon.com on 27 Sep 2012 at 4:50

@GoogleCodeExporter
Copy link
Author

real thanks to this forum. this error was killing me since yesterday, guava 
solved my problem also

Original comment by burakc...@gmail.com on 5 Jul 2013 at 6:28

@GoogleCodeExporter
Copy link
Author

worked with guava ;)

Original comment by eliocasc...@gmail.com on 17 Dec 2013 at 4:56

@GoogleCodeExporter
Copy link
Author

i hav downloaded the guava 16.0.1 jar.. but it has following Exception

Exception  :  Unrecognized content type:text/html;charset=UTF-8

Original comment by CS.SVI...@gmail.com on 11 Apr 2014 at 8:56

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

please help me with a Google Calendar code in which i included the jars file 
listed below:
guava-17.0.jar
gdata-core-1.0.jar
gdata-client-1.0.jar
gdata-calendar-1.0.jar and
google-collections-1.0-rc2.jar
although i am getting the exception i.e.

Exception in thread "main" java.lang.NoSuchMethodError: 
com.google.common.collect.ImmutableSet.copyOf([Ljava/lang/Object;)Lcom/google/co
mmon/collect/ImmutableSet;
at 
com.google.gdata.wireformats.AltFormat$Builder.setAcceptableTypes(AltFormat.java
:399)
    at com.google.gdata.wireformats.AltFormat$Builder.setAcceptableXmlTypes(AltFormat.java:387)
    at com.google.gdata.wireformats.AltFormat.<clinit>(AltFormat.java:49)
    at com.google.gdata.client.Service.<clinit>(Service.java:558)
    at cala.Cala.main(Cala.java:205)

Original comment by anbhart...@gmail.com on 4 May 2014 at 8:50

Attachments:

@DocGreenRob
Copy link

is anyone reading these posts? I need assistance. Please respond to doc.green.rob@gmail.com subject "Email Audit Assistance". I am willing to pay for assistance, just have a few questions to answer.

@montaro
Copy link

montaro commented Jan 14, 2016

Thanks, adding latest Guava as dependency solved the problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants