Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine Google应用程序引擎端点版本迁移V1到V2_Google App Engine_Google Cloud Endpoints - Fatal编程技术网

Google app engine Google应用程序引擎端点版本迁移V1到V2

Google app engine Google应用程序引擎端点版本迁移V1到V2,google-app-engine,google-cloud-endpoints,Google App Engine,Google Cloud Endpoints,我们已经使用android studio创建了Google Endpoint api v1。 我们收到来自谷歌云的电子邮件,称谷歌Api版本v1已被弃用。所以我们尝试将v1更新为v2。 因此,请参考以下链接进行迁移 更改后,当我们尝试运行该时间显示时,“…/backend/build/exploded app”不存在 如果我查看项目中的目录树 我可以看到分解目录“./build/exploded backend”,它基于模块名“backend”和包含发现文档的“endpointsDiscover

我们已经使用android studio创建了Google Endpoint api v1。 我们收到来自谷歌云的电子邮件,称谷歌Api版本v1已被弃用。所以我们尝试将v1更新为v2。 因此,请参考以下链接进行迁移

更改后,当我们尝试运行该时间显示时,“…/backend/build/exploded app”不存在

如果我查看项目中的目录树 我可以看到分解目录“./build/exploded backend”,它基于模块名“backend”和包含发现文档的“endpointsDiscoveryDocs”

不可用“../backend/build/exploded app”和“../backend/build/endpointsClientLibs

当我尝试执行时,构建成功,但显示在 运行后端时出错:无法启动进程,工作目录“…\MyAppliaiton\backend\build\exploded app”不存在

我的android项目中使用了以下build.xml

MyApplication build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {

        classpath 'com.google.guava:guava:19.0'
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
**apply plugin: 'com.android.application'

// V2: Apply the new Endpoints Framework client plugin
apply plugin: 'com.google.cloud.tools.endpoints-framework-client'

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        // V2: Add the new Endpoints Framework plugin dependencies
        classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.0'
    }
}

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.chainsys.myapplication"
        minSdkVersion 20
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.code.findbugs:jsr305:2.0.1'
    testCompile 'junit:junit:4.12'


    //compile project(path: ':backend', configuration: 'android-endpoints')
    // V2: Endpoints Framework v2 migration
    endpointsServer project(path: ':backend', configuration: 'endpoints')
    compile 'com.google.api-client:google-api-client:1.23.0'
    compile 'com.google.http-client:google-http-client-android:1.23.0'

}**
**buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        //classpath 'com.google.appengine:gradle-appengine-plugin:1.9.42'
        // V2: Add the new App Engine and Endpoints Frameworks plugin dependencies
        classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.0'
        classpath 'com.google.cloud.tools:appengine-gradle-plugin:1.3.2'
    }
}

repositories {
    jcenter();
}

apply plugin: 'java'
apply plugin: 'war'

// apply plugin: 'appengine'


// 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'

dependencies {

    //appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.42'

    // V2: Endpoints Framework v2 migration
    compile 'com.google.endpoints:endpoints-framework:2.0.7'

    compile 'javax.inject:javax.inject:1'
    compile 'javax.servlet:servlet-api:2.5'


  //  compile 'com.google.appengine:appengine-endpoints:1.9.42'
   // compile 'com.google.appengine:appengine-endpoints-deps:1.9.42'
   // compile 'javax.servlet:servlet-api:2.5'

}

// 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 = findProperty("appengine.deploy.project")
        version = findProperty("appengine.deploy.version")
        def promoteProp = findProperty("appengine.deploy.promote")
        if (promoteProp != null) {
            promote = new Boolean(promoteProp)
        }
    }


}**
应用程序build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {

        classpath 'com.google.guava:guava:19.0'
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
**apply plugin: 'com.android.application'

// V2: Apply the new Endpoints Framework client plugin
apply plugin: 'com.google.cloud.tools.endpoints-framework-client'

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        // V2: Add the new Endpoints Framework plugin dependencies
        classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.0'
    }
}

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.chainsys.myapplication"
        minSdkVersion 20
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.code.findbugs:jsr305:2.0.1'
    testCompile 'junit:junit:4.12'


    //compile project(path: ':backend', configuration: 'android-endpoints')
    // V2: Endpoints Framework v2 migration
    endpointsServer project(path: ':backend', configuration: 'endpoints')
    compile 'com.google.api-client:google-api-client:1.23.0'
    compile 'com.google.http-client:google-http-client-android:1.23.0'

}**
**buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        //classpath 'com.google.appengine:gradle-appengine-plugin:1.9.42'
        // V2: Add the new App Engine and Endpoints Frameworks plugin dependencies
        classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.0'
        classpath 'com.google.cloud.tools:appengine-gradle-plugin:1.3.2'
    }
}

repositories {
    jcenter();
}

apply plugin: 'java'
apply plugin: 'war'

// apply plugin: 'appengine'


// 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'

