Red Hat Training

A Red Hat training course is available for Red Hat JBoss Enterprise Application Platform

Capítulo 7. Migrando a partir de versões mais antigas do JBoss EAP

7.1. Migrando do JBoss EAP 5 para o JBoss EAP 7

Este guia concentra-se nas alterações necessárias para executar e implementar com êxito os aplicativos JBoss EAP 6 no JBoss EAP 7. Se você planeja migrar seus aplicativos diretamente do JBoss EAP 5 para o JBoss EAP 7, há uma série de recursos disponíveis para ajudá-lo planejar e executar sua migração. Sugerimos que você adote a seguinte abordagem.

  1. Consulte Resumo das alterações feitas em cada versão neste guia para obter uma visão geral rápida e de alto nível das alterações feitas em cada lançamento do JBoss EAP.
  2. Leia o JBoss EAP 6 Guia de Migração e este guia para se familiarizar com o conteúdo de cada um.
  3. Use a referência de atualização de componente do JBoss EAP 5 como uma referência rápida às informações de migração sobre componentes e recursos específicos.
  4. A ferramenta de migração baseada em regras Windup continua a adicionar regras para ajudá-lo a migrar diretamente do JBoss EAP 5 para o JBoss EAP 7. Você pode usar essa ferramenta para analisar seu aplicativo e gerar relatórios detalhados sobre as mudanças necessárias para migrar para o JBoss EAP 7. Para obter mais informações, consulte Usar Windup para Analisar Aplicativos para Migração .
  5. A base de conhecimento do Portal do Cliente contém atualmente artigos e soluções para ajudar na migração do JBoss EAP 5 para o JBoss EAP 6. Existem planos para adicionar conteúdo adicional para a migração do JBoss EAP 5 para o JBoss EAP 7 ao longo do tempo.

7.2. Resumo das alterações feitas em cada lançamento

Antes de planejar a sua migração, você deve estar ciente das alterações feitas no JBoss EAP 6 e no JBoss EAP 7.

O Guia de Migração JBoss EAP 6 abrange as alterações feitas entre o JBoss EAP 5 e o JBoss EAP 6. A seguir, uma lista condensada das alterações mais significativas feitas no JBoss EAP 6.

  • Implementado uma nova arquitetura construída no contêiner de serviço modular
  • Uma implementação certificada da especificação Java Enterprise Edition 6
  • Introduziu gerenciamento de domínio, nova configuração de implantação e nova estrutura de diretórios de arquivo e scripts
  • Padronizado em novos namespaces JNDI portáteis

Consulte Revise o que há de novo e diferente no JBoss EAP 6 no JBoss EAP 6 Guia de Migração para obter uma lista detalhada das alterações feitas nessa versão.

O JBoss EAP 7 é construído na mesma estrutura modular como o JBoss EAP 6 e inclui o mesmo gerenciamento de domínio, configuração de implantação, estrutura de diretório de arquivos e scripts. Ele também usa os mesmos espaço de nomes JNDI padronizados. Porém, o JBoss EAP 7 introduz as seguintes alterações.

  • Adiciona suporte para a especificação Java Enterprise Edition 7
  • Substitui o servidor web por Undertow
  • Substitui a implementação JacORB IIOP por um ramificação downstream do OpenJDK ORB
  • Inclui o Apache ActiveMQ Artemis como o novo provedor de mensagens
  • Remove os subsistemas cmp, jaxr e threads .
  • Remove o suporte para beans de entidade EJB

Para uma lista completa das alterações, consulte Revise o que há de novo no JBoss EAP 7

7.3. Revise o conteúdo nos Guias de Migração

Revise todo o conteúdo do Guia de Migração para cada lançamento conhecer os recursos que foram adicionados ou preteridos e para entender a configuração do servidor e as alterações de aplicativo necessárias para executar os aplicativos existentes para a versão.

Como a arquitetura subjacente não foi alterada entre o JBoss EAP 6 e o JBoss EAP 7, muitas das alterações documentadas no Guia de Migração do JBoss EAP 6 ainda são válidas. Por exemplo, alterações documentadas sob Alterações necessárias pela maioria dos aplicativos são relacionadas as alterações de arquitetura subjacentes feitas no JBoss EAP 6, que ainda se aplicam a esta versão. A mudança para o novo sistema modular de carregamento de classe é significativa e afeta o empacotamento e as dependências de quase todas as aplicações JBoss EAP 5. Muitas das alterações listadas sob Alterações dependentes da arquitetura de seus aplicativos e componentes também são válidas. Entretanto, como o JBoss EAP 7 substituiu o servidor Web, ORB e provedor de mensagens; removeu os subsistemas cmp, threads e jaxr e removeu suporte para beans de entidade EJB, você deve consultar este guia para quaisquer alterações relacionadas as áreas destes componentes. Preste atenção especial ao Alterações às configurações de servidor e Alterações na migração de aplicativo detalhadas neste guia antes de começar.

