I am very new to Google App Engine (GAE) and Glassware development (for Google Glass).
I configured mirror-quickstart-java project on Netbeans
and Apache tomcat
also I was successful in running the project but I am having trouble ahead.
My requirement is, I don't want to use google app engine for the development of my own Glassware as I want to use few third party APIs. Also the app engine doesn't support javax.imageio
and BufferedImage
apis.
I have following questions in mind
app-engine
for mirror-quickstart-java/Glassware development?message The API package 'urlfetch' or call 'Fetch()' was not found.
description The server encountered an internal error that prevented it from fulfilling this request.
com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'urlfetch' or call 'Fetch()' was not found.
com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:100)
com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:38)
com.google.api.client.extensions.appengine.http.UrlFetchRequest.execute(UrlFetchRequest.java:75)
com.google.api.client.http.HttpRequest.execute(HttpRequest.java:980)
com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:299)
com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeTokenRequest.execute(GoogleAuthorizationCodeTokenRequest.java:175)
com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeTokenRequest.execute(GoogleAuthorizationCodeTokenRequest.java:78)
com.google.glassware.AuthServlet.doGet(AuthServlet.java:56)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
Moving the quick start project from App Engine to another J2EE container is pretty straight forward, but it does require some code changes:
UrlFetchTransport
with an alternative like NetHttpTransport
. This will impact AuthUtil.java
and MirrorClient.java
ListableAppEngineCredentialStore.java
with a new implementation of CredentialStore
that works with whatever persistence layer you prefer (Hibernate, SQLite, etc).There are also some changes you need to make to the dependency management and build scripts, but you're on your own there since that depends a lot on how you plan to run it.
It is not required to use appengine for your Glassware. The only requirement is that subscription replies will be sent to you using HTTPS, so you will need to make sure your server is correctly configured to handle this.
The urlfetch package is specific to appengine. You should make sure the appengine libraries are removed from your project and any code that references it is re-written to use the standard java.net libraries. Since this is part of the authentication, you may want to use an alternative OAuth2 method such as Google+ Sign-In.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With