从一台开发服务器为多个 GAE 模块提供服务? [英] Serving multiple GAE modules from one development server?

查看:24
本文介绍了从一台开发服务器为多个 GAE 模块提供服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一些后端转换为模块,并且对设置开发环境配置感到困惑.我在 Eclipse 中使用 Java 而不是 Maven.架构非常简单:

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:

  • 前端模块是默认的.基本的 GAE/GWT 应用程序.将项目放入任务队列.
  • 后端模块处理任务队列.

使用旧的后端架构,一个调试配置将启动开发服务器,该服务器将为 GWT DevMode UI 和后端任务处理提供服务.

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.

问题的症结在于 DevMode 的参数提供了 -war 命令行参数.现在我们不再有一个单独的 war 文件(有一个包含两个 war 文件的耳朵),我们必须独立启动它们.这很好,我们可以创建一个启动组来启动前端和后端.

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.

问题是每个war文件都有自己的WEB-INF/appengine-generated/local_db.bin,它本质上创建了两个独立的应用程序.我在这里错过了什么吗?我需要能够在我的前端 RPC 服务中放置一个断点,以在新后端处理任务队列项的 servlet 中放置一个断点,并使它们都在一个调试会话中命中.

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.

感谢您的任何想法.

推荐答案

如果您按照说明操作 here,这将在 Eclipse 中创建一个模块化的应用程序结构,而根本不使用 Maven.您将需要 Eclipse WTP 才能获得所需的项目类型(企业应用程序项目和动态 Web 项目).

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

Eclipse 项目结构应如下所示:

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"

name"的值指的是 appengine-web.xml 中的module"元素,而物理 Web 项目可以有任何名称.

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

请注意,您需要切换到 J2EE 透视图才能使用 GPE WTP 菜单选项,它们不会显示在标准 Java 透视图中.

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.

接下来,您需要将 EAR 项目链接到一个新的本地服务器实例(类型为Google App Engine").

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

只有一个 Web 模块必须在 appengine-web.xml 中标记为默认".

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

将 EAR 部署到本地服务器后,数据存储位置位于 default 网络模块的 WEB-INF/appengine-generated/local_db.bin 中,并在网络模块之间共享.

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.

这篇关于从一台开发服务器为多个 GAE 模块提供服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