Reputation: 4151
I only beginning to learn, how to use java with Goole App Engine Standard. I use Eclipse 4.6.3 for that. I created web project and coded some junk, then I decided to try list files at Google Cloud Storage. Here is my code:
public static ArrayList<String> getFilesInBucket(String bucket_name)
{
/*Line 235*/GcsService gcsService = GcsServiceFactory.createGcsService(RetryParams.getDefaultInstance());
ListResult result = null;
try { result = gcsService.list(bucket_name, ListOptions.DEFAULT); }
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
ArrayList<String> files = new ArrayList<String>();
while (result.hasNext())
{
ListItem l = result.next();
if (!l.isDirectory())
files.add(l.getName());
}
return files;
}
This junk works locally, but after I deploy this it stops. I see errors in Google Console:
java.lang.NoClassDefFoundError: com/google/api/client/http/HttpRequestInitializer
at MyJunk.getFilesInBucket (ADServlet.java:235)
Every jar that is added to lib directory in src is also added into web-inf/lib.
I even opened problems tab and quick fixed every "Eclipse warning: XXXXXXXXXXX.jar will not be exported or published." junk by this:
(This is not my screen).
And yet my code fails at runtime on GAE Standard... What else I can do to solve this?
Upvotes: 2
Views: 2981
Reputation: 2964
The Google Cloud libraries have a lot of dependencies. Rather than try to chase them down by hand, let your machine do it for you. Two suggestions:
Upvotes: 2