Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.net.UnknownHostException: when trying to process an appspot.com URL from an actions-on-google project #23

Closed
fitsie007 opened this issue Jun 4, 2019 · 2 comments

Comments

@fitsie007
Copy link

This issue is with reference to issue 22. I am getting a java.net.UnknownHostException when I try to parse the JSON returned by a REST service in a Google Cloud Project.
My actions-on-google app is in one project (https://sampleapp-3cbe2.appspot.com) on Google cloud and my REST Service is in another Google Cloud project (https://fitzroi-rest-api-0525.appspot.com). Do you know of any solution to this or do you have any recommendations?

@Fleker
Copy link
Member

Fleker commented Jun 5, 2019

Have you looked at the error message or similar issues?

@fitsie007
Copy link
Author

Thanks. However, those suggestions only work when we have access to the hosts file to add a host, which I don't believe we do on the actions-on-google.
I was able to resolve the error using the Google Cloud documentation here: https://cloud.google.com/appengine/docs/standard/java/issue-requests. It turns out that we have to turn on urlfetch to be able to issue certain URL requests from an app-engine app.
Here's the resulting appengine-web.xml file

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <runtime>java8</runtime>
    <threadsafe>true</threadsafe>
    <url-stream-handler>urlfetch</url-stream-handler>
</appengine-web-app>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants