从Jboss EAP 6.4迁移到EAP 7.1
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了从Jboss EAP 6.4迁移到EAP 7.1相关的知识,希望对你有一定的参考价值。
POM
org.jboss.eap
wildfly-ejb-client-bom
7.1.1.GA-redhat-2
pom
import
org.jboss.eap
wildfly-jms-client-bom
7.1.1.GA-redhat-2
pom
import
```
* 升级dependency
```
org.jboss.spec.javax.servlet
jboss-servlet-api_3.1_spec
provided
org.jboss.remoting
jboss-remoting
provided
org.jboss.spec.javax.ejb
jboss-ejb-api_3.2_spec
provided
org.jboss.spec.javax.jms
jboss-jms-api_2.0_spec
provided
...
```
# JSF 1.2
EAP 7不支持JSF 1.2,可从EAP 6将JSF 1.2 Module(包含javax.faces.api,com.sun.jsf-impl,org.jboss.as.jsf-injection)迁移过来,module.xml内容无需更改,建议修改一下module版本urn:jboss:module:1.5
如部署使用的ear包,在jboss-deployment-structure.xml中增加如下配置:
```
```
# Hibernate 3.5
* 强烈建议升级到Hibernate 5,如确实不能升级,需创建一个3.5 module,放入依赖包,module配置如下:
```
```
* jboss-deployment-structure.xml中排除org.hibernate,引入3.5
```
```
* 修改persistence.xml
```
org.hibernate.ejb.HibernatePersistence
java:jboss/datasources/scheduleDatasource
...
...
```
# HornetQ
EAP 7 使用了ActiveMQ Artemis取代了HornetQ,原Message-Driven Bean不需更改,需更改配置和客户端调用代码。
* jms-destinations
EAP 6中jms-destinations配置如下:
```
...
...
```
要更改为:
```
...
...
```
* security
如不启用security,增加如下配置:
```
...
```
* Dependency
```
org.apache.activemq
artemis-jms-client
provided
org.jboss.spec.javax.jms
jboss-jms-api_2.0_spec
provided
org.jboss.spec.javax.json
jboss-json-api_1.0_spec
provided
```
* org.apache.activemq.artemis module取代org.hornetq
* 更改PROVIDER_URL
EAP 7,默认connector从remote改为http-remoting,默认remote connection port从4447改为8080,PROVIDER_URL要从remote://localhost:4447修改为http-remoting://localhost:8080。
* 更改INITIAL_CONTEXT_FACTORY
从org.jboss.naming.remote.client.InitialContextFactory修改为org.wildfly.naming.client.WildFlyInitialContextFactory。
# EJB
* POM dependency
```
org.jboss
jboss-ejb-client
provided
org.jboss.remoting
jboss-remoting
provided
org.wildfly
wildfly-naming-client
provided
org.jboss.spec.javax.ejb
jboss-ejb-api_3.2_spec
provided
org.jboss.spec.javax.transaction
jboss-transaction-api_1.2_spec
provided
org.jboss.marshalling
jboss-marshalling-river
provided
org.jboss.xnio
xnio-api
provided
org.jboss.xnio
xnio-nio
provided
```
* jboss-ejb-client.properties
EAP 6:
```
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.protocol=remote
remote.connection.default.host=localhost
remote.connection.default.port=4447
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
```
EAP 7:
```
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.protocol=http-remoting
remote.connection.default.host=localhost
remote.connection.default.port=8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
```
* 修改客户端代码
EAP 6:
```
java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
java.naming.provider.url=remote://localhost:4447
```
EAP 7:
```
java.naming.factory.initial=org.wildfly.naming.client.WildFlyInitialContextFactory
java.naming.provider.url=http-remoting://localhost:8080
```
# 参考文档
[Jboss EAP 7.1 Migration Guide](https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/migration_guide/)
[Using the JBoss Server Migration Tool](https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/using_the_jboss_server_migration_tool/)
[Developing EJB Applications](https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html-single/developing_ejb_applications/#project_dependencies_for_remote_ejb_clients)
[Configuring Messaging](https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/configuring_messaging/)以上是关于从Jboss EAP 6.4迁移到EAP 7.1的主要内容,如果未能解决你的问题,请参考以下文章
如何定义 JBoss 安全角色 - 从 WebSphere 迁移到 EAP 6.4
从 JBoss AS 7.1 迁移到 JBoss EAP 7.3.0
Jboss (6.4 EAP) 到 WebSphere (7.x)
JBoss EAP 7.1 部署失败的集成器:未找到提供程序
Jboss EAP 6.4 无法在模块中定义类 org.springframework.web.servlet.DispatcherServlet
Jboss 4.2.3 迁移到 Jboss 7 EAP、数据源和安全性