I'm trying to migrate Google App Engine to java8 using the migration guide below.
https://cloud.google.com/appengine/docs/standard/java/migrating-to-java8
it says that: -
To have App Engine run your application in the Java 8 runtime, add
<runtime>java8</runtime>
to your appengine-web.xml file and redeploy the app.
when i try to do that i get the following error at the "runtime" tag:
element runtime is not allowed here
did i miss anything? This GAE is a backend module for my android app. I am using gradle on Android studio as the development environment.
prior to this, I have also migrated successfully to cloudEndpoints V2 using https://cloud.google.com/endpoints/docs/frameworks/java/migrating
edit: added error log
Jan 03, 2018 3:39:52 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
SEVERE: Received exception processing D:\GitlabProjects\XushuNarrator\backend\build\exploded-backend\WEB-INF/appengine-web.xml
com.google.apphosting.utils.config.AppEngineConfigException: Unrecognized element <runtime>
at com.google.apphosting.utils.config.AppEngineWebXmlProcessor.processSecondLevelNode(AppEngineWebXmlProcessor.java:183)
at com.google.apphosting.utils.config.AppEngineWebXmlProcessor.processXml(AppEngineWebXmlProcessor.java:65)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.processXml(AppEngineWebXmlReader.java:132)
at com.google.apphosting.utils.config.AppEngineWebXmlReader.readAppEngineWebXml(AppEngineWebXmlReader.java:76)
at com.google.apphosting.utils.config.EarHelper.readWebModule(EarHelper.java:165)
at com.google.appengine.tools.development.ApplicationConfigurationManager$WarModuleConfigurationHandle.readConfiguration(ApplicationConfigurationManager.java:414)
at com.google.appengine.tools.development.ApplicationConfigurationManager.<init>(ApplicationConfigurationManager.java:159)
edit 2: the following is the gradle build for the backend. (After migration from V1 to V2)
//MIGRATION GUIDE
//https://cloud.google.com/endpoints/docs/frameworks/legacy/v1/java/migrating
buildscript {
repositories {
jcenter()
}
dependencies {
// V2: Add the new App Engine and Endpoints Frameworks plugin dependencies
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.2'
classpath 'com.google.cloud.tools:appengine-gradle-plugin:1.3.2'
// classpath 'com.google.appengine:gradle-appengine-plugin:1.9.59'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
// V2: Apply new App Engine and Endpoints Framework server plugins
apply plugin: 'com.google.cloud.tools.appengine'
apply plugin: 'com.google.cloud.tools.endpoints-framework-server'
//apply plugin: 'appengine'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
dependencies {
// appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.59'
// compile 'com.google.appengine:appengine-endpoints:1.9.59'
// compile 'com.google.appengine:appengine-endpoints-deps:1.9.59'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.googlecode.objectify:objectify:5.1.9'
compile 'javax.inject:javax.inject:1'
// V2: Endpoints Framework v2 migration
compile 'com.google.endpoints:endpoints-framework:2.0.7'
}
// V2: Define deployment configuration using the new App Engine plugin
// with the appengine closure
appengine { // App Engine tasks configuration
deploy { // deploy configuration
// The following is used for acceptance tests and
// is not required for a migration.
project = "ultra-tube-89909"
version = "2" //changed to GAE API v2
/*
Run the following command to initalize the Cloud SDK:
gcloud init
Use Application Default Credentials:
gcloud auth application-default login
Install the app-engine-java component:
gcloud components install app-engine-java
*/
// project = findProperty("appengine.deploy.project")
// version = findProperty("appengine.deploy.version")
def promoteProp = findProperty("appengine.deploy.promote")
if (promoteProp != null) {
promote = new Boolean(promoteProp)
}
}
}

<runtime>java8</runtime>tag and it works for me. Are you working with App Engine Standard or Flexible? The error comes up on deployment or when local-testing the app with the Development Server? - dsesto