I have a problem with the deployment on Google app engine. The project runs fine on my PC but when I upload it, I get the following message:
Please enter code: Either the access code is invalid or the OAuth token is revoked.Details: invalid_grant
After that the browser opens a page where Google app engine asks for permission and, once I give it, provides a code to be copied in the application. But the input window doesn't work since it's stuck with the previous message.
I'm using NetBeans v8 with appengine-java-sdk v1.9, and got the same error with the example project
I alredy tried to delete the file .appcfg_oauth2_tokens_java but it didn't work.
Any help would be appreciated, thanks.
Appengine-web.xml
<?xml version="1.0" encoding="utf-8"?> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>fiery-plate-97015</application> <version>1</version> <threadsafe>true</threadsafe> <system-properties> <property name="java.util.logging.config.file" value="WEB- INF/logging.properties"/> </system-properties>
Web.xml
<?xml version="1.0" encoding="utf-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <servlet> <servlet-name>guestbook</servlet-name> <servlet-class>guestbook.GuestbookServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>guestbook</servlet-name> <url-pattern>/guestbook</url-pattern> </servlet-mapping> <servlet> <servlet-name>sign</servlet-name> <servlet-class>guestbook.SignGuestbookServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>sign</servlet-name> <url-pattern>/sign</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>guestbook.jsp</welcome-file> </welcome-file-list>
Situation update: i never used maven so i took me a while and a lot of errors to make it works. At the end i created a new project following step by step google instruction: https://cloud.google.com/appengine/docs/java/gettingstarted/creating. The project works fine on my pc and seems to deploy correctly but the i get a 500 server error when visiting the page. Meanwhile maven installation messed up with netbeans and, when deploying the first project, i get a exception before being asked for the code:
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
i checked the system variables to point to jdk folder but the problem persists.
Deploy to App Engine flexible environment You can deploy an image hosted by Artifact Registry to App Engine using the Google Cloud CLI. Create the App Engine configuration file for your app. Build a Docker image and push it to your repository. You can use Cloud Build to build and push your container to the repository.
When running mvn appengine:update and you get this:
"Either the access code is invalid or the OAuth token is revoked.Details: invalid_grant"
and then nothing, you need to delete
~/.appcfg_oauth2_tokens_java
On running the command again the browser will launch and ask you to login (to your google app engine account). After login you will get a code to paste into the command line...
Your <application>guestbook</applicaiton
tag in your appengine-web.xml is incorrect, I believe. That should be your unique project ID at http://console.developers.google.com. You can create one there if you don't have one.
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