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?

请假设我不需要担心开发时间和成本:我对一般技术优势(改进的性能?改进的API?)和新功能感兴趣

我目前正在开发使用4.2.x的产品,我们认为这是一个重大的转变,因为这些版本需要很长时间才能融合。

我简要地看了每个版本的发行说明,以及5.x、6.x、7.x和8.x版本的一些文章。但我很高兴能从做出改变的人那里获得第一手反馈。

我注意到消息传递有一些重要的变化(从JBoss MQ切换到JBoss Messenging),对于JBoss 7.x,它似乎对其配置层进行了一些更改。然后,当切换到JBoss/WildFly 8.x时,会发生更多的事情。

如果可以的话,请推荐指出陷阱的好文章。我发现了一些迁移到JBoss5.x的方法,但对于6.x甚至7.x没有那么多,其他人现在正在为我们评估8.x。如果你认为它们是相关的,也可以随意推荐替代方案,尽管我更喜欢只关注JBoss。

为了获得信息,我们混合使用了基于JPF和OSGi(使用EclipseEquinox)插件的系统,客户端在Swing中开发(有些是通过WebStart部署的)。

更新:虽然这个问题已经带来了一些很好的答案,但我认为它值得对WildFly进行更新(事实上,我们的内部项目推迟了从4.2.x切换到7.x的时间,因为我们原计划等待WildFly)。欢迎有新的想法和答案。

最佳回答

我已经从JBoss 4升级到了5,根据经验,以下是最重要的注意事项:

  • JBoss 5 (and 6 and 7) are not as forgiving as JBoss 4 with XML files. You must make sure that all your deployment descriptor XML files are valid. You may be using DTDs in some files - I recommend upgrading these to use XML schema instead.
  • Some libraries may cause incompatibilities. This can be particularly true if you access web services and/or do XML parsing
  • If you precompile your JSPs in JBoss 4, you probably won t be able to in JBoss 6/7.
  • JBoss 4 and 5 use different message queue implementations. If you have any message queues or topics defined you will need to redefine them.
  • JBoss TreeCache is no longer used. If you use this for caching purposes, you will need to change to use the new JBoss cache instead.
  • JBoss 5 security is different. If your remote clients require secured access to JBoss, you will need to configure them differently.

一些有用的资源包括:

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

JBoss 6官方只针对Java EE Web概要文件进行了认证,因此如果您使用EJB 2.x等“遗留”功能,它们在未来可能不会得到支持。根据应用程序的生命周期,这可能是问题,也可能不是问题。JBoss6目前完全支持EJB2.1,但它还没有通过认证。

我还发现JBoss5处理内存的能力比JBoss4强得多。使用JBoss4,我看到的PermGen错误比使用JBoss5多得多。

问题回答

我只能从JBoss 5.1.0的生产经验和对版本6的一些调查中说起

JBoss 5是Java EE 5以及JBoss 6和7是Java EE 6。API功能的差异在这些规范中得到了最好的证明。JBoss 6的保质期可能很短;它是仅针对Java EE 6 web配置文件进行了认证,错误修复针对版本7(在撰写本文时为第三个测试版)。

我想你会在JBoss社区论坛上得到更好的答案。

我们从JBoss AS 5升级到JBoss AS7,并着眼于WildFly AS 8.1。现在我们不能迁移到8,因为没有MQ系列JMS 2 RAR。

一些差异:

  • 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. 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. 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.
  • The class loading model looks sane and you get a lot of control through jboss-deployment-structure.xml
  • The centralized logging (Slf4j, JUL, JCL, Log4j, …) is really nice.
  • The EJB client library looks much more cleaned up. It s down to 10 JARs from 20, half of them are even OSGi bundles (our client is an Eclipse RCP application).
  • The EJB client maven dependency mess is gone, instead you now get a BOM POM.
  • You get a BOM POM for the server APIs.
  • Faster start up and less memory usage. We deploy 80 EJBs and the MQ Series RAR in 6 seconds without much tuning. Our live dataset is somewhere above 200 MB.
  • The deployments folder is empty by default
  • The (lack of) quality of XNIO is scary. In 7.x it s only used for EJB remoting and we hit several show stopper bugs (deadlocks, double free, socket handle leaks, …). In 8.x it is used for servlets as well instead of Tomcat. There are still a lot of very basic servlet bugs being fixed in undertow.

我们在应用程序中所做的更改:

  • change JNDI names to EE 6 standardized names
  • migrate from JBoss Cache to Infinispan (part of our code has been migrated to the flat API, some parts still use the tree 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
  • the configuration of the EJB client is different
  • all of you scripts for installing, deploying, starting, stopping, …
  • ExternalContext is gone, we had to replace it with a different approach
  • we replaced MBeans in SARs with @StartUp EJBs
  • some ugly hacks for Cocoon

AS7.x系列有很多错误,只有EAP系列才提供修复。如果你想使用7.x而不是8.x,我们强烈建议你购买EAP 6。

这里有一个关于JBoss AS7妥协和未来的有趣线程,还提到了AS5和AS6的问题:

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

Just wanted to bring this to anyone s attention who might be facing PermGen bloat issue after upgrading to the latest. 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. This causes the PermGen bloating as it starts to load all the unwanted classes. To reduce the amount of scanning, the Microcontainer provides another descriptor hook, by means of 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.

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

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

</scanning>




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签