Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serving multiple GAE modules from one development server?

I'm converting some backends to modules and am perplexed on setting up the development environment configuration. I'm using Java in Eclipse but not Maven. The architecture is very simple:

  • Front end module is default. Basic GAE/GWT app. Puts items on task queue.
  • Back end module processes task queue.

With the old backend architecture one debug configuration would start up the development server that would service the GWT DevMode UI and the backend task processing.

The crux of the issue is that the arguments to DevMode provide for a -war command line argument. Now that we no longer have a single war file (there is an ear containing two war files), we have to start them independently. This is fine, we can create a Launch Group that starts up the frontend and backend.

The problem is that each war file gets it's own WEB-INF/appengine-generated/local_db.bin, which essentially creates two standalone applications. Am I missing something here? I need to be able to put a breakpoint on my front-end RPC service and in the servlet that handles task queue items in the new backend and have both of them hit in one debugging session.

Thanks for any thoughts.

like image 716
Dominic Tracey Avatar asked Apr 08 '14 15:04

Dominic Tracey


1 Answers

If you follow the instructions here, this will create a modularized application structure in Eclipse, and not using Maven at all. You will need Eclipse WTP in order to have the required project types available (Enterprise Application Project and Dynamic Web Project).

The Eclipse project structure should look as follows:

<<Enterprise Application Project>> ear-app
    |
    | (refers to)
    |
<<Dynamic Web Project>> app-module-1  "default"
<<Dynamic Web Project>> app-module-2  "any_name_2"
<<Dynamic Web Project>> app-module-3  "any_name_3"
<<Dynamic Web Project>> app-module-4  "any_name_4"

The value of "name" refers to the "module" element in appengine-web.xml, while the physical web project can have any name.

Please note that you need to switch into J2EE perspective in order to have the GPE WTP menu options available, they do not show up in the standard Java perspective.

Next, you need to link the EAR project to a new local server instance (of type "Google App Engine").

Only one of the web modules must be flagged as "default" in appengine-web.xml.

Upon deployment of the EAR to the local server, the datastore location is in WEB-INF/appengine-generated/local_db.bin of the default web module, and it is shared between the web modules.

like image 50
Thomas W. Avatar answered Sep 29 '22 09:09

Thomas W.