1

我们计划将我们的 Java WebApplications 从 OC4J 迁移到 TomEE。我需要为此迁移提供 LOE 关于迁移的关键点是什么?有没有我可以参考的文档或书籍?

4

1 回答 1

1

首先,祝贺。TomEE 的轻量级特性提供了一些令人难以置信的优势。作为开源,您还可以自行修复错误,而无需依赖供应商缓慢的开发周期。另外,因为它基本上是 Tomcat,所以您正在利用围绕该产品的庞大知识库和经验世界。

对于这样的迁移,最好的建议是确保您的应用程序使用 vanilla Java EE,而不是其他任何东西。如果您的代码在没有任何 OC4J 库的情况下针对 javaee-api-6.0.jar 进行编译,那么您的成功率是 90%。

其余的问题通常涉及配置和注入方面的小问题。

如果你对 EJB 映射做了一些奇怪的事情:

@EJB(name = "NoteTakerServiceBean") private NoteTakerService umaNoteTakerService; @EJB(name = "GLINoteTakerServiceBean") private NoteTakerService gliNoteTakerService;

这些“命名”注射是不可移植的。

MDB 上的配置属性:

@MessageDriven(activationConfig = {
    @ActivationConfigProperty(propertyName = "destination",
            propertyValue = "com.mycompany.databunker.salesforce.model.SalesForceAgent"),
    @ActivationConfigProperty(propertyName = "maxSessions", propertyValue = "1") },
        mappedName = "com.mycompany.databunker.salesforce.model.SalesForceAgent")
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class SalesForceAgentMessageListener implements MessageListener {
....
}

activationConfig 属性是特定于容器的。

为了帮助您进行迁移,TomEE 提供了最好的文档。请参阅这两页以了解如何查看我从何处获得上述 bean 的配置详细信息。

http://tomee.apache.org/examples-trunk/index.html

http://tomee.apache.org/documentation.html

最后,另一个很好的资源是 Apache TomEE 用户列表。那里有很多乐于助人的人。祝你好运,如果您还有其他问题,请务必在此处发布或返回 SO!

于 2014-06-26T15:31:25.710 回答