I am working on an Apache Maven dynamic web project on eclipse. It uses static files (html, css, js) and a Java servlet. When I deploy my project to the google app engine, the Java servlet does not handle http requests. The project runs perfectly locally. The servlets use @WebServlet, but adding url-mapping to the xml doesn't work either. I deploy using mvn appengine:update. To troubleshoot, I decided to take a java class from a google github repository. I added the java file to my servlet folder and after deploying I get 404 errors for it as well.

This is my WebServlet annotation:

@WebServlet(name = "requests", description = "Requests: Trivial request",
    urlPatterns = "/requests")

Here is the bulk of my pom.xml:


Where am I going wrong?


<?xml version="1.0" encoding="UTF-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">

  • Can you post your appengine-web.xml? The production App Engine standard environment only supports Java 7 and Servlet 2.5. App Engine standard environment for Java 8 is now in beta, but requires an explicit <runtime>java8</runtime> to be added to your appengine-web.xml. Jul 24, 2017 at 15:54
  • @BriandeAlwis I updated my post. I did have that tag included in the xml.
    – Alec
    Jul 28, 2017 at 3:21
  • Finally found a moment to try to reproduce this and… it works for me. I used your same appengine-web.xml, but I don't have my source in src and www, and I don't pin a version on maven-war-plugin. I can only suggest you look at the "Tools" menu for in the Developer Console > App Versions and look at the "Debug" and verify that the uploaded archive looks as you expect. And check the logs to see what if there's anything anomalous reported. Aug 3, 2017 at 19:24
  • I had the same problem, and it happens to work (locally and on deploy) when there is no web.xml file in WEB-INF. I don't know if this is a bug or intended behaviour.
    – rkouye
    Sep 28, 2017 at 15:48

2 Answers 2


I was able to reproduce your issue. It seems you are missing the cloud tools plugin. To resolve it, add the following on your <plugins>:


If the above does not mitigate your issue, please post full error logs. Thanks


The Servlet 3.1 annotations do not seem to work in the Local Development Server at the time I am posting this.

I got the same code to work when actually deployed to GAE, but nothing with @WebServlet works with the local development environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.