Unable to run the sample application for google cloud platform
See original GitHub issueI am just starting off on google-cloud-platform. I have created an account and a project on cloud console. I was trying to run some of the sample apps provided. I started with the sample app for cloud storage provided at:
https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/storage/cloud-client
I have installed apache maven 3.5.0 on my PC. I followed the steps provided in the link, that is I gave the following commands:
mvn clean package -DskipTests
and then
mvn exec:java -Dexec.mainClass=com.example.storage.QuickstartSample -Dexec.args="my-bucket-name"
The first command succeeded. However, the second command failed. I got the following error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:06 min
[INFO] Finished at: 2017-06-15T18:27:55+05:30
[INFO] Final Memory: 15M/172M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project storage-google-cloud-samples: An exception occured while executing the Java class. connect timed out -> [Help 1]
Now, the computer where I was running this command on, is behind a proxy. However, my proxy settings have been set in the file conf/settings.xml, also when I ran the first command, it successfully downloaded some packages, so I’m not sure if it is due to some proxy issue, however to check, I tried it on another machine, which is not behind a proxy.
I gave the same two commands. The first one succeeded and the second failed again, with the following (different) error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:02 min
[INFO] Finished at: 2017-06-15T18:22:31+05:30
[INFO] Final Memory: 13M/32M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (d
efault-cli) on project storage-google-cloud-samples: An exception occured while
executing the Java class. 401 Unauthorized -> [Help 1]
So my queries are:
- What could be the cause for the error in the first case? Is it something to do with proxy settings? If yes, then where/how should I specify the settings?
- What could be the cause for the error in the second case where I am not behind any proxy?
- Am i missing some step here?
- Also , if you look at the source for this sample app, there is just a single file which basically creates a bucket. The bucket is passed as an argument from command line. Now, as per my understanding, first there needs to a project in the cloud console to create any resources. So where will this bucket be created? As in shouldn’t we be specifying the project-ID where this bucket is to be created?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Have you done the following:
It should pick up the projectID from gcloud.
@architsinha Please re-open if you are still running into issues