Google App Engine end point App V1 to V2 Migration issue

189 views
Skip to first unread message

Arunprasath T

unread,
May 28, 2018, 9:52:56 AM5/28/18
to Google App Engine
I have migrated my Google App Engine endpoint App. Am unable to see my jar file under the library after migrating to Endpoints V2. Without jar file, I cannot proceed my work. Is anything I missed in the migration process? Kindly check it and respond as soon as possible.



----
Disclaimer:
This email and any attachments to it may be confidential and are intended solely for the use of the individual to whom it is addressed.

Arunprasath T

unread,
May 28, 2018, 9:52:56 AM5/28/18
to Google App Engine

I have migrated my Google App Engine end point App. There is one jar and war file available in my V1 libs folder. But after I migrated, there is war file only available in my V2 libs folder. Without jar file I cannot proceed my work. Is anything I missed in the migration process ?


I followed the below document.
https://cloud.google.com/endpoints/docs/frameworks/java/migrating-android

George (Cloud Platform Support)

unread,
May 28, 2018, 3:09:18 PM5/28/18
to Google App Engine
Hello Arunprasath, 

Which jar file is meant here, exactly? What steps have you followed, from those listed in the linked document? In particular, have you rebuild your project? This step is dealt with in the "Rebuild project" sub-chapter. Deploying and generating client libraries are important steps as well. 

Arunprasath T

unread,
Jun 4, 2018, 5:13:20 AM6/4/18
to Google App Engine
hi,
 Thank you for your communication. I am follow this document.


and  i am integrate with my project

Step 1:   change my project app/ build.gradle 

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.2'
}
}


android {
compileSdkVersion 26
buildToolsVersion '26.0.2'

defaultConfig {
applicationId "com.chainsys.echain_extension_module"
minSdkVersion 19
targetSdkVersion 26
versionCode 14
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 compiles instrumentation tests written using Espresso
// used by Firebase Test Lab
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.1'
compile 'com.google.code.findbugs:jsr305:2.0.1'
testCompile 'junit:junit:4.12'

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

configurations {
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}
}


Step 2:   change my project backend / build.gradle  

// If you would like more information on the gradle-appengine-plugin please refer to the github page
// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin

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.3'

}

}

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'


sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8



dependencies {
// V2: Endpoints Framework v2 migration
compile 'com.google.endpoints:endpoints-framework:2.0.9'

compile 'javax.inject:javax.inject:1'
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)
}
}





}
Step 3:   change my project backend / web.xml   

<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
<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.chainsys.e_chain.backend.EndPointApi.MyEndpoint,com.chainsys.e_chain.backend.EndPointApi.DomainAuthenticationEndPoint,com.chainsys.e_chain.backend.EndPointApi.LocationTrackingEndPoint</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>EndpointsServlet</servlet-name>
<url-pattern>/_ah/spi/*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>GAEJCronServlet</servlet-name>
<servlet-class>com.chainsys.e_chain.backend.GAEJCronServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>GAEJCronServlet</servlet-name>
<url-pattern>/cron/gaejcronjob</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>

Step 4:   change my project build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()

}
dependencies {

// V2: Include this dependency when using Endpoints Framework v2
classpath 'com.google.guava:guava:19.0'

classpath 'com.android.tools.build:gradle:2.3.3'
}
}

allprojects {
repositories {
jcenter()
google()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}





conclusion
                  My project  migration process completed.and build and run my project    backend/build/libs      folder  only generated war file not generated jar file kindly check it and help

George (Cloud Platform Support)

unread,
Jun 6, 2018, 4:15:32 PM6/6/18
to Google App Engine
Your build.gradle file contains line "apply plugin: 'war' ", while you expect a jar file. More details related to your statement above: "Without jar file, I cannot proceed my work." are needed. What prevents you from proceeding with your work and in which way, exactly? What would you expect, when you deploy your end point code? Have you rebuild your project? This step is dealt with in the "Rebuild project" sub-chapter

ARUN PRASATH T

unread,
Jun 7, 2018, 3:11:19 AM6/7/18
to google-a...@googlegroups.com

Thanks & Regards,
Arun Prasath T | Senior Software Analyst (Mobility) | Mobile +91 9787883113
Chain-Sys (India) Pvt. Ltd,
Chennai, 
Tamil Nadu 600048

    
Hi,
   Thank your for your communication, My Endpoint app V1 backend libs folder genarated jar file, and i am migrating to v2, but not genarated jar file.Previous mail i have shared migrating steps to you.

attached V1 and V2 backend libs folder screen shots. kindly provide me solution as soon as possible.

On Thu, Jun 7, 2018 at 1:45 AM 'George (Cloud Platform Support)' via Google App Engine <google-a...@googlegroups.com> wrote:
Your build.gradle file contains line "apply plugin: 'war' ", while you expect a jar file. More details related to your statement above: "Without jar file, I cannot proceed my work." are needed. What prevents you from proceeding with your work and in which way, exactly? What would you expect, when you deploy your end point code? Have you rebuild your project? This step is dealt with in the "Rebuild project" sub-chapter

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/4adc24e4-8c68-4dac-a801-22c0016f1ac4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
V1_libs_screen.PNG
V2_libs_screen.PNG

George (Cloud Platform Support)

unread,
Jun 8, 2018, 12:37:35 PM6/8/18
to Google App Engine
The result of building your Java app is a *.war file. This should not be perceived as surprising, and should not prevent the deployment your endpoints. Have you attempted deployment, as yet? For reference, you may have a look at the "Deploying and Testing an API" online document. In which way is your *.jar file necessary? More detail on the matter can only help progress in this case. 
Reply all
Reply to author
Forward
0 new messages