简体   繁体   English

从 JBoss 4.2.x 升级到 JBoss 5.x、6.x、7.x 和 WildFly 8.x 的好处(和提示)?

[英]Benefits (and tips) of an upgrade from JBoss 4.2.x to JBoss 5.x, 6.x, 7.x and WildFly 8.x?

Please assume that I do not need to worry about development time and costs: I am interested in general technical benefits (improved performance? improved APIs?) and new features.请假设我不需要担心开发时间和成本:我对一般技术优势(改进的性能?改进的 API?)和新功能感兴趣。

I am currently working on products using 4.2.x, and we consider a major shift for versions that are a long time ahead and need to converge.我目前正在开发使用 4.2.x 的产品,我们考虑对那些需要很长时间并且需要融合的版本进行重大转变。

I had a brief look at the release notes of each version and some articles about each release for 5.x, 6.x, 7.x and 8.x.我简要查看了每个版本的发行说明以及关于 5.x、6.x、7.x 和 8.x 的每个版本的一些文章。 But I would be glad to have first-hand feedback from people who have made the switch.但我很高兴能从做出转换的人那里获得第一手反馈。

I noticed there are some important changes surrounding messaging (switching from JBoss MQ to JBoss Messenging), and that for JBoss 7.x it seems to change a fair bit its configuration layer.我注意到围绕消息传递有一些重要的变化(从 JBoss MQ 切换到 JBoss 消息传递),而对于 Z7345F7045E4668138112C100F25517A4 层的配置似乎有所改变。 Then there's a lot more going on when switching to JBoss/WildFly 8.x.然后在切换到 JBoss/WildFly 8.x 时还有很多事情要做。

Please recommend good articles pointing at pitfalls if you can.如果可以的话,请推荐指出陷阱的好文章。 I found a few for migrations to JBoss 5.x, but not that many for 6.x or even 7.x, and someone else is evaluating 8.x for us now.我找到了一些迁移到 JBoss 5.x 的工具,但对于 6.x 甚至 7.x 来说并没有那么多,现在其他人正在为我们评估 8.x。 Feel free to recommend alternatives as well if you think they are relevant, though I'd prefer to focus only on JBoss.如果您认为它们相关,也可以随意推荐替代品,但我更愿意只关注 JBoss。

For information, we use a mix of JPF- and OSGi-enabled (using Eclipse Equinox) plugin-based systems, with clients developed in Swing (some deployed via WebStart).有关信息,我们混合使用了基于 JPF 和 OSGi(使用 Eclipse Equinox)插件的系统,以及在 Swing 中开发的客户端(一些通过 WebStart 部署)。

Update: Though this question brought some great answers already, I think it deserves an update for WildFly (and actually, our internal projects delayed making the switch from 4.2.x to 7.x as originally planned to wait for WildFly).更新:虽然这个问题已经带来了一些很好的答案,但我认为它值得为 WildFly 更新(实际上,我们的内部项目推迟了从 4.2.x 到 7.x 的切换,因为原计划等待 WildFly)。 New thoughts and answers are welcome.欢迎新的想法和答案。

I've upgraded from JBoss 4 to 5 and from experience the following are the most important to note:我已经从 JBoss 4 升级到 5,根据经验,以下是最需要注意的:

  • JBoss 5 (and 6 and 7) are not as forgiving as JBoss 4 with XML files. JBoss 5(和 6 和 7)不如 JBoss 4 和 XML 文件那样宽容。 You must make sure that all your deployment descriptor XML files are valid.您必须确保所有部署描述符 XML 文件都是有效的。 You may be using DTDs in some files - I recommend upgrading these to use XML schema instead.您可能在某些文件中使用了 DTD - 我建议将这些文件升级为使用 XML 架构。
  • Some libraries may cause incompatibilities.某些库可能会导致不兼容。 This can be particularly true if you access web services and/or do XML parsing如果您访问 web 服务和/或执行 XML 解析,则尤其如此
  • If you precompile your JSPs in JBoss 4, you probably won't be able to in JBoss 6/7.如果您在 JBoss 4 中预编译您的 JSP,您可能无法在 JBoss 6/7 中进行编译。
  • JBoss 4 and 5 use different message queue implementations. JBoss 4 和 5 使用不同的消息队列实现。 If you have any message queues or topics defined you will need to redefine them.如果您定义了任何消息队列或主题,则需要重新定义它们。
  • JBoss TreeCache is no longer used. JBoss TreeCache 不再使用。 If you use this for caching purposes, you will need to change to use the new JBoss cache instead.如果将其用于缓存目的,则需要更改为使用新的 JBoss 缓存。
  • JBoss 5 security is different. JBoss 5 安全性不同。 If your remote clients require secured access to JBoss, you will need to configure them differently.如果您的远程客户端需要对 JBoss 的安全访问,您将需要对它们进行不同的配置。

