Chapter 4. Server Configuration Changes
4.1. Server Configuration Migration Options
To migrate your server configuration from JBoss EAP 6 to JBoss EAP 7, you can either use the JBoss Server Migration Tool or do a manual migration with the help of the management CLI migrate operation.
JBoss Server Migration Tool
You can use the JBoss Server Migration Tool to update your configuration to include the new features and settings in JBoss EAP 7 while keeping your existing configuration. See Use the JBoss Server Migration Tool to Migrate Server Configurations for more information.
Management CLI Migrate Operation
You can use the management CLI migrate operation to update the jacorb, messaging, and web subsystems in the JBoss EAP 6 server configuration file to allow them run on the new release, but be aware that the result is not a complete JBoss EAP 7 configuration. For example:
-
The operation does not update the original
remoteprotocol and port settings to the newhttp-remotingand new port settings now used in JBoss EAP 7. - The configuration does not include the new JBoss EAP subsystems or features such as clustered singleton deployments, or graceful shutdown.
- The configuration does not include the new Java EE 7 features such as batch processing.
-
The
migrateoperation does not migrate theejb3subsystem configuration. For information about possible EJB migration issues, see EJB Server Configuration Changes.
For more information about using the migrate operation to migration the server configuration, see Management CLI Migration Operation.
4.2. Management CLI Migration Operation
You can use the management CLI to update your JBoss EAP 6 server configuration files to run on JBoss EAP 7. The management CLI provides a migrate operation to automatically update the jacorb, messaging, and web subsystems from the previous release to the new configuration. You can also execute the describe-migration operation for the jacorb, messaging, and web subsystems to review the proposed migration configuration changes before you perform the migration. There are no replacements for the cmp, jaxr, or threads subsystems and they must be removed from the server configuration.
See Server Configuration Migration Options for limitations of the migrate operation. You can also use the JBoss Server Migration Tool to update your configuration to include the new features and settings in JBoss EAP 7 while keeping your existing configuration. See Use the JBoss Server Migration Tool to Migrate Server Configurations for more information.
Table 4.1. Subsystem Migration and Management CLI Operation
| JBoss EAP 6 Subsystem | JBoss EAP 7 Subsystem | Management CLI Operation |
|---|---|---|
| cmp | no replacement | remove |
| jacorb | iiop-openjdk | migrate |
| jaxr | no replacement | remove |
| messaging | messaging-activemq | migrate |
| threads | no replacement | remove |
| web | undertow | migrate |
Start the Server and the Management CLI
Follow the steps below to update your JBoss EAP 6 server configuration to run on JBoss EAP 7.
- Before you begin, review Back Up Important Data and Review Server State. It contains important information about making sure the server is in a good state and the appropriate files are backed up.
Start the JBoss EAP 7 server with the JBoss EAP 6 configuration.
- Back up the JBoss EAP 7 server configuration files.
Copy the configuration file from the previous release into the JBoss EAP 7 directory.
$ cp EAP6_HOME/standalone/configuration/standalone-full.xml EAP7_HOME/standalone/configuration
Navigate to the JBoss EAP 7 install directory and start the server with the
--admin-onlyargument.$ bin/standalone.sh -c standalone-full.xml --admin-only
NoteYou will see the following
org.jboss.as.controller.management-operationERRORS in the server log when you start the server. These errors are expected and indicate that the legacy subsystem configurations must be removed or migrated to JBoss EAP 7.- WFLYCTL0402: Subsystems [cmp] provided by legacy extension 'org.jboss.as.cmp' are not supported on servers running this version. Both the subsystem and the extension must be removed or migrated before the server will function.
- WFLYCTL0402: Subsystems [jacorb] provided by legacy extension 'org.jboss.as.jacorb' are not supported on servers running this version. Both the subsystem and the extension must be removed or migrated before the server will function.
- WFLYCTL0402: Subsystems [jaxr] provided by legacy extension 'org.jboss.as.jaxr' are not supported on servers running this version. Both the subsystem and the extension must be removed or migrated before the server will function.
- WFLYCTL0402: Subsystems [messaging] provided by legacy extension 'org.jboss.as.messaging' are not supported on servers running this version. Both the subsystem and the extension must be removed or migrated before the server will function.
- WFLYCTL0402: Subsystems [threads] provided by legacy extension 'org.jboss.as.threads' are not supported on servers running this version. Both the subsystem and the extension must be removed or migrated before the server will function.
- WFLYCTL0402: Subsystems [web] provided by legacy extension 'org.jboss.as.web' are not supported on servers running this version. Both the subsystem and the extension must be removed or migrated before the server will function.
Open a new terminal, navigate to the JBoss EAP 7 install directory, and start the management CLI using the
--controller=remote://localhost:9999arguments.$ bin/jboss-cli.sh --connect --controller=remote://localhost:9999
Migrate the JacORB, Messaging, and Web Subsystems
To review the configuration changes that will be made to the subsystem before you perform the migration, execute the
describe-migrationoperation.The
describe-migrationoperation uses the following syntax./subsystem=SUBSYSTEM_NAME:describe-migration
The following example describes the configuration changes that will be made to the JBoss EAP 6.4
standalone-full.xmlconfiguration file when it is migrated to JBoss EAP 7. Entries were removed from the output to improve readability and to save space.Example: describe-migration Operation
[standalone@localhost:9999 /] /subsystem=messaging:describe-migration { "outcome" => "success", "result" => { "migration-warnings" => [], "migration-operations" => [ { "operation" => "add", "address" => [("extension" => "org.wildfly.extension.messaging-activemq")], "module" => "org.wildfly.extension.messaging-activemq" }, { "operation" => "add", "address" => [("subsystem" => "messaging-activemq")] }, <!-- *** Entries removed for readability *** --> { "operation" => "remove", "address" => [("subsystem" => "messaging")] }, { "operation" => "remove", "address" => [("extension" => "org.jboss.as.messaging")] } ] } }Execute the
migrateoperation to migrate the subsystem configuration to the subsystem that replaces it in JBoss EAP 7. The operation uses the following syntax./subsystem=SUBSYSTEM_NAME:migrate
NoteThe
messagingsubsystemdescribe-migrationandmigrateoperations allow you to pass an argument to configure access by legacy clients. For more information about the command syntax, see Messaging Subsystem Migration and Forward Compatibility.Review the outcome and result of the command. Be sure the operation completed successfully and there are no "migration-warning" entries. This means the migration configuration for the subsystem is complete.
Example: Successful migrate Operation with No Warnings
[standalone@localhost:9999 /] /subsystem=messaging:migrate { "outcome" => "success", "result" => {"migration-warnings" => []} }If you see "migration-warnings" entries in the log, this indicates the migration of the server configuration completed successfully but it was not able to migrate all of elements and attributes. You must follow the suggestions provided by the "migration-warnings" and run additional management CLI commands to modify those configurations. The following is an example of a
migrateoperation that returns "migration-warnings".Example: migrate Operation with Warnings
[standalone@localhost:9999 /] /subsystem=messaging:migrate { "outcome" => "success", "result" => {"migration-warnings" => [ "WFLYMSG0080: Could not migrate attribute group-address from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupB\") ]. Use instead the socket-binding attribute to configure this broadcast-group.", "WFLYMSG0080: Could not migrate attribute group-port from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupB\") ]. Use instead the socket-binding attribute to configure this broadcast-group.", "WFLYMSG0080: Could not migrate attribute local-bind-address from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupA\") ]. Use instead the socket-binding attribute to configure this broadcast-group.", "WFLYMSG0080: Could not migrate attribute local-bind-port from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupA\") ]. Use instead the socket-binding attribute to configure this broadcast-group.", "WFLYMSG0080: Could not migrate attribute group-address from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupA\") ]. Use instead the socket-binding attribute to configure this broadcast-group.", "WFLYMSG0080: Could not migrate attribute group-port from resource [ (\"subsystem\" => \"messaging-activemq\"), (\"server\" => \"default\"), (\"broadcast-group\" => \"groupA\") ]. Use instead the socket-binding attribute to configure this broadcast-group." ]} }NoteThe list of
migrateanddescribe-migrationwarnings for each subsystem is located in the Reference Material at the end of this guide.Review the server configuration file to verify the extension, subsystem, and namespace were updated and the existing subsystem configuration was migrated to JBoss EAP 7.
NoteYou must repeat this process for each of the
jacorb,messaging, andwebsubsystems using the following commands./subsystem=jacorb:migrate /subsystem=messaging:migrate /subsystem=web:migrate
Remove the
cmp,jaxr, andthreadssubsystems and extensions from the server configuration.While still in the management CLI prompt, remove the obsolete
cmp,jaxr, andthreadssubsystems by executing the following commands./subsystem=cmp:remove /extension=org.jboss.as.cmp:remove /subsystem=jaxr:remove /extension=org.jboss.as.jaxr:remove /subsystem=threads:remove /extension=org.jboss.as.threads:remove
You must migrate the messaging, jacorb, and web subsystems and remove the cmp, jaxr, and threads extensions and subsystems before you can restart the server for normal operation. If you need to restart the server before you complete this process, be sure to include the --admin-only argument on the server start command line. This allows you to continue with the configuration changes.
4.3. Logging Message Prefix Changes
Log messages are prefixed with the project code for the subsystem that reports the message. The prefixes for all log messages have changed in JBoss EAP 7.
For a complete list of the new log message project code prefixes used in JBoss EAP 7, see Project Codes Used in JBoss EAP in the JBoss EAP Development Guide.
4.4. Web Server Configuration Changes
4.4.1. Replace the Web Subsystem with Undertow
Undertow replaces JBoss Web as the web server in JBoss EAP 7. This means the legacy web subsystem configuration must be migrated to the new JBoss EAP 7 undertow subsystem configuration.
-
The
urn:jboss:domain:web:2.2subsystem configuration namespace in the server configuration file has been replaced by theurn:jboss:domain:undertow:3.1namespace. -
The
org.jboss.as.webextension module, located inEAP_HOME/modules/system/layers/base/, has been replaced with theorg.wildfly.extension.undertowextension module.
You can use the management CLI migrate operation to migrate the web subsystem to undertow in the server configuration file. However, be aware that this operation is not able to migrate all JBoss Web subsystem configurations. If you see "migration-warning" entries, you must run additional management CLI commands to migrate those configurations to Undertow. For more information about the management CLI migrate operation, see Management CLI Migration Operation.
The following is an example of the default web subsystem configuration in JBoss EAP 6.
<subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
</subsystem>
The following is an example of the default undertow subsystem configuration in JBoss EAP 7.
<subsystem xmlns="urn:jboss:domain:undertow:3.1">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="server-header" header-name="Server" header-value="JBoss-EAP/7"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
</filters>
</subsystem>4.4.2. Migrate JBoss Web Rewrite Conditions
The management CLI migrate operation is not able to automatically migrate rewrite conditions. They are reported as "migration-warnings" and you must migrate them manually. You can create the equivalent configuration in JBoss EAP 7 by using Undertow Predicates Attributes and Handlers.
The following is an example of a web subsystem configuration in JBoss EAP 6 that includes rewrite configuration.
<subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default" native="false">
<virtual-server name="default" enable-welcome-root="true">
<alias name="localhost"/>
<rewrite name="test" pattern="(.*)/toberewritten/(.*)" substitution="$1/rewritten/$2" flags="NC"/>
<rewrite name="test2" pattern="(.*)" substitution="-" flags="F">
<condition name="get" test="%{REQUEST_METHOD}" pattern="GET"/>
<condition name="andCond" test="%{REQUEST_URI}" pattern=".*index.html" flags="NC"/>
</rewrite>
</virtual-server>
</subsystem>
Follow the Management CLI Migration Operation instructions to start your server and the management CLI, then migrate the web subsystem configuration file using the following command.
/subsystem=web:migrate
The following "migration-warnings" are reported when you run the migrate operation on the above configuration.
/subsystem=web:migrate
{
"outcome" => "success",
"result" => {"migration-warnings" => [
"WFLYWEB0002: Could not migrate resource {
\"pattern\" => \"(.*)\",
\"substitution\" => \"-\",
\"flags\" => \"F\",
\"operation\" => \"add\",
\"address\" => [
(\"subsystem\" => \"web\"),
(\"virtual-server\" => \"default-host\"),
(\"rewrite\" => \"test2\")
]
}",
"WFLYWEB0002: Could not migrate resource {
\"test\" => \"%{REQUEST_METHOD}\",
\"pattern\" => \"GET\",
\"flags\" => undefined,
\"operation\" => \"add\",
\"address\" => [
(\"subsystem\" => \"web\"),
(\"virtual-server\" => \"default-host\"),
(\"rewrite\" => \"test2\"),
(\"condition\" => \"get\")
]
}",
"WFLYWEB0002: Could not migrate resource {
\"test\" => \"%{REQUEST_URI}\",
\"pattern\" => \".*index.html\",
\"flags\" => \"NC\",
\"operation\" => \"add\",
\"address\" => [
(\"subsystem\" => \"web\"),
(\"virtual-server\" => \"default-host\"),
(\"rewrite\" => \"test2\"),
(\"condition\" => \"andCond\")
]
}"
]}
}
Review the server configuration file and you see the following configuration for the undertow subsystem.
The rewrite configuration is dropped.
<subsystem xmlns="urn:jboss:domain:undertow:3.1">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="http" socket-binding="http"/>
<host name="default-host" alias="localhost, example.com">
<location name="/" handler="welcome-content"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
</subsystem>
Use the management CLI to create the filter to replace the rewrite configuration in the undertow subsystem. You should see "{"outcome" ⇒ "success"}" for each command.
# Create the filters
/subsystem=undertow/configuration=filter/expression-filter="test1":add(expression="path('(.*)/toberewritten/(.*)') -> rewrite('$1/rewritten/$2')")
/subsystem=undertow/configuration=filter/expression-filter="test2":add(expression="method('GET') and path('.*index.html') -> response-code(403)")
# Add the filters to the default server
/subsystem=undertow/server=default-server/host=default-host/filter-ref="test1":add
/subsystem=undertow/server=default-server/host=default-host/filter-ref="test2":add
Review the updated server configuration file. The JBoss Web subsystem is now completely migrated and configured in the undertow subsystem.
<subsystem xmlns="urn:jboss:domain:undertow:3.1">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="http" socket-binding="http"/>
<host name="default-host" alias="localhost, example.com">
<location name="/" handler="welcome-content"/>
<filter-ref name="test1"/>
<filter-ref name="test2"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<expression-filter name="test1" expression="path('(.*)/toberewritten/(.*)') -> rewrite('$1/rewritten/$2')"/>
<expression-filter name="test2" expression="method('GET') and path('.*index.html') -> response-code(403)"/>
</filters>
</subsystem>For more information about how to configure filters and handlers using the management CLI, see Configuring the Web Server in the JBoss EAP 7 Configuration Guide.
4.4.3. Migrate JBoss Web System Properties
In the previous release of JBoss EAP, system properties could be used to modify the default JBoss Web behavior. For information about how to configure the same behavior in Undertow, see JBoss Web System Properties Migration Reference
4.4.4. Migrate JBoss Web jboss-web.xml Overlay
In JBoss EAP 6, JBoss Web supported the ability to specify additional static files for a web application using the overlay element in the jboss-web.xml file. This feature did not actually overlay existing files, but instead added static files to a deployment outside of the WAR archive.
In the following jboss-web.xml file example, /tmp/mycontents/test.html was returned by the JBoss EAP 6 server when you accessed the URL http://localhost:8080/example/test.html.
<jboss-web>
<context-root>/example</context-root>
<overlay>/tmp/mycontents/</overlay>
</jboss-web>
Undertow, which replaces JBoss Web in JBoss EAP 7, does not support the jboss-web.xml file overlay feature.
This overlay feature is available if you apply Red Hat JBoss Enterprise Application Platform 7.0 Update 05 or a newer cumulative patch to your JBoss EAP installation.
4.4.5. Migrate Global Valves
Previous releases of JBoss EAP supported valves. Valves are custom classes inserted into the request processing pipeline for an application before servlet filters to make changes to the request or perform additional processing.
- Global valves are inserted into the request processing pipeline of all deployed applications and are configured in the server configuration file.
- Authenticator valves authenticate the credentials of the request.
-
Custom application valves were created by extending the
org.apache.catalina.valves.ValveBaseclass and configured in the<valve>element of thejboss-web.xmldescriptor file. These valves must be migrated manually.
This section describes how to migrate global valves. Migration of custom and authenticator valves are covered in the Migrate Custom Application Valves section of this guide.
Undertow, which replaces JBoss Web in JBoss EAP 7, does not support global valves; however, you should be able to achieve similar functionality by using Undertow handlers. Undertow includes a number of built-in handlers that provide common functionality. It also provides the ability to create custom handlers, which can be used to replace custom valve functionality.
If your application uses valves, you must replace them with the appropriate Undertow handler code to achieve the same functionality when you migrate to JBoss EAP 7.
For more information about how to configure handlers, see Configuring Handlers in the JBoss EAP 7 Configuration Guide.
For more information about how to configure filters, see Configuring Filters in the JBoss EAP 7 Configuration Guide.
Migrate JBoss Web Valves
The following table lists the valves that were provided by JBoss Web in the previous release of JBoss EAP and the corresponding Undertow built-in handler. The JBoss Web valves are located in the org.apache.catalina.valves package.
Table 4.2. Mapping Valves to Handlers
| Valve | Handler |
|---|---|
| AccessLogValve | io.undertow.server.handlers.accesslog.AccessLogHandler |
| CrawlerSessionManagerValve | io.undertow.servlet.handlers.CrawlerSessionManagerHandler |
| ExtendedAccessLogValve | io.undertow.server.handlers.accesslog.AccessLogHandler |
| JDBCAccessLogValve | See the JDBCAccessLogValve Manual Migration Procedure below for instructions. |
| RemoteAddrValve | io.undertow.server.handlers.IPAddressAccessControlHandler |
| RemoteHostValve | io.undertow.server.handlers.AccessControlListHandler |
| RemoteIpValve | io.undertow.server.handlers.ProxyPeerAddressHandler |
| RequestDumperValve | io.undertow.server.handlers.RequestDumpingHandler |
| RewriteValve | See Migrate JBoss Web Rewrite Conditions for instructions to migrate these valves manually. |
| StuckThreadDetectionValve | io.undertow.server.handlers.StuckThreadDetectionHandler |
You can use the management CLI migrate operation to automatically migrate global valves that meet the following criteria:
- They are limited to the valves listed in the previous table that do not require manual processing.
-
They must be defined in the
websubsystem of the server configuration file.
For more information about the management CLI migrate operation, see Management CLI Migration Operation.
JDBCAccessLogValve Manual Migration Procedure
The org.apache.catalina.valves.JDBCAccessLogValve valve is an exception to the rule and can not be automatically migrated to io.undertow.server.handlers.JDBCLogHandler. Follow the steps below to migrate the following example valve.
<valve name="jdbc" module="org.jboss.as.web" class-name="org.apache.catalina.valves.JDBCAccessLogValve">
<param param-name="driverName" param-value="com.mysql.jdbc.Driver" />
<param param-name="connectionName" param-value="root" />
<param param-name="connectionPassword" param-value="password" />
<param param-name="connectionURL" param-value="jdbc:mysql://localhost:3306/wildfly?zeroDateTimeBehavior=convertToNull" />
<param param-name="format" param-value="combined" />
</valve>- Create a driver module for the database that will store the log entries.
Configure the datasource for the database and add the driver to the list of available drivers in the
datasourcessubsystem.<datasources> <datasource jndi-name="java:jboss/datasources/accessLogDS" pool-name="accessLogDS" enabled="true" use-java-context="true"> <connection-url>jdbc:mysql://localhost:3306/wildfly?zeroDateTimeBehavior=convertToNull</connection-url> <driver>mysql</driver> <security> <user-name>root</user-name> <password>Password1!</password> </security> </datasource> ... <drivers> <driver name="mysql" module="com.mysql"> <driver-class>com.mysql.jdbc.Driver</driver-class> </driver> ... </drivers> </datasources>Configure an
expression-filterin theundertowsubsystem with the following expression:jdbc-access-log(datasource=DATASOURCE_JNDI_NAME).<filters> <expression-filter name="jdbc-access" expression="jdbc-access-log(datasource='java:jboss/datasources/accessLogDS')" /> ... </filters>
4.5. JGroups Server Configuration Changes
4.5.1. JGroups Defaults to a Private Network Interface
In the JBoss EAP 6 default configuration, JGroups used the public interface defined in the <interfaces> section of the server configuration file.
Because it is a recommended practice to use a dedicated network interface, by default, JGroups now uses the new private interface that is defined in the <interfaces> section of the server configuration file in JBoss EAP 7.
4.5.2. JGroups Channels Changes
JGroups provides group communication support for HA services in the form of JGroups channels. JBoss EAP 7 introduces <channel> elements to the jgroups subsystem in the server configuration file. You can add, remove, or change the configuration of JGroups channels using the management CLI.
For more information about how to configure JGroups, see Cluster Communication with JGroups in the JBoss EAP Configuration Guide.
4.6. Infinispan Server Configuration Changes
4.6.1. Infinispan Default Cache Configuration Changes
In JBoss EAP 6, the default clustered caches for web session replication and EJB replication were replicated ASYNC caches. This has changed in JBoss EAP 7. The default clustered caches are now distributed ASYNC caches. The replicated caches are no longer even configured by default. See Configure the Cache Mode in the JBoss EAP Configuration Guide for information about how to add a replicated cache and make it the default.
This only affects you when you use the new JBoss EAP 7 default configuration. If you migrate the configuration from JBoss EAP 6, the configuration of the infinispan subsystem will be preserved.
4.6.2. Infinispan Cache Strategy Changes
The behavior of ASYNC cache strategy has changed in JBoss EAP 7.
In JBoss EAP 6, ASYNC cache reads were lock free. Although they would never block, the were prone to dirty reads of stale data, for example on failover. This is because it would allow subsequent requests for the same user to start before the previous request completed. This permissiveness is not acceptable when using distributed mode, since cluster topology changes can affect session affinity and easily result in stale data.
In JBoss EAP 7, ASYNC cache reads require locks. Since they now block new requests from the same user until the previous replication finishes, dirty reads are prevented.
4.6.3. Configuring Custom Stateful Session Bean Cache for Passivation
Be aware of the following restrictions when configuring a custom stateful session bean (SFSB) cache for passivation in JBoss EAP 7.0.
-
The
idle-timeoutattribute, which is configured in theinfinispanpassivation-storeof theejb3subsystem, is deprecated in JBoss EAP 7.0. JBoss EAP 6.4 supported eager passivation, passivating according to theidle-timeoutvalue. JBoss EAP 7.0 supports lazy passivation, passivating when themax-sizethreshold is reached. -
In JBoss EAP 7.0, the cluster name used by the EJB client is determined by the actual cluster name of the channel, as configured in the
jgroupssubsystem. -
JBoss EAP 7.0 still allows you to set the
max-sizeattribute to control the passivation threshold. You should not configure eviction or expiration in your EJB cache configuration.
-
You should configure eviction by using the
max-sizeattribute of thepassivation-storein theejb3subsystem. -
You should configure expiration by using the
@StatefulTimeoutannotation in the SFSB Java source code or by specifying astateful-timeoutvalue in theejb-jar.xmlfile.
-
You should configure eviction by using the
4.7. EJB Server Configuration Changes
There is no migrate operation for the ejb3 subsystem, so if you use the management CLI migrate operations to upgrade your other existing JBoss EAP 6.4 configurations, be aware that the ejb3 subsystem configuration is not migrated. Because the configuration of the ejb3 subsystem is slightly different in JBoss EAP 7.0 than in JBoss EAP 6.4, you might see exceptions in the server log when you deploy your EJB applications.
If you use the JBoss Server Migration Tool to update your server configuration, the ejb3 subsystem should be configured correctly and you should not see any issues when you deploy your EJB applications.
DuplicateServiceException
The following DuplicateServiceException is caused by caching changes in JBoss EAP 7.
DuplicateServiceException in Server Log
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."mdb-1.0-SNAPSHOT.jar".cache-dependencies-installer: org.jboss.msc.service.StartException in service jboss.deployment.unit."mdb-1.0-SNAPSHOT.jar".cache-dependencies-installer: Failed to start service ... Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.infinispan.ejb."mdb-1.0-SNAPSHOT.jar".config is already registered
You must reconfigure the cache to resolve this error.
- Follow the instructions to Start the Server and the Management CLI.
Issue the following commands to reconfigure caching in the
ejb3subsystem./subsystem=ejb3/file-passivation-store=file:remove /subsystem=ejb3/cluster-passivation-store=infinispan:remove /subsystem=ejb3/passivation-store=infinispan:add(cache-container=ejb, max-size=10000) /subsystem=ejb3/cache=passivating:remove /subsystem=ejb3/cache=clustered:remove /subsystem=ejb3/cache=distributable:add(passivation-store=infinispan, aliases=[passivating, clustered])
4.8. Messaging Server Configuration Changes
In JBoss EAP 7, ActiveMQ Artemis replaces HornetQ as the JMS support provider. This section describes how to migrate the configuration and related messaging data.
4.8.1. Messaging Subsystem Server Configuration Changes
The org.jboss.as.messaging module extension, located in EAP_HOME/modules/system/layers/base/, has been replaced by the org.wildfly.extension.messaging-activemq extension module.
The urn:jboss:domain:messaging:3.0 subsystem configuration namespace has been replaced by the urn:jboss:domain:messaging-activemq:1.0 namespace.
Management Model
In most cases, an effort was made to keep the element and attribute names as similar as possible to those used in previous releases. The following table lists some of the changes.
Table 4.3. Mapping Messaging Attributes
| HornetQ Name | ActiveMQ Name |
|---|---|
| hornetq-server | server |
| hornetq-serverType | serverType |
| connectors | connector |
| discovery-group-name | discovery-group |
The management operations invoked on the new messaging-activemq subsystem have changed from /subsystem=messaging/hornetq-server= to /subsystem=messaging-activemq/server=.
You can migrate an existing JBoss EAP 6 messaging subsystem configuration to the messaging-activemq subsystem on a JBoss EAP 7 server by invoking its migrate operation.
/subsystem=messaging:migrate
Before you execute the migrate operation, you can invoke the describe-migration operation to review the list of management operations that will be performed to migrate from the existing JBoss EAP 6 messaging subsystem configuration to the messaging-activemq subsystem on the JBoss EAP 7 server.
/subsystem=messaging:describe-migration
The migrate and describe-migration operations also display a list of migration-warnings for resources or attributes that can not be migrated automatically.
Messaging Subsystem Migration and Forward Compatibility
The describe-migration and migrate operations for the messaging subsystem provide an additional configuration argument. If you want to configure messaging to allow legacy JBoss EAP 6 clients to connect to the JBoss EAP 7 server, you can add the boolean add-legacy-entries argument to the describe-migration or migrate operation as follows.
/subsystem=messaging:describe-migration(add-legacy-entries=true) /subsystem=messaging:migrate(add-legacy-entries=true)
If the boolean argument add-legacy-entries is set to true, the messaging-activemq subsystem creates the legacy-connection-factory resource and adds legacy-entries to the jms-queue and jms-topic resources.
If the boolean argument add-legacy-entries is set to false, no legacy resources are created in the messaging-activemq subsystem and legacy JMS clients will not be able to communicate with the JBoss EAP 7 servers. This is the default value.
For more information about forward and backward compatibility see the Backward and Forward Compatibility in Configuring Messaging for JBoss EAP.
For more information about the management CLI migrate and describe-migration operations, see Management CLI Migration Operation.
Change in Behavior of forward-when-no-consumers Attribute
The behavior of the forward-when-no-consumers attribute has changed in JBoss EAP 7.
In JBoss EAP 6, when forward-when-no-consumers was set to false and there were no consumers in a cluster, messages were redistributed to all nodes in a cluster.
This behavior has changed in JBoss EAP 7. When forward-when-no-consumers is set to false and there are no consumers in a cluster, messages are not redistributed. Instead, they are kept on the original node to which they were sent.
Change in Default Cluster Load Balancing Policy
The default cluster load balancing policy has changed in JBoss EAP 7.
In JBoss EAP 6, the default cluster load balancing policy was similar to STRICT, which is like setting the legacy forward-when-no-consumers parameter to true. In JBoss EAP 7, the default is now ON_DEMAND, which is like setting the legacy forward-when-no-consumers parameter to false. For more information about these settings, see Cluster Connection Attributes in Configuring Messaging for JBoss EAP.
Messaging Subsystem XML Configuration
The XML configuration has changed significantly with the new messaging-activemq subsystem to provide an XML scheme more consistent with other JBoss EAP subsystems.
It is strongly advised that you do not attempt to modify the JBoss EAP messaging subsystem XML configuration to conform to the new messaging-activemq subsystem. Instead, invoke the legacy subsystem migrate operation. This operation will write the XML configuration of the new messaging-activemq subsystem as a part of its execution.
4.8.2. Migrate Messaging Data
Due to the change from HornetQ to ActiveMQ Artemis as the JMS support provider, both the format and the location of the messaging data has changed in JBoss EAP 7.
You can take one of the following two approaches to migrate the data:
-
You can export the HornetQ messaging data from the previous release and import it using the management CLI
import-journaloperation. See Migrate Messaging Data Using Export and Import for more information. - You can migrate the data from the previous release by configuring a JMS bridge. This process is described in Migrate Messaging Data Using a JMS Bridge.
See Mapping Messaging Folder Names for details of the changes to the messaging data folder names between the releases.
4.8.2.1. Migrate Messaging Data Using Export and Import
Using this approach, you export the data from the previous release using the HornetQ exporter utility. You then import the XML formatted output file by using the import-journal operation.
If you are using JBoss EAP 7.0, you must apply Red Hat JBoss Enterprise Application Platform 7.0 Update 05 or a newer cumulative patch to your JBoss EAP installation in order to avoid a known issue when reading large messages. This issue does not affect JBoss EAP 7.1 or later.
For more information, see JBEAP-4407 - Consumer crashes with IndexOutOfBoundsException when reading large messages from imported journal.
Export Messaging Data from the Previous Release
The JBoss EAP 6 server must be stopped before you export the messaging data.
The HornetQ exporter utility generates and exports the messaging data from JBoss EAP 6 to an XML formatted file. This command requires that you specify the paths to the required HornetQ JARs that shipped with JBoss EAP 6, pass the paths to messagingbindings/, messagingjournal/, messagingpaging/, and messaginglargemessages/ folders from the previous release as arguments, and specify an output file in which to write the exported XML data.
The following is the syntax required by the HornetQ exporter utility.
java -jar -mp MODULE_PATH org.hornetq.exporter MESSAGING_BINDINGS_DIRECTORY MESSAGING_JOURNAL_DIRECTORY MESSAGING_PAGING_DIRECTORY MESSAGING_LARGE_MESSAGES_DIRECTORY > OUTPUT_DATA.xml
Create a custom module to ensure the correct versions of the HornetQ JARs, including any JARs installed with patches or upgrades, are loaded and made available to the exporter utility. Using your favorite editor, create a new module.xml file in the EAP6_HOME/modules/org/hornetq/exporter/main/ directory and copy the following content:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.hornetq.exporter">
<main-class name="org.hornetq.jms.persistence.impl.journal.XmlDataExporter"/>
<properties>
<property name="jboss.api" value="deprecated"/>
</properties>
<dependencies>
<module name="org.hornetq"/>
</dependencies>
</module>
The custom module is created in the modules/ directory, not the modules/system/layers/base/ directory.
Follow the steps below to export the data.
- Stop the JBoss EAP 6 server.
- Create the custom module as described above.
Run the following command to export the data.
$ java -jar jboss-modules.jar -mp modules/ org.hornetq.exporter standalone/data/messagingbindings/ standalone/data/messagingjournal/ standalone/data/messagingpaging standalone/data/messaginglargemessages/ > OUTPUT_DIRECTORY/OldMessagingData.xml
- Make sure there are no errors or warning messages in the log at the completion of the command.
- Use tooling available for your operating system to validate the XML in the generated output file.
Import the XML Formatted Messaging Data
You then import the XML formatted output file by using the import-journal operation as follows.
If your target server has already performed some messaging tasks, be sure to back up your messaging folders before you begin the import-journal operation to prevent data loss in the event of an import failure. See Backing Up Messaging Folder Data for more information.
- If you are migrating your JBoss EAP 6.4 server to 7.x, make sure you have completed the migration of the server configuration before you begin by using the management CLI migrate operation or by running the JBoss Server Migration Tool.
Start the JBoss EAP 7.x server in normal mode with NO JMS clients connected.
ImportantIt is important that you start the server with no JMS clients connected. This is because the
:import-journaloperation behaves like a JMS producer. Messages are immediately available when the operation is in progress. If this operation fails in the middle of the import and JMS clients are connected, there is no way to recover because JMS clients might have already consumed some of the messages.
/subsystem=messaging-activemq/server=default:import-journal(file=OUTPUT_DIRECTORY/OldMessagingData.xml)
+
Do NOT run this command more than one time as doing so will result in duplicate messages!
Recovering from an Import Messaging Data Failure
If the import-journal operation fails, you can attempt to recover by using the following steps.
- Shut down the JBoss EAP 7.x server.
- Delete all of the messaging journal folders. See Backing Up Messaging Folder Data for the management CLI commands to determine the correct directory location for the messaging journal folders.
- If you backed up the target server messaging data prior to the import, copy the messaging folders from the backup location to the messaging journal directory determined in the prior step.
- Repeat the steps to import the XML formatted messaging data.
4.8.2.2. Migrate Messaging Data Using a JMS Bridge
Using this approach, you configure and deploy a JMS bridge to the JBoss EAP 7 server that moves messages from the JBoss EAP 6 HornetQ queue to the JBoss EAP 7 ActiveMQ Artemis queue.
A JMS bridge consumes messages from a source JMS queue or topic and sends them to a target JMS queue or topic, which is typically on a different server. It can be used to bridge messages between any JMS servers, as long as they are JMS 1.1 compliant. The source and destination JMS resources are looked up using JNDI and the client classes for the JNDI lookup must be bundled in a module. The module name is then declared in the JMS bridge configuration.
This section describes how to configure the servers and deploy a JMS bridge to move the messaging data from JBoss EAP 6 to JBoss EAP 7.
Configure the JBoss EAP 6 Server
- Stop the JBoss EAP 6 server.
Back up the HornetQ journal and configuration files.
-
By default, the HornetQ journal is located in the
EAP6_HOME/standalone/data/directory. - See Mapping Messaging Folder Names for default messaging folder locations for each release.
-
By default, the HornetQ journal is located in the
-
Make sure that the
InQueueJMS queue containing the JMS messages is defined on the JBoss EAP 6 server. Make sure that
messagingsubsystem configuration contains an entry for theRemoteConnectionFactorysimilar to the following.<connection-factory name="RemoteConnectionFactory"> <entries> <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/> </entries> ... </connection-factory>If it does not contain the entry, create one using the following management CLI command:
/subsystem=messaging/hornetq-server=default/connection-factory=RemoteConnectionFactory:add(factory-type=XA_GENERIC, connector=[netty], entries=[java:jboss/exported/jms/RemoteConnectionFactory],ha=true,block-on-acknowledge=true,retry-interval=1000,retry-interval-multiplier=1.0,reconnect-attempts=-1)
Configure the JBoss EAP 7 Server
The JMS bridge configuration needs the
org.hornetqmodule to connect to the HornetQ server in the previous release. This module and its direct dependencies are not present in JBoss EAP 7, so you must copy the following modules from the previous release.Copy the
org.hornetqmodule into the JBoss EAP 7EAP_HOME/modules/org/directory.-
If you did not apply patches to this module, copy this folder from the JBoss EAP 6.4 server:
EAP6_HOME/modules/system/layers/base/org/hornetq/ -
If you did apply patches to this module, copy this folder from the JBoss EAP 6.4 server:
EAP6_HOME/modules/system/layers/base/.overlays/layer-base-jboss-eap-6.4.x.CP/org/hornetq/
-
If you did not apply patches to this module, copy this folder from the JBoss EAP 6.4 server:
Remove the
<resource-root>for the HornetQlibpath from the JBoss EAP 7EAP_HOME/modules/org/hornetq/main/module.xmlfile.If you did not apply patches to the JBoss EAP 6.4
org.hornetqmodule, remove the following line from the file:<resource-root path="lib"/>
If you did apply patches to the JBoss EAP 6.4
org.hornetqmodule, remove the following lines from the file:<resource-root path="lib"/> <resource-root path="../../../../../org/hornetq/main/lib"/>
WarningFailure to remove the HornetQ
libpathresource-rootwill cause the bridge to fail with the following error in the log file.2016-07-15 09:32:25,660 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) WFLYCTL0013: Operation ("add") failed - address: ([ ("subsystem" => "messaging-activemq"), ("jms-bridge" => "myBridge") ]) - failure description: "WFLYMSGAMQ0086: Unable to load module org.hornetq"
Copy the
org.jboss.nettymodule into the JBoss EAP 7EAP_HOME/modules/org/jboss/directory.-
If you did not apply patches to this module, copy this folder from the JBoss EAP 6.4 server:
EAP6_HOME/modules/system/layers/base/org/jboss/netty/ -
If you did apply patches to this module, copy this folder from the JBoss EAP 6.4 server:
EAP6_HOME/modules/system/layers/base/.overlays/layer-base-jboss-eap-6.4.x.CP/org/jboss/netty
-
If you did not apply patches to this module, copy this folder from the JBoss EAP 6.4 server:
Create the JMS queue to contain the messages received from JBoss EAP 6 server. The following is an example of a management CLI command that creates the
MigratedMessagesQueueJMS queue to receive the message.jms-queue add --queue-address=MigratedMessagesQueue --entries=[jms/queue/MigratedMessagesQueue java:jboss/exported/jms/queue/MigratedMessagesQueue]
This creates the following
jms-queueconfiguration for the default server in themessaging-activemqsubsystem of the JBoss EAP 7 server.<jms-queue name="MigratedMessagesQueue" entries="jms/queue/MigratedMessagesQueue java:jboss/exported/jms/queue/MigratedMessagesQueue"/>
Make sure that
messaging-activemqsubsystemdefaultserver contains a configuration for theInVmConnectionFactoryconnection-factorysimilar to the following:<connection-factory name="InVmConnectionFactory" factory-type="XA_GENERIC" entries="java:/ConnectionFactory" connectors="in-vm"/>
If it does not contain the entry, create one using the following management CLI command:
/subsystem=messaging-activemq/server=default/connection-factory=InVmConnectionFactory:add(factory-type=XA_GENERIC, connectors=[in-vm], entries=[java:/ConnectionFactory])
Create and deploy a JMS bridge that reads messages from the
InQueueJMS queue configured on the JBoss EAP 6 server and transfers them to theMigratedMessagesQueueconfigured on the JBoss EAP 7 server./subsystem=messaging-activemq/jms-bridge=myBridge:add(add-messageID-in-header=true,max-batch-time=100,max-batch-size=10,max-retries=-1,failure-retry-interval=1000,quality-of-service=AT_MOST_ONCE,module=org.hornetq,source-destination=jms/queue/InQueue,source-connection-factory=jms/RemoteConnectionFactory,source-context=[("java.naming.factory.initial"=>"org.jboss.naming.remote.client.InitialContextFactory"),("java.naming.provider.url"=>"remote://127.0.0.1:4447")],target-destination=jms/queue/MigratedMessagesQueue,target-connection-factory=java:/ConnectionFactory)This creates the following
jms-bridgeconfiguration in themessaging-activemqsubsystem of the JBoss EAP 7 server.<jms-bridge name="myBridge" add-messageID-in-header="true" max-batch-time="100" max-batch-size="10" max-retries="-1" failure-retry-interval="1000" quality-of-service="AT_MOST_ONCE" module="org.hornetq"> <source destination="jms/queue/InQueue" connection-factory="jms/RemoteConnectionFactory"> <source-context> <property name="java.naming.factory.initial" value="org.jboss.naming.remote.client.InitialContextFactory"/> <property name="java.naming.provider.url" value="remote://127.0.0.1:4447"/> </source-context> </source> <target destination="jms/queue/MigratedMessagesQueue" connection-factory="java:/ConnectionFactory"/> </jms-bridge>-
If security is configured for JBoss EAP 6, you must also configure the JMS bridge configuration
<source>element to include asource-contextthat specifies the correct user name and password to use for the JNDI lookup when creating the connection.
Migrate the Data
Verify that the information you provided for the following configurations is correct.
- Any queue and topic names
- The java.naming.provider.url for JNDI lookup
- Make sure that you have deployed the target JMS destination to the JBoss EAP 7 server.
- Start both the JBoss EAP 6 and JBoss EAP 7 servers.
4.8.2.3. Mapping Messaging Folder Names
The following table shows the messaging directory names used in the previous release and the corresponding names used in the current release of JBoss EAP. The directories are relative to the jboss.server.data.dir directory, which defaults to EAP_HOME/standalone/data/ if it is not specified.
| JBoss EAP 6 Directory Name | JBoss EAP 7 Directory Name |
|---|---|
| messagingbindings/ | activemq/bindings/ |
| messagingjournal/ | activemq/journal/ |
| messaginglargemessages/ | activemq/largemessages/ |
| messagingpaging/ | activemq/paging/ |
The messaginglargemessages/ and messagingpaging/ directories might not be present if there are no large messages or if paging is disabled.
4.8.2.4. Backing Up Messaging Folder Data
If your target server has already processed messages, it is a good idea to back up the target message folders to a backup location before you begin. The default location of the messaging folders is EAP_HOME/standalone/data/activemq/; however it is configurable. If you are not sure of the location of your messaging data, you can use the following management CLI commands to find the location of the messaging folders.
/subsystem=messaging-activemq/server=default/path=journal-directory:resolve-path /subsystem=messaging-activemq/server=default/path=paging-directory:resolve-path /subsystem=messaging-activemq/server=default/path=bindings-directory:resolve-path /subsystem=messaging-activemq/server=default/path=large-messages-directory:resolve-path
Once you know the location of the folders, copy each folder to a safe backup location.
4.8.3. Migrate JMS Destinations
In previous releases of JBoss EAP, JMS destination queues were configured in the <jms-destinations> element under the <hornetq-server> element in the messaging subsystem.
<hornetq-server>
...
<jms-destinations>
<jms-queue name="testQueue">
<entry name="queue/test"/>
<entry name="java:jboss/exported/jms/queue/test"/>
</jms-queue>
</jms-destinations>
...
</hornetq-server>
In JBoss EAP 7, the JMS destination queue is configured in the default <server> element of the messaging-activemq subsystem.
<server name="default"> ... <jms-queue name="testQueue" entries="queue/test java:jboss/exported/jms/queue/test"/> ... </server>
4.8.4. Migrate Messaging Interceptors
Messaging interceptors have changed significantly in JBoss EAP 7 with the replacement of HornetQ with ActiveMQ Artemis as the JMS messaging provider.
The HornetQ messaging subsystem included in the previous release of JBoss EAP required that you install the HornetQ interceptors by adding them to a JAR and then modifying the HornetQ module.xml file.
The messaging-activemq subsystem included in JBoss EAP 7 does not require modification of a module.xml file. User interceptor classes, which now implement the Apache ActiveMQ Artemis Interceptor interface, can now be loaded from any server module. You specify the module from which the interceptor should be loaded in the messaging-activemq subsystem of the server configuration file.
Example Interceptor Configuration
<subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
<server name="default">
...
<incoming-interceptors>
<class name="com.mycompany.incoming.myInterceptor" module="com.mycompany" />
<class name="com.othercompany.incoming.myOtherInterceptor" module="com.othercompany" />
</incoming-interceptors>
<outgoing-interceptors>
<class name="com.mycompany.outgoing.myInterceptor" module="com.mycompany" />
<class name="com.othercompany.outgoing.myOtherInterceptor" module="com.othercompany" />
</outgoing-interceptors>
</server>
</subsystem>
4.8.5. Replace Netty Servlet Configuration
In JBoss EAP 6, you could configure a servlet engine to work with the Netty Servlet transport. Because ActiveMQ Artemis replaces HornetQ as the built-in messaging provider in JBoss EAP 7, this configuration is no longer available. You must replace the servlet configuration to use the new built-in messaging http connectors and http acceptors instead.
4.8.6. Changes in JMS Serialization Behavior Between Releases
The serialVersionUID of javax.jms.JMSException changed between JMS 1.1 and JMS 2.0.0. This means that if an instance of a JMSException, or any of its subclasses, is serialized using JMS 1.1, it cannot be deserialized using JMS 2.0.0. The reverse is also true. If an instance of JMSException is serialized using JMS 2.0.0, it cannot be deserialized using JMS 1.1. In both of these cases, it throws an exception similar to the following:
javax.jms.JMSException: javax.jms.JMSException; local class incompatible: stream classdesc serialVersionUID = 8951994251593378324, local class serialVersionUID = 2368476267211489441
This issue is fixed in the JMS 2.0.1 maintenance release.
The following table details the JMS implementation for each JBoss EAP release.
Table 4.4. JMS Implementation for Each JBoss EAP Release
| JBoss EAP Version | JMS Implementation | JMS version |
|---|---|---|
| 6.4 | HornetQ | JMS 1.1 |
| 7.0 | Apache ActiveMQ Artemis | JMS 2.0.0 |
Be aware that the serialVersionUID incompatibility can result in a migration issue in the following situation.
-
If you send a message that contains a
JMSExceptionusing a JBoss EAP 6.4 client, migrate your messaging data to JBoss EAP 7.0, and then attempt to deserialize that message using a JBoss EAP 7.0 client, the deserialization will fail and it will throw an exception. This is because theserialVersionUIDin JMS 1.1 is not compatible with the one in JMS 2.0.0.
Red Hat recommends that you consume all JMS 1.1 messages that contain JMSExceptions before migrating messaging data from JBoss EAP 6.4 to JBoss EAP 7.0.
4.9. JMX Management Changes
The HornetQ component in JBoss EAP 6 provided its own JMX management; however, it was not recommended and is now deprecated and no longer supported. If you relied on this feature in JBoss EAP 6, you must migrate your management tooling to use either the JBoss EAP management CLI or the JMX management provided with JBoss EAP 7.
You must also upgrade your client libraries to use the jboss-client.jar that ships with JBoss EAP 7.
The following is an example of HornetQ JMX management code that was used in JBoss EAP 6.
JMXConnector connector = null;
try {
HashMap environment = new HashMap();
String[] credentials = new String[]{"admin", "Password123!"};
environment.put(JMXConnector.CREDENTIALS, credentials);
// HornetQ used the protocol "remoting-jmx" and port "9999"
JMXServiceURL beanServerUrl = new JMXServiceURL("service:jmx:remoting-jmx://127.0.0.1:9999");
connector = JMXConnectorFactory.connect(beanServerUrl, environment);
MBeanServerConnection mbeanServer = connector.getMBeanServerConnection();
// The JMX object name pointed to the HornetQ JMX management
ObjectName objectName = new ObjectName("org.hornetq:type=Server,module=JMS");
// The invoked method name was "listConnectionIDs"
String[] connections = (String[]) mbeanServer.invoke(objectName, "listConnectionIDs", new Object[]{}, new String[]{});
for (String connection : connections) {
System.out.println(connection);
}
} finally {
if (connector != null) {
connector.close();
}
}The following is an example of the equivalent code needed for ActiveMQ Artemis in JBoss EAP 7.
JMXConnector connector = null;
try {
HashMap environment = new HashMap();
String[] credentials = new String[]{"admin", "Password123!"};
environment.put(JMXConnector.CREDENTIALS, credentials);
// ActiveMQ Artemis uses the protocol "remote+http" and port "9990"
JMXServiceURL beanServerUrl = new JMXServiceURL("service:jmx:remote+http://127.0.0.1:9990");
connector = JMXConnectorFactory.connect(beanServerUrl, environment);
MBeanServerConnection mbeanServer = connector.getMBeanServerConnection();
// The JMX object name points to the new JMX management in the `messaging-activemq` subsystem
ObjectName objectName = new ObjectName("jboss.as:subsystem=messaging-activemq,server=default");
// The invoked method name is now "listConnectionIds"
String[] connections = (String[]) mbeanServer.invoke(objectName, "listConnectionIds", new Object[]{}, new String[]{});
for (String connection : connections) {
System.out.println(connection);
}
} finally {
if (connector != null) {
connector.close();
}
}Notice that the method names and parameters have changed in the new implementation. You can find the new method names in the JConsole by following these steps.
Connect to the JConsole using the following command.
EAP_HOME/bin/jconsole.sh- Connect to JBoss EAP local process. Note that it should start with "jboss-modules.jar".
- In the MBeans tab, choose jboss.as → messaging-activemq → default → Operations to display the list of method names and attributes.
4.10. ORB Server Configuration Changes
The JacORB implementation has been replaced with a downstream branch of the OpenJDK ORB in JBoss EAP 7.
The org.jboss.as.jacorb extension module, located in EAP_HOME/modules/system/layers/base/, has been replaced by the org.wildfly.iiop-openjdk extension module.
The urn:jboss:domain:jacorb:1.4 subsystem configuration namespace in the server configuration file has been replaced by the urn:jboss:domain:iiop-openjdk:1.0 namespace.
The following is an example of the default jacorb system configuration in JBoss EAP 6.
<subsystem xmlns="urn:jboss:domain:jacorb:1.4">
<orb socket-binding="jacorb" ssl-socket-binding="jacorb-ssl">
<initializers security="identity" transactions="spec"/>
</orb>
</subsystem>
The following is an example of the default iiop-openjdk subsystem configuration in JBoss EAP 7.
<subsystem xmlns="urn:jboss:domain:iiop-openjdk:1.0">
<orb socket-binding="jacorb" ssl-socket-binding="jacorb-ssl" />
<initializers security="identity" transactions="spec" />
</subsystem>
The new iiop-openjdk subsystem configuration accepts only a subset of the legacy elements and attributes. The following is an example of a jacorb subsystem configuration in the previous release of JBoss EAP that contains all valid elements and attributes:
<subsystem xmlns="urn:jboss:domain:jacorb:1.4">
<orb name="JBoss" print-version="off" use-imr="off" use-bom="off" cache-typecodes="off"
cache-poa-names="off" giop-minor-version="2" socket-binding="jacorb" ssl-socket-binding="jacorb-ssl">
<connection retries="5" retry-interval="500" client-timeout="0" server-timeout="0"
max-server-connections="500" max-managed-buf-size="24" outbuf-size="2048"
outbuf-cache-timeout="-1"/>
<initializers security="off" transactions="spec"/>
</orb>
<poa monitoring="off" queue-wait="on" queue-min="10" queue-max="100">
<request-processors pool-size="10" max-threads="32"/>
</poa>
<naming root-context="JBoss/Naming/root" export-corbaloc="on"/>
<interop sun="on" comet="off" iona="off" chunk-custom-rmi-valuetypes="on"
lax-boolean-encoding="off" indirection-encoding-disable="off" strict-check-on-tc-creation="off"/>
<security support-ssl="off" add-component-via-interceptor="on" client-supports="MutualAuth"
client-requires="None" server-supports="MutualAuth" server-requires="None"/>
<properties>
<property name="some_property" value="some_value"/>
</properties>
</subsystem>The following element attributes are no longer supported and must be removed.
Table 4.5. Attributes to Remove
| Element | Unsupported Attributes |
|---|---|
|
|
|
|
|
|
The following on/off attributes are no longer supported and will not be migrated when you run the management CLI migrate operation. If they are set to on, you will get a migration warning. Other on/off attributes that are not mentioned in this table, for example <security support-ssl="on|off">, are still supported and will be migrated successfully. The only difference is that their values will be changed from on/off to true/false.
Table 4.6. Attributes to Turn Off or Remove
| Element | Attributes to Set to Off |
|---|---|
|
|
|
|
|
(all except
|
|
|
|
4.11. Migrate the Threads Subsystem Configuration
The JBoss EAP 6 server configuration included a threads subsystem that was used to manage thread pools across the various subsystems in the server.
The threads subsystem is no longer available in JBoss EAP 7. Instead, each subsystem is responsible for managing its own thread pools.
For information about how to configure thread pools for the infinispan subsystem, see Configure Infinispan Thread Pools in the JBoss EAP Configuration Guide.
For information about how to configure thread pools for the jgroups subsystem, see Configure JGroups Thread Pools in the JBoss EAP Configuration Guide.
In JBoss EAP 6, you configured thread pools for connectors and listeners for the web subsystem by referencing an executor that was defined in the threads subsystem. In JBoss EAP 7, you now configure thread pools for the undertow subsystem by referencing a worker that is defined in the io subsystem. For more information, see Configuring the IO Subsystem in the JBoss EAP Configuration Guide.
For information about about changes to thread pool configuration in the remoting subsystem, see Migrate the Remoting Subsystem Configuration in this guide, and Configuring the Endpoint in the JBoss EAP Configuration Guide.
4.12. Migrate the Remoting Subsystem Configuration
In JBoss EAP 6, you configured the thread pool for the remoting subsystem by setting various worker-* attributes. The worker thread pool is no longer configured in the remoting subsystem in JBoss EAP 7 and if you attempt to modify the existing configuration, you will see the following message.
WFLYRMT0022: Worker configuration is no longer used, please use endpoint worker configuration
In JBoss EAP 7, the worker thread pool is replaced by an endpoint configuration that references a worker defined in the io subsystem.
For information about how to configure the endpoint, see Configuring the Endpoint in the JBoss EAP Configuration Guide.
4.13. WebSocket Server Configuration Changes
To use WebSockets in JBoss EAP 6, you had to enable the non blocking Java NIO2 connector protocol for the http connector in the web subsystem of the JBoss EAP server configuration file using a command similar to the following.
/subsystem=web/connector=http/:write-attribute(name=protocol,value=org.apache.coyote.http11.Http11NioProtocol)
To use WebSockets in an application, you also had to create a <enable-websockets> element in the application WEB-INF/jboss-web.xml file and set it to true.
In JBoss EAP 7, you no longer need to configure the server for default WebSocket support or configure the application to use it. WebSockets are a requirement of the Java EE 7 specification and the required protocols are configured by default. More complex WebSocket configuration is done in the servlet-container of the undertow subsystem of the JBoss EAP server configuration file. You can view the available settings using the following command.
/subsystem=undertow/servlet-container=default/setting=websockets:read-resource(recursive=true)
{
"outcome" => "success",
"result" => {
"buffer-pool" => "default",
"dispatch-to-worker" => true,
"worker" => "default"
}
}WebSocket code examples can also be found in the quickstarts that ship with JBoss EAP.
4.14. Single Sign-on Server Changes
The infinispan subsystem still provides distributed caching support for HA services in the form of Infinispan caches in JBoss EAP 7; however the caching and distribution of authentication information is handled differently than in previous releases.
In JBoss EAP 6, if single sign-on (SSO) was not provided an Infinispan cache, the cache was not distributed.
In JBoss EAP 7, SSO is distributed automatically when you select the HA profile. When running the HA profile, each host has its own Infinispan cache, which is based on the default cache of the web cache container. This cache stores the relevant session and SSO cookie information for the host. JBoss EAP handles propagation of individual cache information to all hosts. There is no way to specifically assign an Infinispan cache to SSO in JBoss EAP 7.
In JBoss EAP 7, SSO is configured in the undertow subsystem of the server configuration file.
There are no application code changes required for SSO when migrating to JBoss EAP 7.
4.15. DataSource Configuration Changes
4.15.1. JDBC Datasource Driver Name
When you configured a datasource in the previous release of JBoss EAP, the value specified for the driver name depended on the number of classes listed in the META-INF/services/java.sql.Driver file contained in the JDBC driver JAR.
Driver Containing a Single Class
If the META-INF/services/java.sql.Driver file specified only one class, the driver name value was simply the name of the JDBC driver JAR. This has not changed in JBoss EAP 7.
Driver Containing Multiple Classes
IIn JBoss EAP 6, if there was more than one class listed in META-INF/services/java.sql.Driver file, you specified which class was the driver class by appending its name to the JAR name, along with the major and minor version, in the following format.
JAR_NAME + DRIVER_CLASS_NAME + "_" + MAJOR_VERSION + "_" + MINOR_VERSION
In JBoss EAP 7, this has changed. You now specify the driver name using the following format.
JAR_NAME + "_" + DRIVER_CLASS_NAME + "_" + MAJOR_VERSION + "_" + MINOR_VERSION
An underscore has been added between the JAR_NAME and the DRIVER_CLASS_NAME.
The MySQL 5.1.31 JDBC driver is an example of a driver that contains two classes. The driver class name is com.mysql.jdbc.Driver. The following examples demonstrate the differences between how you specify the driver name in the previous and current release of JBoss EAP.
Example JBoss EAP 6 Driver Name
mysql-connector-java-5.1.31-bin.jarcom.mysql.jdbc.Driver_5_1
Example JBoss EAP 7 Driver Name
mysql-connector-java-5.1.31-bin.jar_com.mysql.jdbc.Driver_5_1
4.16. Security Server Configuration Changes
For information about Java Security Manager server configuration changes, see Considerations Moving from Previous Versions in How To Configure Server Security for JBoss EAP.
4.17. Transactions Subsystem Changes
Some Transaction Manager configuration attributes that were available in the transactions subsystem in JBoss EAP 6 have changed in JBoss EAP 7.
Removed Transactions Subsystem Attributes
The following table lists the JBoss EAP 6 attributes that were removed from the transactions subsystem in JBoss EAP 7 and the equivalent replacement attributes.
| Attribute in JBoss EAP 6 | Replacement in JBoss EAP 7 |
|---|---|
| path | object-store-path |
| relative-to | object-store-relative-to |
Deprecated Transactions Subsystem Attributes
The following attributes that were available in the transactions subsystem in JBoss EAP 6 are deprecated in JBoss EAP 7. The deprecated attributes might be removed in a future release of the product. The following table lists the equivalent replacement attributes.
| Attribute in JBoss EAP 6 | Replacement in JBoss EAP 7 |
|---|---|
| use-hornetq-store | use-journal-store |
| hornetq-store-enable-async-io-to | journal-store-enable-async-io |
| enable-statistics | statistics-enabled |
4.18. Changes to mod_cluster Configuration
The configuration for static proxy lists in mod_cluster has changed in JBoss EAP 7.
In JBoss EAP 6, you configured the proxy-list attribute, which was a comma-separated list of httpd proxy addresses specified in the format of hostname:port.
The proxy-list attribute is deprecated in JBoss EAP 7. It has been replaced by the proxies attribute, which is a list of outbound socket binding names.
This change impacts how you define a static proxy list, for example, when disabling advertising for mod_cluster. For information about how to disable advertising for mod_cluster, see Disable Advertising for mod_cluster in the JBoss EAP Configuration Guide.
For more information about mod_cluster attributes, see ModCluster Subsystem Attributes in the JBoss EAP Configuration Guide.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.