6

I am currently using Cloud Endpoints v1 in an existing application, but I would like to update it to v2 for App Engine in Java. I have reviewed the migration guide, but this only provides steps for migrating a Maven project. I am not using Maven, but I am using the Java App Engine SDK and Google Eclipse plugin to develop, test, and deploy my endpoints. I am having trouble getting v2 of the Cloud Endpoints Framework to run due to conflicts with the existing dependencies in the App Engine SDK. How can I override the v1 dependencies in the App Engine SDK so that I can migrate to v2? Is this possible, or should I convert my project to a Maven project?

Pablo Chvx
  • 1,321
  • 13
  • 28
Ken
  • 131
  • 5

2 Answers2

1

I believe GPE is deprecated. However, you should be able to right click on your App Engine project, select Build Path > Configure Build Path, and add the endpoints-framework JAR under the Libraries tab. Make sure to go to Order and Export and move the endpoints-framework above the App Engine SDK, or you're likely to encounter issues.

saiyr
  • 2,535
  • 1
  • 9
  • 13
  • I followed your instruction, but I am receiving an error trying to start the local dev server to test the endpoints. I am also using Guice injection with the endpoints framework. `java.lang.NoSuchMethodError: com.google.api.server.spi.ServletInitializationParameters.getServiceClasses()Lcom/google/common/collect/ImmutableSet;` – Ken Feb 24 '17 at 13:04
  • I am using the same configuration of the endpoints framework in an existing Maven project and works with out any problems. I still believe there is some type of conflict between the Java App Engine SDK which includes the old appengine-endpoints jar. – Ken Feb 24 '17 at 13:14
  • I have cleaned the project in Eclipse and also set the ordering of the libraries and jars such that the new endpoints-framework.jar is listed first. There is still an issue when building the project that seems to be a result of the presence of the old appengine-endpoints.jar. The old configuration gets created in the web.xml during build. @saiyr Is it possible to exclude the appengine-endpoints.jar from the App Engine SDK Library? – Ken Mar 06 '17 at 17:32
0

In order to override the include appengine-endpoints.jar from the App Engine SDK for Java, I added a class-loader-config to the appengine-web.xml.

<classloader-config> <priority-specifier filename="endpoints-framework-2.0.3.jar/> </class-loader-config>

I've also disabled the Google Cloud Endpoint Builder in Eclipse. Properties>Builders and unchecked Google App Engine Cloud Endpoints Builder.

Ken
  • 131
  • 5
  • Did you end up using maven, or did you manage to avoid that? It is time for me to finally migrate to GCE v2, and I will do everything to not have to use maven. – rakensi May 24 '18 at 09:15