Some useful resources are:一些有用的资源是:

https://dzone.com/articles/migrating-jboss-4-jboss-5 http://venugopaal.wordpress.com/2009/02/02/jboss405-to-jboss-5ga https://dzone.com/articles/migrating-jboss-4-jboss-5 http://venugopaal.wordpress.com/2009/02/02/jboss405-to-jboss-5ga

Officially JBoss 6 is only certified for the Java EE Web Profile, so if you use "legacy" features such as EJB 2.x, they will potentially not be supported in the future.官方 JBoss 6 仅通过 Java EE Web 配置文件认证,因此如果您使用“旧版”功能,例如 EJB。2 可能不支持它们。 Depending on the lifecycle of your application, this may or may not be a problem.根据您的应用程序的生命周期,这可能是也可能不是问题。 JBoss 6 currently supports EJB2.1 fully, but it is not certified against this. JBoss 6 目前完全支持 EJB2.1,但未对此进行认证。

I have also found that JBoss 5 handles memory a lot better that JBoss 4. With JBoss 4 I see a lot more PermGen errors than I do with JBoss 5. I have also found that JBoss 5 handles memory a lot better that JBoss 4. With JBoss 4 I see a lot more PermGen errors than I do with JBoss 5.

I can only speak from production experience with JBoss 5.1.0 and some investigation of version 6.我只能从 JBoss 5.1.0 的生产经验和对版本 6 的一些调查中发言。

JBoss 5 is Java EE 5 and JBoss 6 and 7 are Java EE 6 . JBoss 5 is Java EE 5 and JBoss 6 and 7 are Java EE 6 . The disparity in API features is best documented in those specs. API 功能的差异在这些规范中得到了最好的记录。 JBoss 6 is likely to have a very short shelf-life; JBoss 6 可能保质期很短; it is only certified for the Java EE 6 web profile and bugfixes are being targeted at version 7 (in its 3rd beta at time of writing).仅针对 Java EE 6 web 配置文件进行了认证,并且错误修复针对的是第 7 版(在撰写本文时的第 3 个测试版)。

I think you'd get better answers on the JBoss community forum.我认为您会在 JBoss 社区论坛上获得更好的答案。

We upgraded from JBoss AS 5 to JBoss AS 7 and are eying towards WildFly AS 8.1.我们从 JBoss AS 5 升级到 JBoss AS 7 并着眼于 WildFly AS 8.1。 Right now we can't migrate to 8 because there is no MQ Series JMS 2 RAR.现在我们不能迁移到 8,因为没有 MQ 系列 JMS 2 RAR。

Some of the differences:一些不同之处:

  • The configuration is so much better and simpler.配置更好,更简单。 It's no longer spread over 20 XML files in which you configure aspects in XML files.它不再分布在 20 个 XML 文件中,您可以在其中配置 XML 文件中的方面。 Instead everything is one central place.相反,一切都是一个中心位置。 All ports are configured in one central place, there is no longer an XSL file that transforms server.xml.所有端口都配置在一个中心位置,不再有转换 server.xml 的 XSL 文件。 You can make sense of the configuration file without knowing the implementation details of classes.您可以在不知道类的实现细节的情况下理解配置文件。 It's hard to appreciate this if you've never configured a JBoss 5.x.如果您从未配置过 JBoss 5.x,就很难理解这一点。
  • The class loading model looks sane and you get a lot of control through jboss-deployment-structure.xml加载 model 的 class 看起来很正常,您可以通过 jboss-deployment-structure.xml 获得很多控制权
  • The centralized logging (Slf4j, JUL, JCL, Log4j, …) is really nice.集中式日志记录(Slf4j、JUL、JCL、Log4j,...)非常好。
  • The EJB client library looks much more cleaned up. EJB 客户端库看起来更加整洁。 It's down to 10 JARs from 20, half of them are even OSGi bundles (our client is an Eclipse RCP application).从 20 个减少到 10 个 JARs,其中一半甚至是 OSGi 捆绑包(我们的客户端是 Eclipse RCP 应用程序)。
  • The EJB client maven dependency mess is gone, instead you now get a BOM POM. EJB 客户端 maven 依赖混乱消失了,取而代之的是你现在得到一个 BOM POM。
  • You get a BOM POM for the server APIs.您将获得服务器 API 的 BOM POM。
  • Faster start up and less memory usage.更快的启动和更少的 memory 使用。 We deploy 80 EJBs and the MQ Series RAR in 6 seconds without much tuning.我们在 6 秒内部署了 80 个 EJB 和 MQ 系列 RAR,无需进行太多调整。 Our live dataset is somewhere above 200 MB.我们的实时数据集超过 200 MB。
  • The deployments folder is empty by default部署文件夹默认为空
  • The (lack of) quality of XNIO is scary. XNIO 的(缺乏)质量是可怕的。 In 7.x it's only used for EJB remoting and we hit several show stopper bugs (deadlocks, double free, socket handle leaks, …).在 7.x 中,它仅用于 EJB 远程处理,我们遇到了几个显示停止错误(死锁、双重释放、套接字句柄泄漏……)。 In 8.x it is used for servlets as well instead of Tomcat.在 8.x 中,它也用于 servlets,而不是 Tomcat。 There are still a lot of very basic servlet bugs being fixed in undertow.仍然有很多非常基本的 servlet 错误正在被修复。

