1
votes

I want to list all album list from my picasa album. Here is the code.

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import com.google.gdata.client.photos.PicasawebService;
import com.google.gdata.data.photos.AlbumEntry;
import com.google.gdata.data.photos.UserFeed;
import com.google.gdata.util.AuthenticationException;
import com.google.gdata.util.ServiceException;


public class MyMain {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.out.print("hello");
        PicasawebService myService = new PicasawebService("exampleCo-exampleApp-1");
        try {
            myService.setUserCredentials("[email protected]", "myPassWord");
        } catch (AuthenticationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        URL feedUrl=null;
        try {
            feedUrl = new URL("https://picasaweb.google.com/data/feed/api/user/myMailAddress?kind=album");
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        UserFeed myUserFeed=null;
        try {
            myUserFeed = myService.getFeed(feedUrl, UserFeed.class);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (ServiceException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        for (AlbumEntry myAlbum : myUserFeed.getAlbumEntries()) {
            System.out.println(myAlbum.getTitle().getPlainText());
        }

    }

}

But the exception is occurring:

helloException in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException at MyMain.main(MyMain.java:20) Caused by: java.lang.ClassNotFoundException: javax.mail.MessagingException at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 1 more

Please help.

1

1 Answers

0
votes

Add mail.jar,activation.jar and additional.jar