Ok. Did as you requested. Bit of a kludge as you've got to make a runnable Jar from eclipse.
It worked fine in Eclipse, but I get exactly the same error as last time when the strategy launches in JForex.
24.02.2012 10:12:31.883 SEVERE connect.JForexTaskManager ] null
java.lang.ExceptionInInitializerError
at com.testpackage.jfutils.Spreadsheet.main(Spreadsheet.java:36)
at singlejartest.BoxBreakoutDB9.onStart(BoxBreakoutDB9.java:164)
at com.dukascopy.api.impl.execution.u.call(Unknown Source)
at com.dukascopy.api.impl.connect.au.a(Unknown Source)
at com.dukascopy.api.impl.connect.y.call(Unknown Source)
at com.dukascopy.api.impl.connect.y.call(Unknown Source)
at com.dukascopy.api.impl.execution.k.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.dukascopy.api.impl.execution.g$a.f(Unknown Source)
at com.dukascopy.api.impl.execution.g$a.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at com.google.gdata.client.Service.<clinit>(Service.java:97)
... 12 more
Here is the code I used:
package com.testpackage.jfutils;
import com.google.gdata.client.spreadsheet.SpreadsheetService;
import com.google.gdata.data.spreadsheet.SpreadsheetEntry;
import com.google.gdata.data.spreadsheet.SpreadsheetFeed;
import com.google.gdata.util.AuthenticationException;
import com.google.gdata.util.ServiceException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
/**
* This is a test template
*/
public class Spreadsheet {
public static void main(String[] args) {
try {
// Create a new Spreadsheet service
SpreadsheetService myService = new SpreadsheetService("My Application");
//myService.setUserCredentials(args[0],args[1]);
myService.setUserCredentials("
[email protected]", "mypassword");
// Get a list of all entries
URL metafeedUrl = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full");
System.out.println("Getting Spreadsheet entries...\n");
SpreadsheetFeed resultFeed = myService.getFeed(metafeedUrl, SpreadsheetFeed.class);
List<SpreadsheetEntry> entries = resultFeed.getEntries();
for(int i=0; i<entries.size(); i++) {
SpreadsheetEntry entry = entries.get(i);
System.out.println("\t" + entry.getTitle().getPlainText());
}
System.out.println("\nTotal Entries: "+entries.size());
}
catch(AuthenticationException e) {
e.printStackTrace();
}
catch(MalformedURLException e) {
e.printStackTrace();
}
catch(ServiceException e) {
e.printStackTrace();
}
catch(IOException e) {
e.printStackTrace();
}
}
}
And this is the exact list of external JAR dependencies so that it works fine in Eclipse both as a normal application and with the JForex standalone API:
google-collect-1.0-rc1.jar, jsr305.jar, gdata-client-1.0.jar, gdata-client-meta-1.0.jar, gdata-core-1.0.jar, gdata-media-1.0.jar, gdata-spreadsheet-3.0.jar, gdata-spreadsheet-meta-3.0.jar, activation.jar (JAF), mail.jar (JavaMail)
You can download the Google GData jars from:
https://code.google.com/p/gdata-java-cli ... p&can=2&q= And you can easily create a Google GData application with 'most' of the dependencies using the GData Eclipse plugin:
https://code.google.com/p/gdata-java-cli ... se-plugin/ Geoff.