4
votes

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
If this is blocking you and you don't have a solution you can try to revert the upgrade - see gcloud components restore or go back to the older SDK, which you can find here: storage.cloud.google.com/cloud-sdk-release - Dan Cornilescu
The log files appear to tell me what days I had what version installed. 158.0.0->163.0.0 appears to be when the problem was introduced. (I was able to search all *.log files in "C:\Users\Dave\AppData\Roaming\gcloud\logs\" for the phrase "Your current Cloud SDK version is".) - dthal
Reverting to Google Cloud SDK 158.0.0 from 163.0.0 unblocked me (per Dan Cornilescu's suggestion). That was the update that had occurred 36 hours ago. So it appears that a Google Cloud SDK update has broken IntelliJ's ability to deploy JSPs to GAE. I filed a bug report with JetBrains. Not sure whether Google or JetBrains makes the IntelliJ plugin for GAE, but it looks like it needs updating. - dthal
I'd now recommend investigating the manual deployment as well (i.e. using just the SDK) and have that prepared as an alternative. After all that's what the IDE is doing under the hood. The SDK upgrade is likely to be really needed at some point, switching to manual deployment would be a small price to pay when that happens. - Dan Cornilescu
Agreed. I had that thought but I am so happy to be unblocked. Thanks for the advice! Very helpful. I am new to all this tech. I can also use this as motivation to move away from my prototyping in JSP. I hope that would solve it as well. - dthal

1 Answers

2
votes

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