GoogleCloudPlatform / google-cloud-eclipse

Google Cloud Platform plugin for Eclipse
Apache License 2.0
86 stars 49 forks source link

Classes sometimes not published: ClassNotFoundException on servlet class #2149

Open briandealwis opened 7 years ago

briandealwis commented 7 years ago

I've hit an odd situation similar to #1603 but during local launch: performing a Run of the local devappserver fails as the class files aren't published.

The source project has the requisite files (note content of build/classes/):

$ find ../runtime-gcloud-CLEAR/aes -type f
../runtime-gcloud-CLEAR/aes/.classpath
../runtime-gcloud-CLEAR/aes/.project
../runtime-gcloud-CLEAR/aes/.settings/.jsdtscope
../runtime-gcloud-CLEAR/aes/.settings/com.google.cloud.tools.eclipse.appengine.deploy.prefs
../runtime-gcloud-CLEAR/aes/.settings/org.eclipse.jdt.core.prefs
../runtime-gcloud-CLEAR/aes/.settings/org.eclipse.wst.common.component
../runtime-gcloud-CLEAR/aes/.settings/org.eclipse.wst.common.project.facet.core.xml
../runtime-gcloud-CLEAR/aes/.settings/org.eclipse.wst.jsdt.ui.superType.container
../runtime-gcloud-CLEAR/aes/.settings/org.eclipse.wst.jsdt.ui.superType.name
../runtime-gcloud-CLEAR/aes/build/classes/HelloAppEngine.class
../runtime-gcloud-CLEAR/aes/build/test-classes/HelloAppEngineTest.class
../runtime-gcloud-CLEAR/aes/build/test-classes/MockHttpServletResponse.class
../runtime-gcloud-CLEAR/aes/src/main/java/HelloAppEngine.java
../runtime-gcloud-CLEAR/aes/src/main/webapp/favicon.ico
../runtime-gcloud-CLEAR/aes/src/main/webapp/index.html
../runtime-gcloud-CLEAR/aes/src/main/webapp/META-INF/MANIFEST.MF
../runtime-gcloud-CLEAR/aes/src/main/webapp/WEB-INF/appengine-web.xml
../runtime-gcloud-CLEAR/aes/src/main/webapp/WEB-INF/web.xml
../runtime-gcloud-CLEAR/aes/src/test/java/HelloAppEngineTest.java
../runtime-gcloud-CLEAR/aes/src/test/java/MockHttpServletResponse.java

The deploy assembly looks ok:

screen shot 2017-07-14 at 12 27 56 pm

But the deployed location doesn't contain the class files, even after a "Servers > Clean":

$ find ../runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes/ -type f
../runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes//favicon.ico
../runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes//index.html
../runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes//META-INF/MANIFEST.MF
../runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes//WEB-INF/appengine-web.xml
../runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes//WEB-INF/web.xml

Enabling detailed logging when cleaning the server (thus forcing a republish):

org.eclipse.wst.server.core /finest 14/07/17 12:20.12.205 -->-- Publishing to server: App Engine Standard at localhost -->--
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.205 Server.publishImpl(): kind=<clean> modules=null
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.205 ->- Firing publish started event ->-
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.205   Firing publish started event to org.eclipse.wst.server.ui.internal.ServerUIPlugin$3@1f07b8c7
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.205   Firing publish started event to org.eclipse.wst.server.ui.internal.cnf.ServersView2$8@3366105f
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.205 -<- Done firing publish started event -<-
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.206 -->-- Publishing to server: App Engine Standard at localhost -->--
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.206 Task.init PublishTask[com.google.cloud.tools.eclipse.appengine.publishTask]
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.206 Starting publish
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.206 Performing tasks: 1
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.207 Copying: META-INF to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.208 Copying: MANIFEST.MF to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.208 Copying: MANIFEST.MF to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes/META-INF/MANIFEST.MF
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.209 Copying: WEB-INF to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.209 Copying: classes to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.209 Copying: appengine-web.xml to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.209 Copying: appengine-web.xml to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes/WEB-INF/appengine-web.xml
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.209 Copying: lib to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.209 Copying: web.xml to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.209 Copying: web.xml to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes/WEB-INF/web.xml
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.210 Copying: favicon.ico to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.210 Copying: favicon.ico to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes/favicon.ico
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.211 Copying: index.html to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes
org.eclipse.wst.server.core /publishing 14/07/17 12:20.12.211 Copying: index.html to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/aes/index.html
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.212 Executing publishers: 0
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.212 -->-- Publishing module
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.212 Module: Module[aes,org.eclipse.jst.jee.server:aes]
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.212 --<-- Done publishing module
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.212 --<-- Done publishing --<--
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.212 Saving publish info to /Users/bsd/Manumitting/Projects/GooglePluginEclipse/runtime-gcloud-CLEAR/.metadata/.plugins/org.eclipse.wst.server.core/publish/publish0.dat
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.212 ->- Firing publishing finished event: Status OK: unknown code=0 OK null ->-
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.213   Firing publishing finished event to org.eclipse.wst.server.ui.internal.ServerUIPlugin$3@1f07b8c7
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.213   Firing publishing finished event to org.eclipse.wst.server.ui.internal.cnf.ServersView2$8@3366105f
org.eclipse.wst.server.core /finest 14/07/17 12:20.12.213 -<- Done firing publishing finished event -<-
briandealwis commented 7 years ago

If I look at the ModulePublishInfo, the server seems to see the HelloWorld.class:

screen shot 2017-07-14 at 12 38 43 pm

chanseokoh commented 7 years ago

Can this be https://github.com/GoogleCloudPlatform/google-cloud-eclipse/issues/1798#issuecomment-305285160? It's the same situation: class files are not in the publish directory.

briandealwis commented 7 years ago

Oh no, it seems to be a heisenbug: putting a breakpoint has caused it to work :-(