SilverHoodCorp / gdata-java-client

Automatically exported from code.google.com/p/gdata-java-client
Apache License 2.0
0 stars 0 forks source link

gdata picasa file upload requires javamail jar or you get a NoClassDefFoundError #44

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Tried to upload a file to Picasa using registered AuthSub session token and 
I get a NoClassDefFoundError exception and the upload fails:

Exception in thread "main" java.lang.NoClassDefFoundError: 
com/sun/mail/util/BASE64EncoderStream
    at com.google.gdata.client.media.MediaService.initMediaRequest(Unknown Source)
    at com.google.gdata.client.media.MediaService.insert(Unknown Source)

Here is the offending code:

PicasawebService myService =
  new PicasawebService("example-testApp-1");
      myService.setAuthSubToken("the token", privateKey); //replace with your real session token
URL feedUrl = new URL (" 
http://picasaweb.google.com/data/feed/api/user/default/albumid/default");
      MediaFileSource myMedia = new MediaFileSource(new File("test.jpg"), "image/jpeg");

If I add the mail.jar from java mail 1.4.1  to the classpath 
(http://java.sun.com/products/javamail/downloads/index.html), the exception 
goes away and 
the upload succeeds.

What is the expected output? What do you see instead?
I expected the upload to work, got the following exception instead:

Exception in thread "main" java.lang.NoClassDefFoundError: 
com/sun/mail/util/BASE64EncoderStream
    at com.google.gdata.client.media.MediaService.initMediaRequest(Unknown Source)
    at com.google.gdata.client.media.MediaService.insert(Unknown Source)

What version of the product are you using? On what operating system?
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)

gdata 1.16.1

OSX 10.5.2

Please provide any additional information below.

Original issue reported on code.google.com by ascho...@gmail.com on 28 Mar 2008 at 8:54

GoogleCodeExporter commented 9 years ago
Yes this is a known dependency.  Please see dependencies wiki at
http://code.google.com/p/gdata-java-client/wiki/Dependencies for list of 
dependencies
for Google Data APIs.

Original comment by vbarat...@gmail.com on 2 Apr 2008 at 2:24

GoogleCodeExporter commented 9 years ago
Met at web 2.0-- followup about a way to improve documentation/error handling

-Ryan

Original comment by api.rboy...@gtempaccount.com on 25 Apr 2008 at 7:03

GoogleCodeExporter commented 9 years ago
aschobel,
     Following-up on this thread.  Though the dependency is documented, the error
message could be improved (ant should have pre-checked the existance of 
mail.jar). 
If you have any other suggestions on how to improve this (either documentation 
or
reporting the missing dependencies) please share with us, and if reasonable we 
would
be happy to incorporate in the upcoming releases.

- Prakash.

Original comment by vbarat...@gmail.com on 25 Apr 2008 at 7:49

GoogleCodeExporter commented 9 years ago
Internal bug tracker id: 1145380

Original comment by vbarat...@gmail.com on 26 Feb 2009 at 5:35

GoogleCodeExporter commented 9 years ago

Original comment by dwived...@gmail.com on 20 Aug 2010 at 10:52

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dwived...@gmail.com on 20 Aug 2010 at 10:57

Attachments: