GoogleCloudPlatform / gcloud-maven-plugin

Cloud SDK Maven Plugin for Google App Engine (Managed VMs and non Managed VMs)
Apache License 2.0
29 stars 24 forks source link

Static files configured in appengine-web.xml give 404 in the development server #72

Closed wmwong closed 8 years ago

wmwong commented 8 years ago

Google Cloud SDK 91.0.1 app-engine-java 1.9.30

I have configured appengine-web.xml to serve static files:

<static-files>
  <include path="/css/*.css" />
</static-files>

I run the following commands: $ mvn clean $ mvn gcloud:run

However, when trying to visit http://localhost:8080/css/index.css, it gives me a 404 with an error message specifying that no handlers could be found.

"mvn gcloud:run" uses dev_appserver.py to start the development server. The app.yaml given is from target/simple-service-webapp/WEB-INF/app.yaml. Looking into this file, I see that the static root is being set to static. However, this directory does not exist in target/simple-service-webapp. However, it does exist in target/appengine-staging. In fact, if I copy the dev_appserver.py command and replace simple-service-webapp with appengine-staging, I can reach /css/index.css.

This seems like a bug and that target/simple-service-webapp should have a static directory.

simple-service-webapp.zip

ludoch commented 8 years ago

I guess you would see the same bug without the maven plugin. So no fix can be done in this github project. You can track an internal bug 25198225

On Wed, Jan 6, 2016 at 1:26 PM, Wesley Wong notifications@github.com wrote:

Google Cloud SDK 91.0.1 app-engine-java 1.9.30

I have configured appengine-web.xml to serve static files:

I run the following commands: $ mvn clean $ mvn gcloud:run

However, when trying to visit http://localhost:8080/css/index.css, it gives me a 404 with an error message specifying that no handlers could be found.

"mvn gcloud:run" uses dev_appserver.py to start the development server. The app.yaml given is from target/simple-service-webapp/WEB-INF/app.yaml. Looking into this file, I see that the static root is being set to static. However, this directory does not exist in target/simple-service-webapp. However, it does exist in target/appengine-staging. In fact, if I copy the dev_appserver.py command and replace simple-service-webapp with appengine-staging, I can reach /css/index.css.

This seems like a bug and that target/simple-service-webapp should have a static directory.

simple-service-webapp.zip https://github.com/GoogleCloudPlatform/gcloud-maven-plugin/files/80383/simple-service-webapp.zip

— Reply to this email directly or view it on GitHub https://github.com/GoogleCloudPlatform/gcloud-maven-plugin/issues/72.

wmwong commented 8 years ago

Thanks for the internal bug. Closing this.