dependencies {

    //appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.42'

    // V2: Endpoints Framework v2 migration
    compile 'com.google.endpoints:endpoints-framework:2.0.7'

    compile 'javax.inject:javax.inject:1'
    compile 'javax.servlet:servlet-api:2.5'


  //  compile 'com.google.appengine:appengine-endpoints:1.9.42'
   // compile 'com.google.appengine:appengine-endpoints-deps:1.9.42'
   // compile 'javax.servlet:servlet-api:2.5'

}

// 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 = findProperty("appengine.deploy.project")
        version = findProperty("appengine.deploy.version")
        def promoteProp = findProperty("appengine.deploy.promote")
        if (promoteProp != null) {
            promote = new Boolean(promoteProp)
        }
    }


}**
Backend build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {

        classpath 'com.google.guava:guava:19.0'
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
**apply plugin: 'com.android.application'

// V2: Apply the new Endpoints Framework client plugin
apply plugin: 'com.google.cloud.tools.endpoints-framework-client'

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        // V2: Add the new Endpoints Framework plugin dependencies
        classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.0'
    }
}

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.chainsys.myapplication"
        minSdkVersion 20
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.code.findbugs:jsr305:2.0.1'
    testCompile 'junit:junit:4.12'


    //compile project(path: ':backend', configuration: 'android-endpoints')
    // V2: Endpoints Framework v2 migration
    endpointsServer project(path: ':backend', configuration: 'endpoints')
    compile 'com.google.api-client:google-api-client:1.23.0'
    compile 'com.google.http-client:google-http-client-android:1.23.0'

}**
**buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        //classpath 'com.google.appengine:gradle-appengine-plugin:1.9.42'
        // V2: Add the new App Engine and Endpoints Frameworks plugin dependencies
        classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.0'
        classpath 'com.google.cloud.tools:appengine-gradle-plugin:1.3.2'
    }
}

repositories {
    jcenter();
}

apply plugin: 'java'
apply plugin: 'war'

// apply plugin: 'appengine'


// 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'

dependencies {

    //appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.42'

    // V2: Endpoints Framework v2 migration
    compile 'com.google.endpoints:endpoints-framework:2.0.7'

    compile 'javax.inject:javax.inject:1'
    compile 'javax.servlet:servlet-api:2.5'


  //  compile 'com.google.appengine:appengine-endpoints:1.9.42'
   // compile 'com.google.appengine:appengine-endpoints-deps:1.9.42'
   // compile 'javax.servlet:servlet-api:2.5'

}

// 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 = findProperty("appengine.deploy.project")
        version = findProperty("appengine.deploy.version")
        def promoteProp = findProperty("appengine.deploy.promote")
        if (promoteProp != null) {
            promote = new Boolean(promoteProp)
        }
    }


}**
后端web.xml

**<?xml version="1.0" encoding="utf-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
    <servlet>
        <servlet-name>EndpointsServlet</servlet-name>
        <servlet-class>com.google.api.server.spi.EndpointsServlet</servlet-class>
        <init-param>
            <param-name>services</param-name>
            <param-value>com.example.sugumar.p.myapplication.backend.MyEndpoint</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>EndpointsServlet</servlet-name>
        <url-pattern>/_ah/api/*</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>**
**
端点服务器
com.google.api.server.spi.EndpointsServlet
服务
com.example.sugumar.p.myapplication.backend.MyEndpoint
端点服务器
/_空气污染指数/*
index.html
**

我需要帮助这里发生了什么事

我正在将appengine模块从Java 7更新到Java 8,并将端点v1更新到端点v2,这真是一件麻烦事

我已经把它解决了

[后端模块]/[后端模块].iml

换线

value=“C:\workspace\[project]\[backend module]\build\app

value=“C:\workspace\[project]\[backend module]\build\exploded-[backend module]


我正在将appengine模块从Java7更新到Java8,并将端点v1更新到端点v2,这真是一件麻烦事

我已经把它解决了

[后端模块]/[后端模块].iml

换线

value=“C:\workspace\[project]\[backend module]\build\app

value=“C:\workspace\[project]\[backend module]\build\exploded-[backend module]


需要您提供正在运行的命令和完整输出的日志。按需配置是一项酝酿功能:后端:compileJava最新:后端:processResources最新:后端:classes最新:后端:endpointsDiscoveryDocs最新:后端:_zipDiscoveryDocs最新:后端:war最新:后端:explodeWar最新:后端:汇编最新生成成功运行后端时出错:无法启动进程,工作目录“…\MyAppliaiton\backend\build\exploded-app”不存在请将其放在您的问题中,而不是放在注释中。您还可以包括您的gradle(大概)配置吗?或者Maven,如果你正在使用的话。更新了saiyr。请帮助我我犯了什么错误。请提供您正在运行的命令的日志和完整输出。按需配置是一项酝酿功能:后端:compileJava最新:后端:processResources最新:后端:classes最新:后端:endpointsDiscoveryDocs最新:后端:_zipDiscoveryDocs最新:后端:war最新:后端:explodeWar最新:后端:汇编最新生成成功运行后端时出错:无法启动进程,工作目录“…\MyAppliaiton\backend\build\exploded-app”不存在请将其放在您的问题中,而不是放在注释中。您还可以包括您的gradle(大概)配置吗?或者Maven,如果你正在使用的话。更新了saiyr。请帮我纠正我的错误