If you are behind proxy then these sample projects will not read proxy from eclipse proxy settings.
to fix this issue you have to add some extra lines of code into your sample projects.
Create a object of ClientConfiguration class and set proxyhost and proxyport properties and then pass this object while creating client (ec2,S3 or sdb etc)
so your init method should look something like this after modification
private static void init() throws Exception {
/*
* This credentials provider implementation loads your AWS credentials
* from a properties file at the root of your classpath.
*
*/
ClientConfiguration clientCfg = new ClientConfiguration();
clientCfg.setProtocol(Protocol.HTTP);
//setup proxy connection:
clientCfg.setProxyHost("HTTP_PROXY_IP");
clientCfg.setProxyPort(8080);
AWSCredentialsProvider credentialsProvider = new ClasspathPropertiesFileCredentialsProvider();
ec2 = new AmazonEC2Client(credentialsProvider,clientCfg);
s3 = new AmazonS3Client(credentialsProvider,clientCfg);
sdb = new AmazonSimpleDBClient(credentialsProvider,clientCfg);
}
to fix this issue you have to add some extra lines of code into your sample projects.
Create a object of ClientConfiguration class and set proxyhost and proxyport properties and then pass this object while creating client (ec2,S3 or sdb etc)
so your init method should look something like this after modification
private static void init() throws Exception {
/*
* This credentials provider implementation loads your AWS credentials
* from a properties file at the root of your classpath.
*
*/
ClientConfiguration clientCfg = new ClientConfiguration();
clientCfg.setProtocol(Protocol.HTTP);
//setup proxy connection:
clientCfg.setProxyHost("HTTP_PROXY_IP");
clientCfg.setProxyPort(8080);
AWSCredentialsProvider credentialsProvider = new ClasspathPropertiesFileCredentialsProvider();
ec2 = new AmazonEC2Client(credentialsProvider,clientCfg);
s3 = new AmazonS3Client(credentialsProvider,clientCfg);
sdb = new AmazonSimpleDBClient(credentialsProvider,clientCfg);
}