Changes that we had to do our application:我们必须对应用程序进行的更改:

  • change JNDI names to EE 6 standardized names将 JNDI 名称更改为 EE 6 标准化名称
  • migrate from JBoss Cache to Infinispan (part of our code has been migrated to the flat API, some parts still use the tree API)从 JBoss Cache 迁移到 Infinispan (我们的部分代码已经迁移到扁平化的 API,有些部分仍然使用树形 API)
  • security is slightly less flexible (you can no longer fix authenticated and unauthenticated calls)安全性稍微不那么灵活(您不能再修复经过身份验证和未经身份验证的调用)
  • some horrible code that relied on details of remote JNDI一些依赖远程 JNDI 细节的可怕代码
  • the configuration of the EJB client is different EJB客户端的配置不同
  • all of you scripts for installing, deploying, starting, stopping, …用于安装、部署、启动、停止……的所有脚本
  • ExternalContext is gone, we had to replace it with a different approach ExternalContext 消失了,我们不得不用不同的方法替换它
  • we replaced MBeans in SARs with @StartUp EJBs我们将 SAR 中的 MBean 替换为 @StartUp EJB
  • some ugly hacks for Cocoon Cocoon 的一些丑陋技巧

The AS 7.x series has a lot of bugs with fixes only available in the EAP series. AS 7.x 系列有很多错误,修复仅在 EAP 系列中可用。 If you want go to with 7.x instead of 8.x we strongly recommend you buy EAP 6.如果您希望 go 使用 7.x 而不是 8.x,我们强烈建议您购买 EAP 6。

Just wanted to bring this to anyone's attention who might be facing PermGen bloat issue after upgrading to the latest.只是想让任何可能在升级到最新版本后面临 PermGen 膨胀问题的人注意这一点。 The JBoss-6 Microcontainer tries to scan for Jboss specific annotations by loading the classes from all the JARs in the class-path on startup. JBoss-6 微容器通过在启动时从类路径中的所有 JARs 加载类来尝试扫描 Jboss 特定注释。 This causes the PermGen bloating as it starts to load all the unwanted classes.这会导致 PermGen 膨胀,因为它开始加载所有不需要的类。 To reduce the amount of scanning, the Microcontainer provides another descriptor hook, by means of jboss-scanning.xml.为了减少扫描量,微容器通过 jboss-scanning.xml 提供了另一个描述符挂钩。 Add this 'jboss-scanning.xml' to the WEB-INF inside WARs and ass 'jboss-scanning.xml' to the META-INF inside EARs.将此“jboss-scanning.xml”添加到 WAR 内的 WEB-INF,并将“jboss-scanning.xml”添加到 EAR 内的 META-INF。

<scanning xmlns="urn:jboss:scanning:1.0">

    <!-- Purpose: Disable scanning for annotations in contained deployment. -->

</scanning>

Here is an interesting thread on JBoss AS 7 compromises and future, also mentioning issues with AS 5 and AS 6:这是 JBoss AS 7 妥协和未来的一个有趣线程,还提到了 AS 5 和 AS 6 的问题:

http://community.jboss.org/message/613171 http://community.jboss.org/message/613171

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM