Error while Setting up an Instance in Appspot with GCS

image

@ewpatton any suggestions on the procedure?

Don't rely on what the system shows in that dialog. Instead, use echo %JAVA_HOME%. You should also show the values of java -version and javac -version. The latter is particularly important because gcloud needs to be able to find it in order to deploy.

I tried changing the path to echo %JAVA_HOME% . Still shows the same error. Can you give some detailed steps on what exactly should i do to get this running.

You didn't provide any of the information I requested, so I'm not sure how you expect us to help you.

Only type
echo %JAVA_HOME%

image

image

here are the values of java and javac version

image

1 Like

Can you include here the log file produced by gcloud when the deployment fails? There's not enough information to understand why it can't find the JDK given that javac is returning the right information.

E:\appinventor-sources\appinventor>gcloud app deploy --project=appcentral-311908 appengine\build\war
WARNING: and elements in appengine-web.xml are not respected
ERROR: (gcloud.app.deploy) Staging command [C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe -classpath C:\Users\sathy\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools\java\lib\appengine-tools-api.jar com.google.appengine.tools.admin.AppCfg --enable_new_staging_defaults stage E:\appinventor-sources\appinventor\appengine\build\war C:\Users\sathy\AppData\Local\Temp\tmpvyttbm30\tmprv8l2gsh] failed with return code [1].

------------------------------------ STDOUT ------------------------------------
Reading application configuration data...

Beginning interaction for module default...
0% Scanning for jsp files.
0% Compiling jsp files.
Unable to stage app: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
Please see the logs [C:\Users\sathy\AppData\Local\Temp\appcfg8169490269946325564.log] for further information.
------------------------------------ STDERR ------------------------------------
2021-04-29 12:25:10.074:INFO::main: Logging initialized @2996ms to org.eclipse.jetty.util.log.StdErrLog
Apr 29, 2021 12:25:11 PM com.google.apphosting.utils.config.IndexesXmlReader readConfigXml
INFO: Successfully processed E:\appinventor-sources\appinventor\appengine\build\war\WEB-INF\appengine-generated\datastore-indexes-auto.xml
Apr 29, 2021 12:25:53 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Apr 29, 2021 12:25:54 PM org.apache.jasper.JspC processFile
INFO: Built File: /login.jsp
Apr 29, 2021 12:25:54 PM org.apache.jasper.JspC execute
INFO: Generation completed with [0] errors in [389] milliseconds

E:\appinventor-sources\appinventor>

E:\appinventor-sources\appinventor>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.8.0_291

E:\appinventor-sources\appinventor>

Here's the total Log

Unable to stage:
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
at com.google.appengine.tools.admin.Application.compileJspJavaFiles(Application.java:1281)
at com.google.appengine.tools.admin.Application.compileJsps(Application.java:1257)
at com.google.appengine.tools.admin.Application.populateStagingDirectory(Application.java:979)
at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:866)
at com.google.appengine.tools.admin.AppAdminImpl.stageApplication(AppAdminImpl.java:539)
at com.google.appengine.tools.admin.AppAdminImpl.stageApplicationWithDefaultResourceLimits(AppAdminImpl.java:492)
at com.google.appengine.tools.admin.AppCfg$StagingAction.execute(AppCfg.java:2508)
at com.google.appengine.tools.admin.AppCfg.executeAction(AppCfg.java:363)
at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:211)
at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:118)
at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:114)
com.google.appengine.tools.admin.AdminException: Unable to stage app: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
at com.google.appengine.tools.admin.AppAdminImpl.stageApplication(AppAdminImpl.java:543)
at com.google.appengine.tools.admin.AppAdminImpl.stageApplicationWithDefaultResourceLimits(AppAdminImpl.java:492)
at com.google.appengine.tools.admin.AppCfg$StagingAction.execute(AppCfg.java:2508)
at com.google.appengine.tools.admin.AppCfg.executeAction(AppCfg.java:363)
at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:211)
at com.google.appengine.tools.admin.AppCfg.(AppCfg.java:118)
at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:114)
Caused by: java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
at com.google.appengine.tools.admin.Application.compileJspJavaFiles(Application.java:1281)
at com.google.appengine.tools.admin.Application.compileJsps(Application.java:1257)
at com.google.appengine.tools.admin.Application.populateStagingDirectory(Application.java:979)
at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:866)
at com.google.appengine.tools.admin.AppAdminImpl.stageApplication(AppAdminImpl.java:539)
... 6 more

This doesn't appear to be correct. You'd want it to show C:\Program Files\Java\jdk1.8.0_291\bin\java.exe. Please double check your PATH variable and make sure it is correct. You want it to include %JAVA_HOME%\bin.

These are my paths. Is there anything i need to add?

image

The order is important. Make sure you put them first to make sure the Oracle versions of the EXEs are not picked up since it's likely providing a newer version of Java than you need.

I made the changes and now get this one

E:\appinventor-sources\appinventor>gcloud app deploy --project=appcentral-311908 appengine\build\war
WARNING: and elements in appengine-web.xml are not respected
Services to deploy:

descriptor: [E:\appinventor-sources\appinventor\appengine\build\war\WEB-INF\appengine-web.xml]
source: [E:\appinventor-sources\appinventor\appengine\build\war]
target project: [appcentral-311908]
target service: [default]
target version: [20210430t003329]
target url: [https://appcentral-311908.uc.r.appspot.com]

Do you want to continue (Y/n)? y

Beginning deployment of service [default]...
ERROR: (gcloud.app.deploy) Cannot upload file [C:\Users\sathy\AppData\Local\Temp\tmpr4q41agr\tmpkofl1vqg\ode/CFD64BD35BB69602F334A1A00AEB5EE1.cache.js], which has size [34983220] (greater than maximum allowed size of [33554432]). Please delete the file or add to the skip_files entry in your application .yaml file and try again.

I have already addressed this problem here:

Please consider using the search feature in the future to look for potential solutions.

Ok sure Thanks @ewpatton and


I ran into this and after rectifying this error, I should run this command gcloud app deploy --project=appcentral-311908 appengine\build\war again right?

Since it has uploaded all the files i just asked.

Yes, once you enable the Google Cloud Build API you should be able to proceed. You only need to do this once per App Engine project (this isn't specific to App Inventor--it's how Google App Engine / Google Cloud works)

@Satzd68 As @ewpatton said you need to enable the cloud build API but you will need a credit card added to gcloud

Sure @Pradevel @ewpatton Thanks for your support

1 Like