7.4. Referência de atualização do componente JBoss EAP 5

Use a tabela a seguir para encontrar informações sobre como migrar um recurso ou componente específico do JBoss EAP 5 para JBoss EAP 7.

JBoss EAP 5
Recurso ou componente
Resumo de alterações e
Onde encontrar informações de migração

Empacotamento de aplicativo e carregamento de classe

In JBoss EAP 6, the previous hierarchical class loading structure was replaced with a modular architecture based on JBoss Modules. Application packaging also changed due to the new modular class loading structure. This architecture is still used in JBoss EAP 7. For information about the new modular architecture, see the following chapter in the JBoss EAP 7 Development Guide.

For information about how to update and repackage applications for the new modular architecture, see the following section in the JBoss EAP 6 Migration Guide.

Application Configuration Files

Due to the changes in JBoss EAP 6 to use modular class loading, you might need to create or modify one or more application configuration files to add dependencies or to prevent automatic dependencies from loading. This has not changed in JBoss EAP 7. For details, see the following section in the JBoss EAP 6 Migration Guide.

Caching and Infinispan

JBoss Cache was replaced by Infinispan for internal use by the server only in JBoss EAP 6. See the following sections in the JBoss EAP 6 Migration Guide for information about how to replace JBoss Cache in application code.

Infinispan caching strategy and configuration changes for JBoss EAP 7 are documented in the following section of this guide.

Data Sources and Resource Adapters

JBoss EAP 6 consolidated configuration of data sources and resource adapters into mainly one file and this is still true in JBoss EAP 7. See the following section in the JBoss EAP 6 Migration Guide for more information.

In addition, the ability to configure a generic JMS resource adapter to connect to a JMS provider is no longer supported in JBoss EAP 7. See the following section in this guide.

Directory Structure, Scripts, and Deployment Configuration

In JBoss EAP 6, the directory structure, scripts, and deployment configuration changed. These changes are still valid in JBoss EAP 7. See the following section of the JBoss EAP 6 Migration Guide for more information.

EJB

The Java EE 7 specification made EJB 2.x and earlier features optional, so it is strongly recommended that you rewrite your application code to use the EJB 3.x specification and JPA. For information about deprecated features and changes required to run EJB 2.x, see the following section in the JBoss EAP 6 Migration Guide.

In JBoss EAP 6, stateful EJB cache and stateless session bean pool size is configured in the ejb3 subsystem of the server configuration file. The jboss-ejb3.xml deployment descriptor replaces the jboss.xml deployment descriptor file. For more information about these changes, see the following section in the JBoss EAP 6 Migration Guide.

The default remote connector and port has changed in JBoss EAP 7. For more information about this and server configuration changes, see the following sections in this guide.

EJB entity beans are not supported in JBoss EAP 7. For information about how to migrate entity beans to JPA, see the following section in this guide.

Hibernate e JPA

In JBoss EAP 6, Hibernate was updated from version 3 to version 4. This version of JBoss EAP also implemented the JPA 2.0 specification and changes were made to JPA persistence properties. For information about how to modify your application for these changes, see the following section in the JBoss EAP 6 Migration Guide.

JBoss EAP 7 implements JPA 2.1 and includes Hibernate 5. It also updates Hibernate Search from version 4.6.x to version 5.5.x. Other changes include removal of support for EJB entity beans and additional updates to JPA persistence properties. For information about how these changes impact your applications, see the following sections in this guide.

JAX-RS and RESTEasy

JBoss EAP 6 bundled RESTEasy 2, which automatically configured RESTEasy and required changes in application configuration. See the following section in the JBoss EAP 6 Migration Guide for information.

JBoss EAP 7 includes RESTEasy 3 and many classes have been deprecated. The version of Jackson changed from version 1.9.9 to version 2.6.3 or greater. For details about these changes, see the following section in this guide.

JBoss AOP

JBoss AOP (Aspect Oriented Programming) was removed in JBoss EAP 6. For information about how to refactor applications that use JBoss AOP, see the following section in the JBoss EAP 6 Migration Guide.

JGroups and Clustering

The way you enable clustering and specify bind addresses changed in JBoss EAP 6. See the following section in the JBoss EAP 6 Migration Guide for more information.

