stuck migrating GAE std in Eclipse from old plugin to Cloud tools for Eclipse

121 views
Skip to first unread message

Robert Dyas

unread,
Jun 5, 2017, 8:36:39 PM6/5/17
to Google App Engine
I just upgraded from the Eclipse plugin to Cloud Tools for Eclipse and now my project is a mess.


I now have a ton of bad imports... for example I have  ton of com.google.appengine.api.datastore references that are now broken.

What is the best way to get them back? I don't even see a place to download a JAR for it.

Brian de Alwis

unread,
Jun 6, 2017, 11:16:00 AM6/6/17
to google-a...@googlegroups.com
Hi Robert.

The new Cloud Tools for Eclipse doesn't automatically add the App Engine jars.  But it's easily done:

  1. Right click on the project and select Properties…
  2. Switch to the Java Build Path and select the Libraries tab
  3. Click Add Library… and select App Engine Libraries
  4. Select App Engine API

That should resolve com.google.appengine.api.* references.

We'll add this to the conversion doc.  Sorry!

Brian.

--
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/282643c0-70c8-4d98-b05d-35b130a55ac4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Dyas

unread,
Jun 6, 2017, 12:05:21 PM6/6/17
to Google App Engine
Thanks - that did help a lot. I thought I already tried that but I mistakenly added Google API Libraries not Google App Engine.

Now I have some other issues... in my web.xml it doesn't like the following section because com.google.api.server.spi.SystemServiceServlet still can't be resolved.

<servlet>
<servlet-name>SystemServiceServlet</servlet-name>
<servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
<init-param>
<param-name>services</param-name>
<param-value />
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>SystemServiceServlet</servlet-name>
<url-pattern>/_ah/spi/*</url-pattern>
</servlet-mapping>
 

Robert Dyas

unread,
Jun 6, 2017, 12:12:04 PM6/6/17
to Google App Engine
And it also doesn't like the src/META-INF/jdoconfig.xml 
Is this file needed?
Is there a more correct one to use?

Description Resource Path Location Type
cvc-elt.1: Cannot find the declaration of element 'jdoconfig'. jdoconfig.xml /ParaSQL/src/META-INF line 4 XML Problem


Description Resource Path Location Type
Referenced file contains errors (http://java.sun.com/xml/ns/jdo/jdoconfig).  For more information, right click on the message in the Problems View and select "Show Details..." jdoconfig.xml /ParaSQL/src/META-INF line 1 XML Problem

Brian de Alwis

unread,
Jun 6, 2017, 4:07:48 PM6/6/17
to google-a...@googlegroups.com
Hi Robert.

Just to set expectations, Cloud Tools for Eclipse is a separate product and is not considered as the next version of the Google Plugin for Eclipse.  As such, CT4E doesn't bring over support for deprecated and superseded products.  You can continue to use GPE while you port your code.

The com.google.api.server.spi.SystemServiceServlet is from Cloud Endpoints v1.  CT4E supports Cloud Endpoints v2.  Cloud Endpoints provides some doc on migrating from v1 to v2.  You can use the same approach to adding the Cloud Endpoints v2 jars.

I spent a little bit of time trying to convert a simple JDO+Datastore app to use the Datanucleus plugin for Eclipse (http://www.datanucleus.org/downloads/), but hit some issues trying to get a workable configuration.  This is what I figured out:
  • The Datanucleus implementation jars are in the App Engine for Java SDK in lib/opt/*/datanucleus/ as v1 or v2.  v1 is for JDO 2, and v2 is for JDO 3.
  • Copy in <SDK>/lib/opt/user/datanucleus/v?/*.jar into WEB-INF/lib/
  • Edit the project properties
    • Java Build Path: Add WEB-INF/lib/*.jar to your build path
    • Datanucleus: Add <SDK>/lib/opt/tools/datanucleus/v?/datanucleus-enhancer-*.jar to Datanucleus runtime path
    • Datanucleus: Uncheck "Use project classpath when running tools" as otherwise doesn't pick up the -enhancer.jar
  • Seems the jdoconfig.xml may need to be placed in WEB-INF/classes/META-INF/.
I hit my time limit and wasn't able to get my sample project to really work.  But I'm not a JDO/DataNucleus expert, so you might have better success.  To be honest, I'd spend my time to convert my project to a Maven project:


Brian.

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

Robert Dyas

unread,
Jun 6, 2017, 6:04:57 PM6/6/17
to Google App Engine
Since we don't use JDO at all, can I assume just deleting the jdoconfig.xml file is safe?
App Engine doesn't need it if JDO isn't used, correct?


On Monday, June 5, 2017 at 8:36:39 PM UTC-4, Robert Dyas wrote:

Brian de Alwis

unread,
Jun 7, 2017, 9:31:49 AM6/7/17
to google-a...@googlegroups.com
That's right: you can remove the jdoconfig.xml.

Brian.

--
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.
Reply all
Reply to author
Forward
0 new messages