title: How to avoid the "ServiceConfigException: No versions exist!" error while implementing API Management with Cloud Endpoints Frameworks?
body: <p>I've built a test API in a new Maven-based App Engine Standard project created in Eclipse. Upon adding API Management and deploying on production server, I get a 500 response when trying out the API on the Endpoints Portal. Error logs in the dashboard show the following exception: </p>
  
  <pre><code>endpoints.repackaged.com.google.api.config.ServiceConfigException: 
  Failed to fetch default config version for service 'networking-1088.appspot.com'.
  No versions exist!
  </code></pre>
  
  <p>I checked out similar questions like this <a href="https://stackoverflow.com/questions/50144500/serviceconfigexception-when-api-management-is-added">one</a> but I have used the project ID as the service name consistently across files, have not included service version, and have used all the necessary boilerplate code from the documentation.</p>
  
  <p>Below are relevant snippets from my files:</p>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;properties&gt;
      &lt;appengine.maven.plugin.version&gt;1.3.2&lt;/appengine.maven.plugin.version&gt;
  
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
  
      &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
  
      &lt;maven.compiler.showDeprecation&gt;true&lt;/maven.compiler.showDeprecation&gt;
  
      &lt;endpoints.project.id&gt;networking-1088&lt;/endpoints.project.id&gt;
  &lt;/properties&gt;
  
  &lt;dependencyManagement&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;google-cloud-bom&lt;/artifactId&gt;
              &lt;version&gt;0.80.0-alpha&lt;/version&gt;
              &lt;type&gt;pom&lt;/type&gt;
              &lt;scope&gt;import&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/dependencyManagement&gt;
  
  &lt;dependencies&gt;
      &lt;!-- Compile/runtime dependencies --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
          &lt;version&gt;3.1.0&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.inject&lt;/groupId&gt;
          &lt;artifactId&gt;javax.inject&lt;/artifactId&gt;
          &lt;version&gt;1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
          &lt;artifactId&gt;javax.servlet.jsp-api&lt;/artifactId&gt;
          &lt;version&gt;2.3.1&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;jstl&lt;/groupId&gt;
          &lt;artifactId&gt;jstl&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.endpoints&lt;/groupId&gt;
          &lt;artifactId&gt;endpoints-framework&lt;/artifactId&gt;
          &lt;version&gt;2.2.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- [START api_management] --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.endpoints&lt;/groupId&gt;
          &lt;artifactId&gt;endpoints-management-control-appengine-all&lt;/artifactId&gt;
          &lt;version&gt;1.0.11&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- [END api_management] --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.googlecode.objectify&lt;/groupId&gt;
          &lt;artifactId&gt;objectify&lt;/artifactId&gt;
          &lt;version&gt;5.1.22&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.appengine&lt;/groupId&gt;
          &lt;artifactId&gt;appengine-api-1.0-sdk&lt;/artifactId&gt;
          &lt;version&gt;1.9.71&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;!-- for hot reload of the web application --&gt;
      &lt;outputDirectory&gt;${project.build.directory}/${project.build.finalName}/WEB-INF/classes&lt;/outputDirectory&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;versions-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;compile&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;display-dependency-updates&lt;/goal&gt;
                          &lt;goal&gt;display-plugin-updates&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.6&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;webResources&gt;
                      &lt;resources&gt;
                          &lt;directory&gt;${basedir}/src/main/webapp/WEB-INF&lt;/directory&gt;
                          &lt;filtering&gt;true&lt;/filtering&gt;
                          &lt;targetPath&gt;WEB-INF&lt;/targetPath&gt;
                      &lt;/resources&gt;
                  &lt;/webResources&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;com.google.cloud.tools&lt;/groupId&gt;
              &lt;artifactId&gt;appengine-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${appengine.maven.plugin.version}&lt;/version&gt;
          &lt;/plugin&gt;
          &lt;!-- [START endpoints_plugin] --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;com.google.cloud.tools&lt;/groupId&gt;
              &lt;artifactId&gt;endpoints-framework-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.0.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;!-- plugin configuration --&gt;
                  &lt;hostname&gt;${endpoints.project.id}.appspot.com&lt;/hostname&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;!-- [END endpoints_plugin] --&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;!-- Wrap the backend with Endpoints Frameworks v2. --&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;EndpointsServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.google.api.server.spi.EndpointsServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;services&lt;/param-name&gt;
          &lt;param-value&gt;com.iitbaapune.app.RegistrantEndpoint&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/servlet&gt;
  
  &lt;!-- Route API method requests to the backend. --&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;EndpointsServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/_ah/api/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  
  &lt;!-- [START api_management] --&gt;
  &lt;!-- Add a filter that fetches the service config from service management. --&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;endpoints-api-configuration&lt;/filter-name&gt;
      &lt;filter-class&gt;com.google.api.control.ServiceManagementConfigFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  
  &lt;!-- Add a filter that performs Endpoints logging and monitoring. --&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;endpoints-api-controller&lt;/filter-name&gt;
      &lt;filter-class&gt;com.google.api.control.extensions.appengine.GoogleAppEngineControlFilter&lt;/filter-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;endpoints.projectId&lt;/param-name&gt;
          &lt;param-value&gt;${endpoints.project.id}&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;endpoints.serviceName&lt;/param-name&gt;
          &lt;param-value&gt;${endpoints.project.id}.appspot.com&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;endpoints-api-configuration&lt;/filter-name&gt;
      &lt;servlet-name&gt;EndpointsServlet&lt;/servlet-name&gt;
  &lt;/filter-mapping&gt;
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;endpoints-api-controller&lt;/filter-name&gt;
      &lt;servlet-name&gt;EndpointsServlet&lt;/servlet-name&gt;
  &lt;/filter-mapping&gt;
  &lt;!-- [END api_management] --&gt;
  </code></pre>
  
  <p><strong>appengine-web.xml</strong></p>
  
  <pre><code>  &lt;!-- [START env_variables] --&gt;
  &lt;env-variables&gt;
      &lt;env-var name="ENDPOINTS_SERVICE_NAME" value="networking-1088.appspot.com" /&gt;
  &lt;/env-variables&gt;
  &lt;!-- [END env_variables] --&gt;
  </code></pre>
  
  <p>How can I get rid of this error while retaining API management?</p>