how fix new error that's stopping app engine deployment? (after Google pushed a Cloud Tools SDK update today)

大兔子大兔子 提交于 2020-01-03 16:48:06

问题


I am using IntelliJ and I am deploying to Google App Engine Standard Environment.

I have a new error after Google pushed a Cloud Tools SDK update to my development machine.

I can no longer deploy current or previously deployed working versions to Google App Engine using IntelliJ.

**error**: package com.google.appengine.api.users does not exist import 

warning: [options] bootstrap class path not set in conjunction with -source 1.7
C:\Users\Dave\AppData\Local\Temp\1500787298445-0\org\apache\jsp\clinicalTrials**_jsp.java**:6: **error**: **package com.google.appengine.api.users does not exist**
import com.google.appengine.api.users.User;

(Note: there are 17 such errors in 4 different JSP files, the IDE has no problem navigating the <%@ page import="com.google.appengine.api.users.User" %> lines, they all appear to be in users package, they are not new and have worked for some time without any trouble).

The Google-initiated update occurred earlier today. It has also broken my ability to deploy old code. I literally have a binary archive of my development tree (not just a commit) and that version will no longer deploy and generates the same error as my latest code.

So, it appears to be something that changed in the environment, not in the code. Local deployment of the old binary backup of code works just fine (as previously); it is only a remote publish/deploy problem.

I have seen guidance to navigate to all JSP files in development/local deployment to trigger local trouble, but no errors were detected.

The current JSP files worked fine earlier (plus I have the old binary backup that is now broken but previously deployed successfully).


gcloud components install has already been executed for core, gsutil, gcloud and app-engine-java (all went smoothly)

gcloud init has been run (went smoothly)

gcloud components update ->yields-> "All components are up to date."

Using JDK 1.8 w/ Project Language Level = "7" (hasn't changed since I started this project 1 month ago).

More checks made based on other posts: IntelliJ is pointing to the JDK (not the JRE). %JAVA_HOME% is correct.

("Google App Engine Integration" plugin was flagged as obsolete/something...not sure when this 1st happened but I noticed this while digging, however it seems irrelevant because "Google Cloud Tools" seems to cover this now and it is enabled and up to date..."Google Plugin Conflict - You are running an old plugin (Google App Engine Integration) that conflicts with the installed Google Cloud Tools for Java plugin. - Please click here to deactivate the old plugin."...I clicked and deactivated while trying to fix symptom...didn't help.)

I updated IntelliJ IDE. Didn't help. (from version 2017.1.5 to 2017.2)


I have created a clean development tree in a new empty folder. I followed the guestbook sample from Google and I have the same problem. That's a clean codebase (untouched sample code) and that's following tutorial steps to deploy. It deploys fine on Windows using mvn command-line commands from the tutorial. It fails when I try to switch to IntelliJ to perform the deployment. IntelliJ deploys fine to a local server, just fails to deploy to remotely to Google cloud appspot.com. So, it appears to be specific to the IntelliJ IDE.

From IntelliJ window...

INFO: Built File: \guestbook.jsp
warning: [options] bootstrap class path not set in conjunction with -source 1.7
C:\Users\Dave\AppData\Local\Temp\1500868898750-0\org\apache\jsp\**guestbook_jsp.java**:6: **error: package com.google.appengine.api.users does not exist**
import com.google.appengine.api.users.User;
                                 ^

The build activity/staging/jsp-compiling in C:\Users\Dave\AppData\Local\Temp seems to be new...i.e., concomitant with when the trouble began...I don't see this Temp folder activity preceeding the Google GAE update that initated the trouble (i.e., no similar files and folders before 7/22/2017).


Maven (command-line, Windows) has no problem compiling the JSP files...as illustrated by this output:

Beginning interaction for module default... 0% Created staging directory at: 'C:\Users\Dave\AppData\Local\Temp\appcfg3686517196875747128.tmp' 5% Scanning for jsp files. 8% Compiling jsp files. Jul 23, 2017 8:47:32 PM org.apache.jasper.JspC processFile INFO: Built File: \guestbook.jsp warning: [options] bootstrap class path not set in conjunction with -source 1.7 11% Generated git repository information file. 20% Scanning files on local disk. 25% Initiating update. 28% Cloning 1 static files. 31% Cloning 24 application files. 40% Uploading 2 files. 52% Uploaded 1 files. 61% Uploaded 2 files. 68% Sending batch containing 2 file(s) totaling 1KB. 73% Initializing precompilation... 90% Deploying new version. 95% Closing update: new version is ready to start serving. 98% Uploading index definitions. Update for module default completed successfully. Success. Cleaning up temporary files for module default... [INFO] ----------------------------------------------------------------------- [INFO] BUILD SUCCESS [INFO] ----------------------------------------------------------------------- [INFO] Total time: 53.733 s [INFO] Finished at:

2017-07-23T20:47:53-07:00 [INFO] Final Memory: 35M/580M [INFO]


回答1:


As noted on https://github.com/GoogleCloudPlatform/google-cloud-intellij/issues/1596, and without knowing more about your setup, it appears as though you are hitting an open bug in gcloud (to be fixed in the next release of gcloud). The bug being improper handling of spaces in the cloud SDK path.

As a temporary workaround see https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/2202

The gist of the workaround being:

  • move/copy Cloud SDK to a path without spaces
  • or downgrade gcloud to 159: gcloud components update --version 159.0.0


来源:https://stackoverflow.com/questions/45261960/how-fix-new-error-thats-stopping-app-engine-deployment-after-google-pushed-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!