In JBoss EAP 7, JGroups now defaults to using a private network interface instead of a public network interface and also introduces <channel> elements to the jgroups subsystem. JBoss EAP 7 also includes the Undertow mod_cluster implementation, introduces a new API for building singleton services, and other new clustering features. These changes are documented in the following sections of this guide.

JNDI

JBoss EAP 6 implemented a new standardized global JNDI namespace and a series of related namespaces that map to the various scopes of a Java EE application. See the following section of the JBoss EAP 6 Migration Guide for information about application changes needed to use the new JNDI namespace rules.

JSF

JBoss EAP 6 included JSF 2.0 and allowed you to configure your application to use an older version. This is no longer possible in JBoss EAP 7, which now includes JSF 2.2. See the following section in this guide for more information.

Registro em Log

JBoss EAP 6 introduced a new JBoss Logging framework that is still used in JBoss EAP 7. Applications that use third-party logging frameworks might be impacted by the modular class loading changes. Review the following section in the JBoss EAP 6 Migration Guide for information about these changes.

In JBoss EAP 7, annotations in the org.jboss.logging package are now deprecated, which impacts source code and Maven GAVs (groupId:artifactId:version). The prefixes for all log messages were also changed. For more information about these changes, see the following sections in this guide.

Messaging and JMS

In JBoss EAP 6, HornetQ replaced JBoss Messaging as the default JMS implementation. Then in JBoss EAP 7, ActiveMQ Artemis replaced HornetQ as the built-in messaging provider.

The best approach to migrating your messaging configuration is to start with the JBoss EAP 7 default server configuration and use the following guide to apply your current messaging configuration changes.

If you want to understand the changes required to move from JBoss Messaging to HornetQ, review the following section of the JBoss EAP 6 Migration Guide.

Then review the following information about how to migrate the HornetQ configuration and related messaging data in this guide.

ORB

In JBoss EAP 6, JacORB configuration was moved from the EAP_HOME/server/production/conf/jacorb.properties file to the server configuration file. JBoss EAP 7 then replaced the JacORB IIOP implementation with a downstream branch of the OpenJDK ORB.

The best approach to migrating your ORB configuration is to start with the JBoss EAP 7 default server configuration and use the following section in the JBoss EAP 7 Configuration Guide to apply the your current ORB configuration changes.

Remote Invocation

A new EJB client API was introduced in JBoss EAP 6 for remote invocations; however, if you preferred not to rewrite your application code to use the new API, you could modify your existing code to use the ejb:BEAN_REFERENCE for remote access to EJBs. See the following section in the JBoss EAP 6 Migration Guide for more information.

In JBoss EAP 7, the default connector and default remote connection port changed. For more information, see the following sections in this guide.

Seam 2.x

While official support for Seam 2.2 applications was dropped in JBoss EAP 6, it was still possible to configure dependencies for JSF 1.2 and Hibernate 3 to allow Seam 2.2 applications to run on that release. JBoss EAP 7, which now includes JSF 2.2 and Hibernate 5, does not support Seam 2.2 or Seam 2.3 due to end of life of Red Hat JBoss Web Framework Kit. It is recommended that you rewrite your Seam components using Weld CDI beans.

Segurança

Security updates in JBoss EAP 6 included changes to security domain names and changes to how to configure security for basic authentication. The LDAP security realm configuration was moved to the server configuration file. See the following sections in the JBoss EAP 6 Migration Guide for more information.

Updates that impact security in JBoss EAP 7 include server configuration changes and application changes. Information can be found in the following sections of this guide.

Spring Applications

Spring 4.2.x is the earliest stable Spring version supported by JBoss EAP 7. For information about Apache CXF Spring web services and Spring RESTEasy integration changes, see the following sections in this guide.

Transações

JBoss EAP 6 consolidated transaction configuration and moved it to the server configuration file. Other updates included changes to JTA node identifier settings and how to enable JTS. For details, see the following section in the JBoss EAP 6 Migration Guide.

Some Transaction Manager configuration attributes that were available in the transactions subsystem in JBoss EAP 6 have changed in JBoss EAP 7. For more information, see the following section in this guide.

Valves

Undertow replaced JBoss Web in JBoss EAP 7 and valves are no longer supported. See the following sections in this guide.

Serviços da Web

JBoss EAP 6 included JBossWS 4. For information about the changes required by that version update, see the following section in the JBoss EAP 6 Migration Guide.

JBoss EAP 7 introduced JBossWS 5. See the following section in this guide for required updates.